Skip to content

Commit

Permalink
fixed unicode by parse channel name
Browse files Browse the repository at this point in the history
  • Loading branch information
XJIOP committed Aug 22, 2020
1 parent a8b9baa commit f8f33df
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,12 @@ private List<Dummy.Channel> filterChannels(String source) {
String end_name = ANY_END_NAME ? "(?:.*)?" : "";

for (Map.Entry<String, String> ch : channels.entrySet()) {
log("channel | " + ch);
log("channel: " + ch);

// Pattern p = Pattern.compile("^(#EXTINF:[0-9-]+[^\\r\\n]*,[ \\t]?(" + Pattern.quote(ch.getKey()) + hd + end_name + ")\\r?\\n[^* ]*)^[ \\t]?((?:https?|rtmp|rtsp):\\/\\/\\S+)$", Pattern.CASE_INSENSITIVE|Pattern.MULTILINE);
Pattern p = Pattern.compile("(#EXTINF:[0-9-]+[^\\r\\n]*,[ \\t]*(" + Pattern.quote(ch.getKey()) + hd + end_name + ")\\r?\\n.*)\\s*((?:https?|rtmp|rtsp):\\/\\/\\S+)", Pattern.CASE_INSENSITIVE);
Pattern p = Pattern.compile("(#EXTINF:[0-9-]+[^\\r\\n]*,[ \\t]*(" + Pattern.quote(ch.getKey()) + hd + end_name + ")\\r?\\n.*)\\s*((?:https?|rtmp|rtsp):\\/\\/\\S+)", Pattern.CASE_INSENSITIVE|Pattern.UNICODE_CASE);
Matcher m = p.matcher(source);
while (m.find()) {
log("found channel | " + ch);
log(" - found: " + ch);

String extinf = m.group(1);
String name = m.group(2);
Expand Down Expand Up @@ -436,4 +435,4 @@ private void log(String text) {
private boolean isNullEmpty(String text) {
return text == null || text.isEmpty();
}
}
}

0 comments on commit f8f33df

Please sign in to comment.