yne / gotube

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

Help me to make one script=) #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello!(I'm from Russia... Please, Don't laughing on my english)
I have psp and go!tube on it.. And one day i wanted to add one 
site-(24video.net)
I have some questions by reading a tutorial on home page. =)))
 1. This guy say, that he show, how to write video.url but i can't find this article... I don't understand, how to write this url...
 2. Do i have to write : • video.RatingAvg
                         • video.RatingCount
                         • video.ViewCount 
                         • video.CommentCount
                         • video.MylistCount
                         • video.Tags ?
What does it do? I just copy example of this code 
1*c.substring(p=c.indexOf("...">",p)+29,c.indexOf("...",p)); 
and paste it many times... cuz i dont know, what does it do?

This is my "code" =)

var 24video = new Object();
24video.rev           = 2;
24video.SearchDesc    =
24video.Name          = "24video";//doit etre du meme nom que l'objet !
24video.Search        = function (keyword, page){
var result = new Object();
result.bypage    = 24;
result.start     = (page-1)*result.bypage+1;
c=GetContents('http://www.24video.net/video/filter?page='+page+'&searchText='+es
cape(keyword))
result.total     = -1;
result.VideoInfo = new Array();
while(p=c.indexOf("<item>",p)+1){
  video = new Object();
  video.attr          = 3;
  video.Title         = ext("<title>");
  video.Description   = c.substring(p=c.indexOf("description" content="",p)+22,c.indexOf("<",p));
  video.RatingAvg     = 1*c.substring(p=c.indexOf("rating_plus" title="Рейтинг">",p)+29,c.indexOf("<",p));
  video.RatingCount   = 1*c.substring(p=c.indexOf("rating_plus" title="Рейтинг">",p)+29,c.indexOf("<",p));
  video.ViewCount     = 1*c.substring(p=c.indexOf("multi-",p)+6,c.indexOf("<",p));
  video.CommentCount  = 1*c.substring(p=c.indexOf("multi-",p)+6,c.indexOf("<",p));
  video.MylistCount   = 1*c.substring(p=c.indexOf("multi-",p)+6,c.indexOf("<",p));
  video.id            = c.substring(p=c.indexOf("div id="multi-",p)+14,c.indexOf("<",p));
  video.ThumbnailURL  = http://img2.24video.net/753/753670/frame00000.jpg
  video.Tags          = c.substring(p=c.indexOf("keywords" content="",p)+19,c.indexOf("<",p));.replace(/,/g,"");
  video.SaveFilename  = video.Title+'.flv';
  video.URL           = (???)
  result.VideoInfo.push(video);
}
result.end       = result.start-1+result.VideoInfo.length;
return result;
}
SiteList.push(24video);

PLEASE, HELP, TEACH ME))))

Original issue reported on code.google.com by ilkul...@gmail.com on 23 Sep 2011 at 12:44

GoogleCodeExporter commented 9 years ago
i don't think you are allowed to use a name that start with number (var 
24video=...)
try _24video or something.
the getContent part seem to be ok
after that ... no ^^ :
while(p=c.indexOf("<div class="clip">",p)+1){
  video.id            = ext('movieId="');
  video.ThumbnailURL  = ext('src="');
  video.Title         = ext('title="');
..and so one...
  video.URL           = '24video.play('+video.id+')';
}
...and just before the puch :
24video.play          = function (id){
  alert(id);
}

Original comment by biscotte...@gmail.com on 23 Sep 2011 at 3:19

GoogleCodeExporter commented 9 years ago
do i need to use ratingavg, count, viewcount,...?what if just don't write them?
em... i get something like this:
var _24video = new Object();
_24video.rev           = 2;
_24video.SearchDesc    =
_24video.Name          = "_24video";//doit etre du meme nom que l'objet !
_24video.Search        = function (keyword, page){
var result = new Object();
result.bypage    = 24;
result.start     = (page-1)*result.bypage+1;
c=GetContents('http://www.24video.net/video/filter?page='+page+'&searchText='+es
cape(keyword))
while(p=c.indexOf("<div class="clip">",p)+1){
  video = new Object();
  video.id            = ext('movieId="');
  video.ThumbnailURL  = ext('src="');
  video.Title         = ext('title="');
  video.CommentCount  = ext('commentCount2">');
  video.Description   = ext('content="');
  video.URL           = '24video.play('+video.id+')';
  video.attr          = 3;
  result.VideoInfo.push(video);
}
result.end            = result.start-1+result.VideoInfo.length;
return result;
}
24video.play          = function (id){
  alert(id);
}
SiteList.push(_24video);

It don't want to work))) seems i did something wrong...

Original comment by ilkul...@gmail.com on 23 Sep 2011 at 6:15

GoogleCodeExporter commented 9 years ago
var Video = new Object();
Video.rev           = 2;
Video.SearchDesc    =
Video.Name          = "Video";//doit etre du meme nom que l'objet !
Video.Search        = function (keyword, page){
var result = new Object();
result.bypage    = 24;
result.start     = (page-1)*result.bypage+1;
c=GetContents('http://www.24video.net/video/filter?page='+page+'&searchText='+es
cape(keyword))
while(p=c.indexOf("<div class="clip">",p)+1){
  video = new Object();
  video.id            = ext('movieId="');
  video.ThumbnailURL  = ext('src="');
  video.Title         = ext('title="');
  video.CommentCount  = ext('commentCount2">');
  video.Description   = ext('content="');
  video.URL           = '24video.play('+video.id+')';
  video.attr          = 3;
  video.play          = function (id){
  alert(id);
}
  result.VideoInfo.push(video);
}
result.end       = result.start-1+result.VideoInfo.length;
return result;
}
SiteList.push(Video);

Original comment by ilkul...@gmail.com on 23 Sep 2011 at 6:23

GoogleCodeExporter commented 9 years ago
it dont want 2 work too...

Original comment by ilkul...@gmail.com on 23 Sep 2011 at 6:24

GoogleCodeExporter commented 9 years ago
sorry, i made a mistake :
while(p=c.indexOf("<div class="clip">",p)+1){
became
while(p=c.indexOf('<div class="clip">',p)+1){
rename 24video.play to _24 .... (and update this name to the .URL attribut)

Original comment by biscotte...@gmail.com on 23 Sep 2011 at 8:01

GoogleCodeExporter commented 9 years ago
hmmm... sorry, but it still not work... i newbie in javascripting... i think i 
mistake somewhere...)))
This is that i've got:

_24video.rev           = 2;
_24video.SearchDesc    =
_24video.Name          = "_24video";//doit etre du meme nom que l'objet !
_24video.Search        = function (keyword, page){
var result = new Object();
result.bypage    = 24;
result.start     = (page-1)*result.bypage+1;
c=GetContents('http://www.24video.net/video/filter?page='+page+'&searchText='+es
cape(keyword))
while(p=c.indexOf('<div class="clip">',p)+1){
  video = new Object();
  video.id            = ext('movieId="');
  video.ThumbnailURL  = ext('src="');
  video.Title         = ext('title="');
  video.CommentCount  = ext('commentCount2">');
  video.Description   = ext('content="');
  video.URL           = '_24video.play('+video.id+')';
  video.attr          = 3;
  result.VideoInfo.push(video);
}
result.end            = result.start-1+result.VideoInfo.length;
return result;
}
_24video.play          = function (id){
  alert(id);
}
SiteList.push(_24video);

Original comment by ilkul...@gmail.com on 24 Sep 2011 at 1:33

GoogleCodeExporter commented 9 years ago
i didn't spotted any mistake ...
it give you an error (black screen) ? or it just don't show the list ?
if it's an error try to rename '_24video' to 'test'

Original comment by biscotte...@gmail.com on 24 Sep 2011 at 1:41

GoogleCodeExporter commented 9 years ago
javascript load error ms0:psp/game/gotube/site/Test.js

Test.rev           = 2;
Test.SearchDesc    =
Test.Name          = "Test";//doit etre du meme nom que l'objet !
Test.Search        = function (keyword, page){
var result = new Object();
result.bypage    = 24;
result.start     = (page-1)*result.bypage+1;
c=GetContents('http://www.24video.net/video/filter?page='+page+'&searchText='+es
cape(keyword))
while(p=c.indexOf('<div class="clip">',p)+1){
  video = new Object();
  video.id            = ext('movieId="');
  video.ThumbnailURL  = ext('src="');
  video.Title         = ext('title="');
  video.CommentCount  = ext('commentCount2">');
  video.Description   = ext('content="');
  video.URL           = 'Test.play('+video.id+')';
  video.attr          = 3;
  result.VideoInfo.push(video);
}
result.end            = result.start-1+result.VideoInfo.length;
return result;
}
Test.play          = function (id){
  alert(id);
}
SiteList.push(Test);

Original comment by ilkul...@gmail.com on 24 Sep 2011 at 2:22

GoogleCodeExporter commented 9 years ago
first line ?
var Test = new Object();

Original comment by biscotte...@gmail.com on 24 Sep 2011 at 2:29

GoogleCodeExporter commented 9 years ago
HA-HA-Ha)))))
indeed you right... How could i forget about this =))))Thanx, dude)))
alright! 
And so I ran it and it worked ... but when I try to look for something a few 
times, it does not show me any results. = (((But on the PC in the opera, I went 
to the site 24video ... and there he showed me the result I was trying to 
gotube ... Is that right?

Original comment by ilkul...@gmail.com on 24 Sep 2011 at 2:56

GoogleCodeExporter commented 9 years ago
  video.CommentCount  = ext('commentCount2">');
  video.Description   = ext('content="');

the website does not provide this type of information (commentCount2"> dont 
existe) so don't be surprised ...

good luck for the rest ;)

Original comment by biscotte...@gmail.com on 24 Sep 2011 at 3:08

GoogleCodeExporter commented 9 years ago
Hmmm... i dont understand something...
1)i have to go to site.
2)search anything...
3)it show me a lot of videos
4)now i have to open source code(in opera - ctrl+u RIGHT?)
5)i must find a number that show me the number of comments
6)then using an ext(''); i should find a word before the number and paste 
between the''
7)if site don't contains this i just skip the commentscount
Is that right?

and one more thing i don't understand:
 Video.url
Should i use this 'Test.play('+video.id+')'; everythere or i have to learn, how 
to write this long code: 
'unescape(GetContents("http://www.dailymotion.com/video/'+info.id+'").match(\'"v
ideo", "(.*?)%40\')[1])';
How does people write this... it is absolute nonsense. I don't understand 
this... it randomly symbols at the end? Pls, can you teach, or explain this, 
PLEASE =)))))

Original comment by ilkul...@gmail.com on 24 Sep 2011 at 3:28

GoogleCodeExporter commented 9 years ago
4)i'm using firefox
5)just take a look at the page ! did you see any comments counter ? no. so 
don't try to retreiv it. (thit is life, you'll not die for this)
6)yes, if the word contain a " use ' as word separator, and " if word contain a 
'
7) in that case , remove the viewcont=... line.

in fact the URL parametter will be executed when you clic on the video
i'll not explain you the URL you pasted here because it using RegExp and RegExp 
are not easy to explain/understand

in your case it will call Test.play and give a number as id
use this number to retrive the video page 
(ex:http://www.24video.net/video/view/1100549)
and find the flv's url in that page

(no more explanation from me :D)

Original comment by biscotte...@gmail.com on 24 Sep 2011 at 3:42

GoogleCodeExporter commented 9 years ago
I tired... it don't want to search=(((

var Test = new Object();
Test.rev           = 2;
Test.SearchDesc    =
Test.Name          = "Test";//doit etre du meme nom que l'objet !
Test.Search        = function (keyword, page){
var result = new Object();
result.bypage    = 24;
result.start     = (page-1)*result.bypage+1;
c=GetContents('http://www.24video.net/video/filter?page='+page+'&searchText='+es
cape(keyword))
while(p=c.indexOf('<div class="clip">',p)+1){
  video = new Object();
  video.id            = ext('movieId="');
  video.ThumbnailURL  = ext('src="');
  video.Title         = ext('title="');
  video.Description   = 'qwertyuiop'
  video.URL           = 'Test.play('+video.id+')';
  video.attr          = 3;
  result.VideoInfo.push(video);
}
result.end            = result.start-1+result.VideoInfo.length;
return result;
}
Test.play          = function (id){
  alert(id);
}
SiteList.push(Test);

Original comment by ilkul...@gmail.com on 24 Sep 2011 at 5:46

GoogleCodeExporter commented 9 years ago
i FOUND ONE TUTORIAL ON HOME PAGE...
  "video.URL = 'unescape(GetContents("ht tp://www.dailymotion.com/video/'+video.id+'").match(\'"v ideo", "(.*?)"\')[1])';

 this part is not easy to understand , ill try to explain in another tutorial"
I'm interesting, where is "another" tutorial... plz, if it exist, can you show 
me)))

Original comment by ilkul...@gmail.com on 25 Sep 2011 at 3:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
another question from me xD
Is that real to make vkontakte.ru script?
all vids are situated on one page, so "+page+"no need...
i tried to create the script, but stopped, because this... also i think, vk.ru 
is so popular site... why would anybody don't do it... why everyone do only 
PORNO scripts XD

Original comment by ilkul...@gmail.com on 25 Sep 2011 at 4:29