# new version Index: xvst-2.5/resources/services/yahoovideo/yahoovideo.js =================================================================== --- xvst-2.5.orig/resources/services/yahoovideo/yahoovideo.js 2013-02-25 19:37:11.000000000 +0100 +++ xvst-2.5/resources/services/yahoovideo/yahoovideo.js 2013-09-09 18:48:45.076024563 +0200 @@ -25,11 +25,11 @@ function RegistVideoService() { - this.version = "1.0.0"; + this.version = "1.1.0"; this.minVersion = "2.0.0a"; - this.author = "Xesc & Technology 2009"; - this.website = "http://video.yahoo.com/"; - this.ID = "video.yahoo.com"; + this.author = "anon"; + this.website = "http://screen.yahoo.com/"; + this.ID = "screen.yahoo.com"; this.caption = "Yahoo Video"; this.adultContent = false; this.musicSite = false; @@ -37,30 +37,46 @@ function getVideoInformation(url) { - const URL_GET_XML = "http://cosmos.bcst.yahoo.com/up/yep/process/getPlaylistFOP.php?node_id=%1&tech=flash&mode=playlist&bitrate=300&null&rd=video.yahoo.com&tk=null"; + var url_get_json ="http://video.query.yahoo.com/v1/public/yql?q=SELECT streams FROM yahoo.media.video.streams WHERE id=\"%1\" AND plrs=\"\" AND protocol=\"http\" AND region=\"%2\";&env=prod&format=json"; // init result var result = new VideoDefinition(); // download webpage var http = new Http(); var html = http.downloadWebpage(url); // get video title - result.title = copyBetween(html, "", ""); + var title = copyBetween(html, "", ""); + //if we have the ?format=embed parameter added, the | is missing + if (title.toString().indexOf(" |") != -1) + title = copyBetween(title, "", " |"); + result.title = title; // get the node_id - var node_id = copyBetween(html, "so.addVariable(\"id\", \"", "\""); - // download xml - var xml = http.downloadWebpage(strFormat(URL_GET_XML, node_id)); + var node_id = copyBetween(html, "\"id\":\"", "\""); + // get the region + var region = copyBetween(html, "region: \'", "\'"); + // download json + var jsonstr = http.downloadWebpage(strFormat(url_get_json, node_id, region)); + var json = JSON.parse(jsonstr); + var streams = json.query.results.mediaObj[0].streams; + var streamindex = streams.length - 1; //the streams are sorted by quality. highest is last. // get video host and path - var host = copyBetween(xml, "