summarylogtreecommitdiffstats
path: root/myvideo.patch
blob: adab701d0eda920a23840e5f4e75d8a1e3bac884 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
Update myvideo plugin.
Index: xvst-2.4.1/resources/services/myvideo/myvideo.js
===================================================================
--- xvst-2.4.1.orig/resources/services/myvideo/myvideo.js	2011-10-15 22:31:29.502370150 +0200
+++ xvst-2.4.1/resources/services/myvideo/myvideo.js	2011-10-15 22:31:42.338370040 +0200
@@ -1,179 +1,179 @@
-/*
-*
-* This file is part of xVideoServiceThief,
-* an open-source cross-platform Video service download
-*
-* Copyright (C) 2007 - 2009 Xesc & Technology
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with xVideoServiceThief. If not, see <http://www.gnu.org/licenses/>.
-*
-* Contact e-mail: Xesc <xeskuu.xvst@gmail.com>
-* Program URL   : http://xviservicethief.sourceforge.net/
-*
-*/
-
-function RegistVideoService()
-{
-	this.version = "2.0.0";
-	this.minVersion = "2.0.0a";
-	this.author = "Xesc & Technology 2009";
-	this.website = "http://www.myvideo.de/";
-	this.ID = "myvideo.de";
-	this.caption = "MyVideo";
-	this.adultContent = false;
-	this.musicSite = false;
-}
-
-function getVideoInformation(url)
-{
-	const URL_FLV = "%1/%2.flv";
-	// video information
-	var result = new VideoDefinition();
-	// download webpage
-	var http = new Http();
-	var html = http.downloadWebpage(url);
-	// get the flv url and params
-	var path = copyBetween(html, "<link rel='image_src' href='", "/thumbs");
-	var vidId = copyBetween(html, path + "/thumbs/", "_");
-	// get the video title
-	result.title = copyBetween(html, "entry-title'>", "</a>");
-	// build final url
-	result.URL = strFormat(URL_FLV, path, vidId);
-	// get cookies
-	result.cookies = http.getCookies("|");
-	// return the video information
-	return result;
-}
-
-function searchVideos(keyWord, pageIndex)
-{
-	const URL_SEARCH = "http://www.myvideo.de/Videos_A-Z?lpage=%2&searchWord=%1&searchOrder=0";
-	const HTML_SEARCH_START = "<table class='body sCenter vl_newMargin'>"; //'<div class="lBox lLeftBox globalBxBorder globalBx video_list">';
-	const HTML_SEARCH_FINISH = '</table>'; //"</body>";
-	const HTML_SEARCH_SEPARATOR = "<td class='body sTLeft hslice entry-content vCont' id='slice_";
-	// replace all spaces for "+"
-	keyWord = strReplace(keyWord, " ", "+");
-	// init search results object
-	var searchResults = new SearchResults();
-	// init http object
-	var http = new Http();
-	var html = http.downloadWebpage(strFormat(URL_SEARCH, keyWord, pageIndex, searchResults.getUserLanguage()));
-	// get the search summary
-	var tmp = copyBetween(html, '<td> Dein Ergebnis', '</td>');
-	var summary = "Dein Ergebnis" + copyBetween(tmp, "<span class='sWord'>", "'");
-	var tmp = copyBetween(html, "<span class='pView pnPages'>", "</span>");
-	var summary = summary + " " + tmp
-	var tmp = copyBetween(html, "<span class='pView pnResults'>", "</span>");
-	var summary = summary + " " + tmp
-	searchResults.setSummary(summary);
-	// get results html block
-	var htmlResults = copyBetween(html, HTML_SEARCH_START, HTML_SEARCH_FINISH);
-	// if we found some results then...
-	if (htmlResults != "")
-	{
-		var block = "";
-		// iterate over results
-		while ((block = copyBetween(htmlResults, HTML_SEARCH_SEPARATOR, HTML_SEARCH_SEPARATOR)) != "")
-		{
-			parseResultItem(searchResults, block);
-			htmlResults = strRemove(htmlResults, 0, block.toString().length);
-		}
-		// get last result
-		parseResultItem(searchResults, htmlResults);
-	}
-	// return search results
-	return searchResults;
-}
-
-function parseResultItem(searchResults, html)
-{
-	const VIDEO_URL = "http://www.myvideo.de";
-	// vars
-	var tmp, videoUrl, imageUrl, title, description, duration, rating;
-	// get title and image url
-	tmp = copyBetween(html, "<div class='vThumb'>", '</div>') ;
-	title = copyBetween(tmp, "title='", "'");
-	imageUrl = copyBetween(tmp, "src='", "'");
-	// get video url
-	videoUrl = VIDEO_URL + copyBetween(tmp, "href='", "'");
-	//if (strIndexOf(imageUrl, "default.jpg") == -1) // if is not a "default.jpg"...
-	//	imageUrl = copyBetween(tmp, 'thumb="', '"');
-	// get video description
-	tmp = copyBetween(html, "<div class='sCenter vTitle'>", '</div>') ;
-	description = copyBetween(tmp, "<span class='hidden'>", '</span>');
-	// get video duration
-	tmp = copyBetween(html, ' Lnge ', '/span>');
-	duration = convertToSeconds(copyBetween(tmp, "> ", '<'));
-	// get rating
-	rating = getrating(copyBetween(html, 'ratingBox', '</div>'));
-	// add to results list
-	searchResults.addSearchResult(videoUrl, imageUrl, title, description, duration, rating);
-}
-
-function getrating(text)
-{
-	var rating = 0
-	var i = 1
-	while (i < 6)
-	{
-		var part = getToken(text, '<img',i);
-		if (strIndexOf(part,"m_star_red_0.gif") != -1)
-		{
-			rating = rating + 1
-		}
-		if (strIndexOf(part,"m_star_half_0.gif") != -1)
-		{
-			rating = rating + 0.5
-		}
-		i++
-	}
-	return rating;
-}
-
-function convertToSeconds(text)
-{
-	// how many ":" exists?
-	var count = getTokenCount(text, ":");
-	// get mins and seconds
-	var h = new Number(h = count == 3 ? getToken(text, ":", 0) * 3600 : 0);
-	var m = new Number(getToken(text, ":", count - 2) * 60);
-	var s = new Number(getToken(text, ":", count - 1));
-	// convert h:m:s to seconds
-	return h + m + s;
-}
-
-function getVideoServiceIcon()
-{
-	return new Array(
-		0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,
-		0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x08,0x03,0x00,0x00,0x00,0x28,0x2d,0x0f,
-		0x53,0x00,0x00,0x00,0x66,0x50,0x4c,0x54,0x45,0x3d,0x88,0xe5,0x49,0x8f,0xe7,0x55,
-		0x97,0xe8,0x61,0x9e,0xea,0x62,0x9e,0xea,0x6e,0xa6,0xec,0x7a,0xad,0xed,0x85,0xb5,
-		0xee,0x86,0xb5,0xef,0x92,0xbc,0xf0,0x9e,0xc3,0xf2,0x9e,0xc4,0xf2,0xaa,0xcb,0xf4,
-		0xb6,0xd2,0xf5,0xc2,0xda,0xf7,0xce,0xe1,0xf8,0xda,0xe9,0xfa,0xdb,0xe9,0xfa,0xe7,
-		0xf0,0xfc,0xf3,0xf8,0xfd,0xff,0x66,0x00,0xff,0x70,0x10,0xff,0x79,0x20,0xff,0x8c,
-		0x40,0xff,0x96,0x50,0xff,0x9f,0x60,0xff,0xb3,0x80,0xff,0xbc,0x8f,0xff,0xc6,0x9f,
-		0xff,0xcf,0xaf,0xff,0xd9,0xbf,0xff,0xec,0xe0,0xff,0xf5,0xef,0xff,0xff,0xff,0x48,
-		0xd7,0xaa,0x42,0x00,0x00,0x00,0x8c,0x49,0x44,0x41,0x54,0x18,0x19,0x05,0xc1,0x09,
-		0x42,0xc2,0x30,0x14,0x05,0xc0,0x17,0x4a,0x2b,0x01,0x0a,0x4a,0x3e,0x54,0x71,0x9d,
-		0xfb,0x5f,0xd2,0x99,0x60,0xf4,0x96,0x76,0x1c,0x40,0x18,0xfb,0xec,0xfa,0x69,0xda,
-		0x0f,0x10,0x96,0x2c,0xe3,0x36,0xac,0x0b,0x88,0xd7,0xec,0xc6,0x5b,0x47,0xbf,0x42,
-		0xf4,0x9c,0x2d,0xc3,0xb7,0x71,0x80,0x98,0x73,0x33,0xb3,0x3d,0x7e,0x4e,0x10,0x2d,
-		0xec,0xd8,0xaa,0xde,0x7f,0x11,0x09,0xad,0xdb,0xaa,0xea,0xfe,0x49,0x24,0xf4,0xd8,
-		0xaa,0xaa,0xea,0x43,0xcc,0xb9,0x19,0x93,0xad,0xaa,0x1e,0x5f,0xc4,0x21,0x2b,0x6c,
-		0x75,0x7f,0x42,0xac,0x99,0x61,0x7b,0xfe,0xbd,0x40,0x8c,0x96,0x0b,0x38,0x1f,0x21,
-		0x9c,0xd3,0x2e,0x58,0xdb,0x80,0xe0,0x90,0x4c,0xf3,0x94,0x0b,0x08,0x1c,0x5b,0xb2,
-		0xbf,0x02,0xff,0xae,0x67,0x16,0x49,0x16,0x8a,0x4e,0x0f,0x00,0x00,0x00,0x00,0x49,
-		0x45,0x4e,0x44,0xae,0x42,0x60,0x82);
-}
+/*
+*
+* This file is part of xVideoServiceThief,
+* an open-source cross-platform Video service download
+*
+* Copyright (C) 2007 - 2009 Xesc & Technology
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with xVideoServiceThief. If not, see <http://www.gnu.org/licenses/>.
+*
+* Contact e-mail: Xesc <xeskuu.xvst@gmail.com>
+* Program URL   : http://xviservicethief.sourceforge.net/
+*
+*/
+
+function RegistVideoService()
+{
+	this.version = "2.0.1";
+	this.minVersion = "2.0.0a";
+	this.author = "Xesc & Technology 2009";
+	this.website = "http://www.myvideo.de/";
+	this.ID = "myvideo.de";
+	this.caption = "MyVideo";
+	this.adultContent = false;
+	this.musicSite = false;
+}
+
+function getVideoInformation(url)
+{
+	const URL_FLV = "%1/%2.flv";
+	// video information
+	var result = new VideoDefinition();
+	// download webpage
+	var http = new Http();
+	var html = http.downloadWebpage(url);
+	// get the flv url and params
+	var path = copyBetween(html, "<link rel='image_src' href='", "/thumbs");
+	var vidId = copyBetween(html, path + "/thumbs/", "_");
+	// get the video title
+	result.title = copyBetween(html, "<h1 class='globalHd'>", "</h1>");
+	// build final url
+	result.URL = strFormat(URL_FLV, path, vidId);
+	// get cookies
+	result.cookies = http.getCookies("|");
+	// return the video information
+	return result;
+}
+
+function searchVideos(keyWord, pageIndex)
+{
+	const URL_SEARCH = "http://www.myvideo.de/Videos_A-Z?lpage=%2&searchWord=%1&searchOrder=0";
+	const HTML_SEARCH_START = "<table class='body sCenter vl_newMargin'>"; //'<div class="lBox lLeftBox globalBxBorder globalBx video_list">';
+	const HTML_SEARCH_FINISH = '</table>'; //"</body>";
+	const HTML_SEARCH_SEPARATOR = "<td class='body sTLeft hslice entry-content vCont' id='slice_";
+	// replace all spaces for "+"
+	keyWord = strReplace(keyWord, " ", "+");
+	// init search results object
+	var searchResults = new SearchResults();
+	// init http object
+	var http = new Http();
+	var html = http.downloadWebpage(strFormat(URL_SEARCH, keyWord, pageIndex, searchResults.getUserLanguage()));
+	// get the search summary
+	var tmp = copyBetween(html, '<td> Dein Ergebnis', '</td>');
+	var summary = "Dein Ergebnis" + copyBetween(tmp, "<span class='sWord'>", "'");
+	var tmp = copyBetween(html, "<span class='pView pnPages'>", "</span>");
+	var summary = summary + " " + tmp
+	var tmp = copyBetween(html, "<span class='pView pnResults'>", "</span>");
+	var summary = summary + " " + tmp
+	searchResults.setSummary(summary);
+	// get results html block
+	var htmlResults = copyBetween(html, HTML_SEARCH_START, HTML_SEARCH_FINISH);
+	// if we found some results then...
+	if (htmlResults != "")
+	{
+		var block = "";
+		// iterate over results
+		while ((block = copyBetween(htmlResults, HTML_SEARCH_SEPARATOR, HTML_SEARCH_SEPARATOR)) != "")
+		{
+			parseResultItem(searchResults, block);
+			htmlResults = strRemove(htmlResults, 0, block.toString().length);
+		}
+		// get last result
+		parseResultItem(searchResults, htmlResults);
+	}
+	// return search results
+	return searchResults;
+}
+
+function parseResultItem(searchResults, html)
+{
+	const VIDEO_URL = "http://www.myvideo.de";
+	// vars
+	var tmp, videoUrl, imageUrl, title, description, duration, rating;
+	// get title and image url
+	tmp = copyBetween(html, "<div class='vThumb'>", '</div>') ;
+	title = copyBetween(tmp, "title='", "'");
+	imageUrl = copyBetween(tmp, "src='", "'");
+	// get video url
+	videoUrl = VIDEO_URL + copyBetween(tmp, "href='", "'");
+	//if (strIndexOf(imageUrl, "default.jpg") == -1) // if is not a "default.jpg"...
+	//	imageUrl = copyBetween(tmp, 'thumb="', '"');
+	// get video description
+	tmp = copyBetween(html, "<div class='sCenter vTitle'>", '</div>') ;
+	description = copyBetween(tmp, "<span class='hidden'>", '</span>');
+	// get video duration
+	tmp = copyBetween(html, ' Lnge ', '/span>');
+	duration = convertToSeconds(copyBetween(tmp, "> ", '<'));
+	// get rating
+	rating = getrating(copyBetween(html, 'ratingBox', '</div>'));
+	// add to results list
+	searchResults.addSearchResult(videoUrl, imageUrl, title, description, duration, rating);
+}
+
+function getrating(text)
+{
+	var rating = 0
+	var i = 1
+	while (i < 6)
+	{
+		var part = getToken(text, '<img',i);
+		if (strIndexOf(part,"m_star_red_0.gif") != -1)
+		{
+			rating = rating + 1
+		}
+		if (strIndexOf(part,"m_star_half_0.gif") != -1)
+		{
+			rating = rating + 0.5
+		}
+		i++
+	}
+	return rating;
+}
+
+function convertToSeconds(text)
+{
+	// how many ":" exists?
+	var count = getTokenCount(text, ":");
+	// get mins and seconds
+	var h = new Number(h = count == 3 ? getToken(text, ":", 0) * 3600 : 0);
+	var m = new Number(getToken(text, ":", count - 2) * 60);
+	var s = new Number(getToken(text, ":", count - 1));
+	// convert h:m:s to seconds
+	return h + m + s;
+}
+
+function getVideoServiceIcon()
+{
+	return new Array(
+		0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,
+		0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x10,0x08,0x03,0x00,0x00,0x00,0x28,0x2d,0x0f,
+		0x53,0x00,0x00,0x00,0x66,0x50,0x4c,0x54,0x45,0x3d,0x88,0xe5,0x49,0x8f,0xe7,0x55,
+		0x97,0xe8,0x61,0x9e,0xea,0x62,0x9e,0xea,0x6e,0xa6,0xec,0x7a,0xad,0xed,0x85,0xb5,
+		0xee,0x86,0xb5,0xef,0x92,0xbc,0xf0,0x9e,0xc3,0xf2,0x9e,0xc4,0xf2,0xaa,0xcb,0xf4,
+		0xb6,0xd2,0xf5,0xc2,0xda,0xf7,0xce,0xe1,0xf8,0xda,0xe9,0xfa,0xdb,0xe9,0xfa,0xe7,
+		0xf0,0xfc,0xf3,0xf8,0xfd,0xff,0x66,0x00,0xff,0x70,0x10,0xff,0x79,0x20,0xff,0x8c,
+		0x40,0xff,0x96,0x50,0xff,0x9f,0x60,0xff,0xb3,0x80,0xff,0xbc,0x8f,0xff,0xc6,0x9f,
+		0xff,0xcf,0xaf,0xff,0xd9,0xbf,0xff,0xec,0xe0,0xff,0xf5,0xef,0xff,0xff,0xff,0x48,
+		0xd7,0xaa,0x42,0x00,0x00,0x00,0x8c,0x49,0x44,0x41,0x54,0x18,0x19,0x05,0xc1,0x09,
+		0x42,0xc2,0x30,0x14,0x05,0xc0,0x17,0x4a,0x2b,0x01,0x0a,0x4a,0x3e,0x54,0x71,0x9d,
+		0xfb,0x5f,0xd2,0x99,0x60,0xf4,0x96,0x76,0x1c,0x40,0x18,0xfb,0xec,0xfa,0x69,0xda,
+		0x0f,0x10,0x96,0x2c,0xe3,0x36,0xac,0x0b,0x88,0xd7,0xec,0xc6,0x5b,0x47,0xbf,0x42,
+		0xf4,0x9c,0x2d,0xc3,0xb7,0x71,0x80,0x98,0x73,0x33,0xb3,0x3d,0x7e,0x4e,0x10,0x2d,
+		0xec,0xd8,0xaa,0xde,0x7f,0x11,0x09,0xad,0xdb,0xaa,0xea,0xfe,0x49,0x24,0xf4,0xd8,
+		0xaa,0xaa,0xea,0x43,0xcc,0xb9,0x19,0x93,0xad,0xaa,0x1e,0x5f,0xc4,0x21,0x2b,0x6c,
+		0x75,0x7f,0x42,0xac,0x99,0x61,0x7b,0xfe,0xbd,0x40,0x8c,0x96,0x0b,0x38,0x1f,0x21,
+		0x9c,0xd3,0x2e,0x58,0xdb,0x80,0xe0,0x90,0x4c,0xf3,0x94,0x0b,0x08,0x1c,0x5b,0xb2,
+		0xbf,0x02,0xff,0xae,0x67,0x16,0x49,0x16,0x8a,0x4e,0x0f,0x00,0x00,0x00,0x00,0x49,
+		0x45,0x4e,0x44,0xae,0x42,0x60,0x82);
+}