yne / gotube

YouTube player for the PlayStation Portable
0 stars 1 forks source link

132!!!! :Made a new Go-Tube Script!!! #132

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
----------------------------------------------------------------------
var YouTube = new Object();
YouTube.rev = 3;
YouTube.SearchDesc = "YouTube by NT";
YouTube.Name = "YouTube";
YouTube.Search = function(keyword, page) {
  var result = new Object();
  result.bypage = 20;
  result.start = (page - 1) * result.bypage + 1;
  var sortBy = "relevance";
  var catSpecified = false;

  if (keyword.charAt(0) == '$')
  {
    var keywordBu = keyword;
    var kpos = keyword.indexOf(" ");
    var category = keyword.substring(1, kpos);
    keyword = keyword.substring(kpos + 1);
    catSpecified = true;
  }

  if (keyword.charAt(0) == '@')
  {
    sortBy = "published";
  }

  if (catSpecified == false)
  {
    c = GetContents('http://gdata.youtube.com/feeds/api/videos?q=' + escape(keyword) + '&start-index=' + result.start + '&max-results=' + result.bypage + '&orderby=' + sortBy + '&racy=include&v=1');
  }
  else
  {
    c = GetContents('http://gdata.youtube.com/feeds/api/videos?q=' + escape(keyword) + '&start-index=' + result.start + '&max-results=' + result.bypage + '&orderby=' + sortBy + '&racy=include&category=' + category + '&v=1');
  }

  result.total = ext("<openSearch:totalResults>");
  result.VideoInfo = new Array();
  v = {attr: 2};
  v.id = 0;
  v.Title = "YouTube Search Help";
  v.Description = "@query = search by upload date\n$category query = search in a category";
  v.URL = '';
  p = 0;
  result.VideoInfo.push(v);
  while (p = c.indexOf("<entry", p) + 1) {
    v = {attr: 2};//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";
    v.URL = 'YouTube.play("' + v.id + '")';
    result.VideoInfo.push(v);
  }
  result.end = result.start - 1 + result.VideoInfo.length;
  return result;
}

YouTube.play = function(id) {
  var pos;
  c = GetContents("http://www.youtube.com/get_video_info?html5=1&video_id=" + id);
  //PSPTube.log("\n" + c + "\n");
  pos = c.indexOf("url_encoded_fmt_stream_map");
  if (pos == -1) {
    alert("Can not be played");
    return "";
  }
  c = ext('url_encoded_fmt_stream_map', "&");
  p = 0;
  c = unescape(c);
  var url = c.match(/url=(.+?itag%3D5.*?)[&,]/);
  //PSPTube.log("\n" + url + "\n");
  url = url[1];
  //PSPTube.log("\n" + url + "\n");
  pos = url.lastIndexOf("http");
  url = url.substr(pos);
  url = unescape(url);
  //PSPTube.log("\n" + url + "\n");
  return url;
}
SiteList.push(YouTube);

------------------------------------------
please tell if it works i have not tested.

Original issue reported on code.google.com by jcrv1...@gmail.com on 13 Dec 2014 at 10:21

GoogleCodeExporter commented 8 years ago
nice i will try it and let you know

Original comment by Jonathon...@gmail.com on 13 Dec 2014 at 8:00

GoogleCodeExporter commented 8 years ago
It's working perfectly! Thanks a lot!!!

Original comment by alexbara...@gmail.com on 15 Dec 2014 at 2:39

GoogleCodeExporter commented 8 years ago
I have not gotten a chance to try it, does it make the picture in color

Original comment by Jonathon...@gmail.com on 15 Dec 2014 at 11:55

GoogleCodeExporter commented 8 years ago
can someome upload the youtube.js file

Original comment by Jonathon...@gmail.com on 16 Dec 2014 at 5:28

GoogleCodeExporter commented 8 years ago
i try it and it's working but still have color issues.

Original comment by MEHDIPIG...@gmail.com on 19 Dec 2014 at 11:11

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
plz upload the youtube.js file

Original comment by dannycer...@ymail.com on 25 Dec 2014 at 4:16

GoogleCodeExporter commented 8 years ago
Confirmed it works
Tested on 28 December 2014

However it's black and white with 3 weird lines

Original comment by jazzands...@gmail.com on 27 Dec 2014 at 3:52

GoogleCodeExporter commented 8 years ago
i have problem with this it said that can not be played 

Original comment by jiawe...@gmail.com on 6 Jan 2015 at 2:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
ok will try

Original comment by jcrv1...@gmail.com on 25 Feb 2015 at 12:35

GoogleCodeExporter commented 8 years ago
Its not working on my psp no video load and my psp version is 6.61 cfw pro c so 
kindly fix this 

Original comment by ammadkha...@gmail.com on 26 Feb 2015 at 2:58

GoogleCodeExporter commented 8 years ago
And here who want .js file -_- but its not working on my psp :P

Original comment by ammadkha...@gmail.com on 26 Feb 2015 at 2:59

Attachments: