Skip to content

Commit

Permalink
Merge branch 'hotfix/2.7.4'
Browse files Browse the repository at this point in the history
fixed: NDR - Fehlende Filme
fixed: ARD - Fehlende Sendungen

closed #96
closed #97
  • Loading branch information
alex1702 committed Feb 25, 2017
2 parents e925c58 + d03a96f commit bc17ca1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'de.mediathekview'
version = '2.7.3'
version = '2.7.4'

def jarName = 'MServer.jar'
def mainClass = 'mServer.Main'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mServer/crawler/sender/MediathekArd.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ private void filmSuchen2(String urlFilm_, String thema, String titel, long dauer
if (seite2.indexOf("quality\":3") >= 0) {
if (liste.size() <= 0) {
// Fehler
// System.out.println("Test");
}
}
for (String s : liste) {
Expand All @@ -352,6 +351,7 @@ private void filmSuchen2(String urlFilm_, String thema, String titel, long dauer
liste.clear();

seite2.extractList("\"_quality\":2", "\"_stream\":\"", "\"", liste);
seite2.extractList("_quality\":\"auto\",\"_server\":\"\",\"_cdn\":\"flashls\",\"_stream\":\"", "\"", liste);
seite2.extractList("\"_quality\":2", "\"_stream\":[\"", "\"", liste);
for (String s : liste) {
if (s.startsWith("http")) {
Expand Down
47 changes: 23 additions & 24 deletions src/main/java/mServer/crawler/sender/MediathekNdr.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
import mSearch.daten.DatenFilm;
import mSearch.tool.Log;
import mSearch.tool.MSStringBuilder;
import mServer.crawler.CrawlerTool;
import mServer.crawler.FilmeSuchen;
import mServer.crawler.GetUrl;
import mServer.crawler.CrawlerTool;

public class MediathekNdr extends MediathekReader implements Runnable {

Expand Down Expand Up @@ -298,7 +298,7 @@ void filmSuchen_1(String strUrlThema, String thema, String titel, String filmWeb

// http://media.ndr.de/progressive/2012/0820/TV-20120820-2300-0701.hi.mp4
// rtmpt://cp160844.edgefcs.net/ondemand/mp4:flashmedia/streams/ndr/2012/0820/TV-20120820-2300-0701.hq.mp4
final String MUSTER_URL = "3: {src:'http://";
final String MUSTER_URL = "itemprop=\"contentUrl\" content=\"https://mediandr-a";
seite2 = getUrl.getUri_Utf(SENDERNAME, filmWebsite, seite2, "strUrlThema: " + strUrlThema);
String description = extractDescription(seite2);
String[] keywords = extractKeywords(seite2);
Expand All @@ -313,17 +313,21 @@ void filmSuchen_1(String strUrlThema, String thema, String titel, String filmWeb
int pos2;
String url;
try {
if ((pos1 = seite2.indexOf(MUSTER_URL)) != -1) {
// src="/fernsehen/hallondsopplatt162-player_image-2c09ece0-0508-49bf-b4d6-afff2be2115c_theme-ndrde.html"
// http://www.ndr.de/fernsehen/hallondsopplatt162-ppjson_image-2c09ece0-0508-49bf-b4d6-afff2be2115c.json
// id="pp_hallondsopplatt162"
String json = seite2.extract("-player_image-", "_");
String pp = seite2.extract("id=\"pp_", "\"");
if (!json.isEmpty() && !pp.isEmpty()) {
json = "http://www.ndr.de/fernsehen/" + pp + "-ppjson_image-" + json + ".json";
filmSuchen_2(strUrlThema, thema, titel, filmWebsite, json, datum, zeit, durationInSeconds, description, subtitle);

} else if ((pos1 = seite2.indexOf(MUSTER_URL)) != -1) {
pos1 += MUSTER_URL.length();
if ((pos2 = seite2.indexOf("'", pos1)) != -1) {
if ((pos2 = seite2.indexOf("\"", pos1)) != -1) {
url = seite2.substring(pos1, pos2);
if (!url.equals("")) {
url = "http://" + url;
if (url.contains("http://media.ndr.de/progressive")) {
if (url.contains("hi.mp4")) {
url = url.replace("hi.mp4", "hq.mp4");
}
}
url = "http://mediandr-a" + url;
if (thema.equals("")) {
thema = seite2.extract("<h1>", "<div class=\"subline\">", "<");
if (thema.contains("|")) {
Expand Down Expand Up @@ -352,20 +356,9 @@ void filmSuchen_1(String strUrlThema, String thema, String titel, String filmWeb
Log.errorLog(623657941, "keine URL: " + filmWebsite);
}
}
} else {
// MSLog.fehlerMeldung(698970145, "keine Url: " + filmWebsite);
// src="/fernsehen/hallondsopplatt162-player_image-2c09ece0-0508-49bf-b4d6-afff2be2115c_theme-ndrde.html"
// http://www.ndr.de/fernsehen/hallondsopplatt162-ppjson_image-2c09ece0-0508-49bf-b4d6-afff2be2115c.json
// id="pp_hallondsopplatt162"

String json = seite2.extract("-player_image-", "_");
String pp = seite2.extract("id=\"pp_", "\"");
if (json.isEmpty() || pp.isEmpty()) {
Log.errorLog(915230214, "auch keine json-Url: " + filmWebsite);
} else {
json = "http://www.ndr.de/fernsehen/" + pp + "-ppjson_image-" + json + ".json";
filmSuchen_2(strUrlThema, thema, titel, filmWebsite, json, datum, zeit, durationInSeconds, description, subtitle);
}
} else {
Log.errorLog(915230214, "auch keine Url: " + filmWebsite);
}
} catch (Exception ex) {
Log.errorLog(699830157, ex);
Expand All @@ -377,7 +370,7 @@ void filmSuchen_2(String strUrlThema, String thema, String titel, String filmWeb

seite3 = getUrl.getUri_Utf(SENDERNAME, json, seite3, "strUrlThema: " + strUrlThema);
String url_hd = "", url_xl = "", url_m = "";
seite3.extractList("", "", "\"src\": \"http://media.ndr.de", "\"", "http://media.ndr.de", liste);
seite3.extractList("", "", "\"src\": \"https://mediandr", "\"", "https://mediandr", liste);

for (String s : liste) {
if (s.endsWith(".hd.mp4")) {
Expand All @@ -394,6 +387,12 @@ void filmSuchen_2(String strUrlThema, String thema, String titel, String filmWeb
url_m = "";
}

final String http = "http:";
final String https = "https:";
url_hd = url_hd.replaceFirst(https, http);
url_xl = url_xl.replaceFirst(https, http);
url_m = url_m.replaceFirst(https, http);

if (subtitle.isEmpty()) {
subtitle = seite3.extract("\"tracks\":", "\"/", "\"", "http://www.ndr.de/");
}
Expand Down

0 comments on commit bc17ca1

Please sign in to comment.