From f8f33dfd6d9fa3a98572ab4a1c6c502fa7d986c4 Mon Sep 17 00:00:00 2001 From: XJIOP Date: Sat, 22 Aug 2020 21:14:23 +0200 Subject: [PATCH] fixed unicode by parse channel name --- src/Main.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Main.java b/src/Main.java index 6f435a0..5b35c3e 100644 --- a/src/Main.java +++ b/src/Main.java @@ -309,13 +309,12 @@ private List filterChannels(String source) { String end_name = ANY_END_NAME ? "(?:.*)?" : ""; for (Map.Entry 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); @@ -436,4 +435,4 @@ private void log(String text) { private boolean isNullEmpty(String text) { return text == null || text.isEmpty(); } -} +} \ No newline at end of file