34
35
private static final int wartenKurz = 2000;
35
36
private static final int wartenLang = 4000;
37
public static final String SENDER = "SWR";
38
public final static String SENDERNAME = "SWR";
39
40
public MediathekSwr(MSFilmeSuchen ssearch, int startPrio) {
40
super(ssearch, /* name */ SENDER, /* threads */ 2, /* urlWarten */ wartenLang, startPrio);
41
super(ssearch, SENDERNAME , /* threads */ 2, /* urlWarten */ wartenLang, startPrio);
43
44
//===================================
67
68
//===================================
69
70
//===================================
70
private void addToList__(String ADRESSE) {
71
private void addToList__() {
73
final String MUSTER_START = "<div style=\"\" class=\"media mediaA\">";
72
74
final String MUSTER_URL = "<a href=\"tvshow.htm?show=";
73
75
final String MUSTER_THEMA = "title=\"";
74
76
MSStringBuilder strSeite = new MSStringBuilder(MSConst.STRING_BUFFER_START_BUFFER);
75
strSeite = getUrlIo.getUri(nameSenderMReader, ADRESSE, MSConst.KODIERUNG_UTF, 2, strSeite, "");
77
strSeite = getUrlIo.getUri(SENDERNAME, "http://swrmediathek.de/tvlist.htm", MSConst.KODIERUNG_UTF, 2, strSeite, "");
81
while (!MSConfig.getStop() && (pos = strSeite.indexOf(MUSTER_URL, pos)) != -1) {
82
pos += MUSTER_URL.length();
84
pos2 = strSeite.indexOf("\"", pos);
85
if (pos1 != -1 && pos2 != -1 && pos1 != pos2) {
86
url = strSeite.substring(pos1, pos2);
88
pos = strSeite.indexOf(MUSTER_THEMA, pos);
89
pos += MUSTER_THEMA.length();
91
pos2 = strSeite.indexOf("\"", pos);
92
if (pos1 != -1 && pos2 != -1) {
93
thema = strSeite.substring(pos1, pos2);
94
thema = StringEscapeUtils.unescapeHtml4(thema.trim()); //wird gleich benutzt und muss dann schon stimmen
97
MSLog.fehlerMeldung(-163255009, MSLog.FEHLER_ART_MREADER, "MediathekSwr.addToList__", "keine URL");
99
//url = url.replace("&", "&");
100
String[] add = new String[]{"http://swrmediathek.de/tvshow.htm?show=" + url, thema};
101
listeThemen.addUrl(add);
81
while (!MSConfig.getStop() && (pos = strSeite.indexOf(MUSTER_START, pos)) != -1) {
82
pos += MUSTER_START.length();
83
url = strSeite.extract(MUSTER_URL, "\"", pos);
84
thema = strSeite.extract(MUSTER_THEMA, "\"", pos);
85
thema = StringEscapeUtils.unescapeHtml4(thema.trim()); //wird gleich benutzt und muss dann schon stimmen
86
if (thema.isEmpty()) {
87
MSLog.fehlerMeldung(-915263078, MSLog.FEHLER_ART_MREADER, "MediathekSwr.addToList__", "kein Thema");
90
MSLog.fehlerMeldung(-163255009, MSLog.FEHLER_ART_MREADER, "MediathekSwr.addToList__", "keine URL");
92
//url = url.replace("&", "&");
93
String[] add = new String[]{"http://swrmediathek.de/tvshow.htm?show=" + url, thema};
94
listeThemen.addUrl(add);
131
124
private void themenSeitenSuchen(String strUrlFeed, String thema) {
132
final String MUSTER_URL = "<li><a class=\"plLink\" href=\"player.htm?show=";
125
final String MUSTER_URL = "<a href=\"/player.htm?show=";
133
126
//strSeite1 = getUrl.getUri_Utf(nameSenderMReader, strUrlFeed, strSeite1, thema);
134
strSeite1 = getUrlThemaLaden.getUri(nameSenderMReader, strUrlFeed, MSConst.KODIERUNG_UTF, 2 /* versuche */, strSeite1, thema);
127
strSeite1 = getUrlThemaLaden.getUri(SENDERNAME, strUrlFeed, MSConst.KODIERUNG_UTF, 2 /* versuche */, strSeite1, thema);
135
128
meldung(strUrlFeed);
140
134
while (!MSConfig.getStop() && (pos1 = strSeite1.indexOf(MUSTER_URL, pos1)) != -1) {
141
135
if (!MSConfig.senderAllesLaden) {
152
146
pos1 += MUSTER_URL.length();
153
147
if ((pos2 = strSeite1.indexOf("\"", pos1)) != -1) {
154
148
url = strSeite1.substring(pos1, pos2);
149
if (gefunden.contains(url)) {
155
157
if (url.equals("")) {
156
158
MSLog.fehlerMeldung(-875012369, MSLog.FEHLER_ART_MREADER, "MediathekSwr.addFilme2", "keine URL, Thema: " + thema);
172
174
// :"entry_media","attr":{"val0":"flashmedia","val1":"1","val2":"rtmp://fc-ondemand.swr.de/a4332/e6/swr-fernsehen/eisenbahn-romantik/381104.s.flv","val3":"rtmp://fc-ondemand.swr.de/a4332/e6/"},"sub":[]},{"name":"entry_media","attr":{"val0":"flashmedia","val1":"2","val2":"rtmp://fc-ondemand.swr.de/a4332/e6/swr-fernsehen/eisenbahn-romantik/381104.m.flv","val3":"rtmp://fc-ondemand.swr.de/a4332/e6/"},"sub":[]
173
175
// "entry_title":"\"Troika-Tragödie - Verspielt die Regierung unser Steuergeld?\"
175
strSeite2 = getUrlThemaLaden.getUri_Utf(nameSenderMReader, urlJson, strSeite2, "");
177
strSeite2 = getUrlThemaLaden.getUri_Utf(SENDERNAME, urlJson, strSeite2, "");
176
178
if (strSeite2.length() == 0) {
177
179
MSLog.fehlerMeldung(-95623451, MSLog.FEHLER_ART_MREADER, "MediathekSwr.json", "Seite leer: " + urlJson);
199
201
if (smallUrl.isEmpty()) {
200
202
smallUrl = getSuperSmalUrl();
202
DatenFilm film = new DatenFilm(nameSenderMReader, thema, strUrlFeed, title, normalUrl, ""/*rtmpURL*/, date, time, duration, description,
204
DatenFilm film = new DatenFilm(SENDERNAME, thema, strUrlFeed, title, normalUrl, ""/*rtmpURL*/, date, time, duration, description,
203
205
thumbNailUrl, keywords);
205
207
if (!urldHd.isEmpty()) {