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 . -* -* Contact e-mail: Xesc -* 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, "", ""); - // 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 = ""; //'
'; - const HTML_SEARCH_FINISH = '
'; //""; - const HTML_SEARCH_SEPARATOR = " Dein Ergebnis', ''); - var summary = "Dein Ergebnis" + copyBetween(tmp, "", "'"); - var tmp = copyBetween(html, "", ""); - var summary = summary + " " + tmp - var tmp = copyBetween(html, "", ""); - 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, "
", '
') ; - 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, "
", '
') ; - description = copyBetween(tmp, "'); - // get video duration - tmp = copyBetween(html, ' Lnge ', '/span>'); - duration = convertToSeconds(copyBetween(tmp, "> ", '<')); - // get rating - rating = getrating(copyBetween(html, 'ratingBox', '')); - // 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, '. +* +* Contact e-mail: Xesc +* 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, "", ""); + // 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 = ""; //'
'; + const HTML_SEARCH_FINISH = '
'; //""; + const HTML_SEARCH_SEPARATOR = " Dein Ergebnis', ''); + var summary = "Dein Ergebnis" + copyBetween(tmp, "", "'"); + var tmp = copyBetween(html, "", ""); + var summary = summary + " " + tmp + var tmp = copyBetween(html, "", ""); + 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, "
", '
') ; + 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, "
", '
') ; + description = copyBetween(tmp, "'); + // get video duration + tmp = copyBetween(html, ' Lnge ', '/span>'); + duration = convertToSeconds(copyBetween(tmp, "> ", '<')); + // get rating + rating = getrating(copyBetween(html, 'ratingBox', '')); + // 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, '