Add catchup replace

pull/585/head
FongMi 11 months ago
parent 4f8a925a54
commit d33272d0bd
  1. 3
      app/src/main/java/com/fongmi/android/tv/api/LiveParser.java

@ -27,6 +27,7 @@ import java.util.regex.Pattern;
public class LiveParser { public class LiveParser {
private static final Pattern CATCHUP_REPLACE = Pattern.compile(".*catchup-replace=\"(.?|.+?)\".*");
private static final Pattern CATCHUP_SOURCE = Pattern.compile(".*catchup-source=\"(.?|.+?)\".*"); private static final Pattern CATCHUP_SOURCE = Pattern.compile(".*catchup-source=\"(.?|.+?)\".*");
private static final Pattern CATCHUP = Pattern.compile(".*catchup=\"(.?|.+?)\".*"); private static final Pattern CATCHUP = Pattern.compile(".*catchup=\"(.?|.+?)\".*");
private static final Pattern TVG_LOGO = Pattern.compile(".*tvg-logo=\"(.?|.+?)\".*"); private static final Pattern TVG_LOGO = Pattern.compile(".*tvg-logo=\"(.?|.+?)\".*");
@ -96,6 +97,7 @@ public class LiveParser {
} else if (line.startsWith("#EXTM3U")) { } else if (line.startsWith("#EXTM3U")) {
catchup.setType(extract(line, CATCHUP)); catchup.setType(extract(line, CATCHUP));
catchup.setSource(extract(line, CATCHUP_SOURCE)); catchup.setSource(extract(line, CATCHUP_SOURCE));
catchup.setReplace(extract(line, CATCHUP_REPLACE));
if (live.getEpg().isEmpty()) live.setEpg(extract(line, TVG_URL).replace("\"", "")); if (live.getEpg().isEmpty()) live.setEpg(extract(line, TVG_URL).replace("\"", ""));
if (live.getEpg().isEmpty()) live.setEpg(extract(line, URL_TVG).replace("\"", "")); if (live.getEpg().isEmpty()) live.setEpg(extract(line, URL_TVG).replace("\"", ""));
if (live.getEpg().isEmpty()) live.setEpg(extract(line, "tvg-url=", "url-tvg=")); if (live.getEpg().isEmpty()) live.setEpg(extract(line, "tvg-url=", "url-tvg="));
@ -107,6 +109,7 @@ public class LiveParser {
Catchup unknown = Catchup.create(); Catchup unknown = Catchup.create();
unknown.setType(extract(line, CATCHUP)); unknown.setType(extract(line, CATCHUP));
unknown.setSource(extract(line, CATCHUP_SOURCE)); unknown.setSource(extract(line, CATCHUP_SOURCE));
unknown.setReplace(extract(line, CATCHUP_REPLACE));
channel.setCatchup(Catchup.decide(unknown, catchup)); channel.setCatchup(Catchup.decide(unknown, catchup));
} else if (!line.startsWith("#") && line.contains("://")) { } else if (!line.startsWith("#") && line.contains("://")) {
String[] split = line.split("\\|"); String[] split = line.split("\\|");

Loading…
Cancel
Save