Open GoogleCodeExporter opened 9 years ago
erh ... maybe use the lastest from the updater ?! from iserv repository
Original comment by biscotte...@gmail.com
on 25 Mar 2011 at 9:21
Cant you just give a plain script here. =\
Original comment by knarf.ja...@gmail.com
on 25 Mar 2011 at 9:28
var YouTube = new Object();
YouTube.rev = 1;
YouTube.SearchDesc =
YouTube.Name = "YouTube";
YouTube.Search = function (keyword, page){
var result = new Object();
result.bypage = 20;// modifiable
result.start = (page-1)*result.bypage+1;//&begin=250000
c=GetContents('http://gdata.youtube.com/feeds/api/videos?q='+escape(keyword)+'&start-index='+result.start+'&max-results='+result.bypage+'&v=1');
result.total = ext("<openSearch:totalResults>");
result.VideoInfo = new Array();
while(p=c.indexOf("<entry>",p)+1){
v = {attr:3};//neither IDA|npp find this string ...0=RD 1= 2=SRD 3=S
v.id = ext("<id>http://gdata.youtube.com/feeds/api/videos/","</id>");
v.Title = ext("<title type='text'>");
v.Description = ext("content type='text'>")+'\nUploader:'+ext("<name>");
v.CommentCount = ext("countHint='")*1;
v.Tags = ext("keywords>").replace(/,/g,"");
v.LengthSeconds = ext("ds='")*1;
v.RatingAvg = ext("average='")*1;
v.RatingCount = ext("numRaters='")*1;
v.MylistCount = ext("favoriteCount='")*1;
v.ViewCount = ext("viewCount='")*1;
v.ThumbnailURL = 'http://i.ytimg.com/vi/'+v.id+'/default.jpg';
v.SaveFilename = v.id+".flv";//".flv" is hidden in the OSK
v.URL = 'YouTube.play("'+v.id+'")';
result.VideoInfo.push(v);
}
result.end = result.start-1+result.VideoInfo.length;
return result;
}
YouTube.play = function (id){
c=GetContents("http://www.youtube.com/watch?v="+id);p=0;
var tbl = unescape(ext('fmt_url_map=',';')).split(/,/);//list the available format in a array
PSPTube.log(tbl+"\n");//debugging!
var url = unescape(tbl[tbl.length-1]);//take the lastest entry in the table (lowest quality)
PSPTube.log(url+"\n");//more debugging!
return url.substring(url.indexOf("|")+1).replace(/\\/g,"");//format the url
}
SiteList.push(YouTube);
Original comment by biscotte...@gmail.com
on 25 Mar 2011 at 9:34
i just save this as youtube.js?
Original comment by knarf.ja...@gmail.com
on 25 Mar 2011 at 9:44
yes
Original comment by biscotte...@gmail.com
on 25 Mar 2011 at 9:50
Ok i added it to gotube but still after i click on a video i see the led
blinking for a few times and then i see the memory stick led flashing and then
nothing happends..
Original comment by knarf.ja...@gmail.com
on 25 Mar 2011 at 10:08
this the script is not mine :s
Original comment by biscotte...@gmail.com
on 25 Mar 2011 at 10:14
Script stopped working for some reason some days ago.
Attempting to fix now.
Original comment by ser...@safetymail.info
on 26 Mar 2011 at 6:33
Tried to fix won't work..
This is my script:
var YouTube = new Object();
YouTube.rev = 1;
YouTube.SearchDesc =
YouTube.Name = "YouTube";
YouTube.Search = function (keyword, page){
var result = new Object();
result.bypage = 20;// modifiable
result.start = (page-1)*result.bypage+1;//&begin=250000
c=GetContents('http://gdata.youtube.com/feeds/api/videos?q='+escape(keyword)+'&start-index='+result.start+'&max-results='+result.bypage+'&v=1');
result.total = ext("<openSearch:totalResults>");
result.VideoInfo = new Array();
while(p=c.indexOf("<entry>",p)+1){
v = {attr:3};//neither IDA|npp find this string ...0=RD 1= 2=SRD 3=S
v.id = ext("<id>http://gdata.youtube.com/feeds/api/videos/","</id>");
v.Title = ext("<title type='text'>");
v.Description = ext("content type='text'>")+'\nUploader:'+ext("<name>");
v.CommentCount = ext("countHint='")*1;
v.Tags = ext("keywords>").replace(/,/g,"");
v.LengthSeconds = ext("ds='")*1;
v.RatingAvg = ext("average='")*1;
v.RatingCount = ext("numRaters='")*1;
v.MylistCount = ext("favoriteCount='")*1;
v.ViewCount = ext("viewCount='")*1;
v.ThumbnailURL = 'http://i.ytimg.com/vi/'+v.id+'/default.jpg';
v.SaveFilename = v.id+".flv";//".flv" is hidden in the OSK
v.URL = 'YouTube.play("'+v.id+'")';
result.VideoInfo.push(v);
}
result.end = result.start-1+result.VideoInfo.length;
return result;
}
YouTube.play = function (id){
c=GetContents("http://www.youtube.com/watch?v="+id);p=0;
var tbl = unescape(ext('fmt_url_map=',';')).split(/,/);//list the available format in a array
var url = unescape(tbl[tbl.length-1]);//take the lastest entry in the table (lowest quality)
PSPTube.log(url);
return url.ext("|", "\u");
}
SiteList.push(YouTube);
This is my log output
5|http://v20.lscache1.c.youtube.com/videoplayback?sparams=id,expire,ip,ipbits,it
ag,algorithm,burst,factor&fexp=908907&algorithm=throttle-factor&itag=5&ipbits=8&
burst=40&sver=3&signature=8ADDC3AC3350652049969C42036B55E5FFD8FE2E.28171D09E0C0C
237C7762BCB6BAE7611F154D04F&expire=1301191200&key=yt1&ip=85.0.0.0&factor=1.25&id
=69e99780ffb6c728\u0026ampext("|","\u") reachs the limite (from) p=5024
This is valid url:
http://v20.lscache1.c.youtube.com/videoplayback?sparams=id,expire,ip,ipbits,itag
,algorithm,burst,factor&fexp=908907&algorithm=throttle-factor&itag=5&ipbits=8&bu
rst=40&sver=3&signature=8ADDC3AC3350652049969C42036B55E5FFD8FE2E.28171D09E0C0C23
7C7762BCB6BAE7611F154D04F&expire=1301191200&key=yt1&ip=85.0.0.0&factor=1.25&id=6
9e99780ffb6c728
So it should filter it out with this
return url.ext("|", "\u");
Gives this error
ext("|","\u") reachs the limite (from) p=5024
I don't understand why it's giving this error AGAIN had problems with this @
more script but should be working -.-
Original comment by ser...@safetymail.info
on 26 Mar 2011 at 7:44
hum, maybe try "\\u" insteate of "\u" (or simplier "\\")
Original comment by biscotte...@gmail.com
on 26 Mar 2011 at 8:44
Both gave again the same error
I give up.
Original comment by ser...@safetymail.info
on 26 Mar 2011 at 9:32
its great to see gotube going forward thank you all for your hard work
Original comment by peterpsp...@hotmail.com
on 4 Apr 2011 at 2:09
Original issue reported on code.google.com by
knarf.ja...@gmail.com
on 25 Mar 2011 at 9:17