Skip to content

Commit

Permalink
fixed: NDR: keine HD-Videos mehr
Browse files Browse the repository at this point in the history
closed #262
  • Loading branch information
alex1702 committed Oct 8, 2017
2 parents b6acfc6 + dfda304 commit 3515824
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 46 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apply from: "${project.rootDir}/gradle/eclipse.gradle"
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'de.mediathekview'
version = '3.1.26'
version = '3.1.27'

def jarName = 'MServer.jar'
def mainClass = 'mServer.Main'
Expand Down
51 changes: 6 additions & 45 deletions src/main/java/mServer/crawler/sender/MediathekNdr.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private void feedEinerSeiteSuchen(String strUrlFeed, String tthema) {
duration = duration.replace("min", "").trim();
durationInSeconds = convertDuration(duration, strUrlFeed);
}
filmSuchen_1(strUrlFeed, thema, titel, url, datum, zeit, durationInSeconds, tage);
filmSuchen_1(strUrlFeed, thema, titel, url, datum, zeit, durationInSeconds);
}
} catch (Exception ex) {
Log.errorLog(693219870, strUrlFeed);
Expand Down Expand Up @@ -310,7 +310,7 @@ private String[] parseDateTime(String dateTimeValue, String strUrlFeed) {
}

private void filmSuchen_1(String strUrlThema, String thema, String titel, String filmWebsite, String datum, String zeit,
long durationInSeconds, boolean onlyUrl) {
long durationInSeconds) {
//playlist: [
//{
//1: {src:'http://hds.ndr.de/z/2013/0419/TV-20130419-1010-0801.,hi,hq,.mp4.csmil/manifest.f4m', type:"application/f4m+xml"},
Expand All @@ -319,7 +319,6 @@ private void filmSuchen_1(String strUrlThema, String thema, String titel, String

// 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 = "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 @@ -331,8 +330,6 @@ private void filmSuchen_1(String strUrlThema, String thema, String titel, String
}
meldung(filmWebsite);
int pos1;
int pos2;
String url;
try {
// 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
Expand All @@ -347,47 +344,11 @@ private void filmSuchen_1(String strUrlThema, String thema, String titel, String
}
}

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";
String json = seite2.extract("<meta itemprop=\"embedURL\" content=\"", "\"");
if (!json.isEmpty()) {
json = json.replace("-player.html", "-ardjson.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) {
url = seite2.substring(pos1, pos2);
if (!url.isEmpty()) {
url = "http://mediandr-a" + url;
if (thema.isEmpty()) {
thema = seite2.extract("<h1>", "<div class=\"subline\">", "<");
if (thema.contains("|")) {
thema = thema.substring(0, thema.lastIndexOf("|"));
thema = thema.trim();
}
if (thema.contains("-")) {
thema = thema.substring(0, thema.lastIndexOf("-"));
thema = thema.trim();
}
if (thema.contains("Uhr")) {
thema = "";
}
if (thema.isEmpty()) {
thema = "NDR";
}
}
DatenFilm film = new DatenFilm(SENDERNAME, thema, filmWebsite, titel, url, ""/*rtmpURL*/, datum, zeit, durationInSeconds, description);
CrawlerTool.addUrlSubtitle(film, subtitle);
if (url.contains(".hq.")) {
String urlKlein = url.replace(".hq.", ".hi.");
CrawlerTool.addUrlKlein(film, urlKlein, "");
}
addFilm(film, onlyUrl);
} else {
Log.errorLog(623657941, "keine URL: " + filmWebsite);
}
}

} else {
Log.errorLog(915230214, "auch keine Url: " + filmWebsite);
}
Expand All @@ -401,7 +362,7 @@ private void filmSuchen_2(String strUrlThema, String thema, String titel, String

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

for (String s : liste) {
if (s.endsWith(".hd.mp4")) {
Expand Down

0 comments on commit 3515824

Please sign in to comment.