[RELEASE] YouTrailer (Script) - Movie Trailers - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154) +---- Thread: [RELEASE] YouTrailer (Script) - Movie Trailers (/showthread.php?tid=69593) |
- matthuisman - 2010-02-09 Update up now! (1st post been updated) NOTE: <onclick>RunScript(special://home/scripts/YouTrailer/default.py,1)</onclick> is now the command for running, no more path needed gugahoi: When the script says "trailer has been removed" This is caused by the script getting a youtube url from TMDB OK, but failing to get a youtube token. Often caused by youtube removing videos. This can be confirmed by opening /userdata/script_data/youtrailer/youtrailer.db finding the movie and the corrosponding youtube url. Then copy this into your browser. If the youtube url is valid, PLEASE LET ME KNOW the youtube url :-) If not, then please find a new trailer and update the movie on http://www.themoviedb.org If you visit tmdb and the trailer works, this means that the tmdb api is still giving me an old trailer url and this will be fixed when the API is "updated" to the main site - ppic - 2010-02-09 good trick with infolabels, i wasn't aware that we can use it like that ! - trey - 2010-02-09 Great, works now! One thought though. Does it pick the lowest quality? There is a switch for HD in the youtube url. Would be good with a setting for quality. But great work. Have been waiting for this for so long. - matthuisman - 2010-02-09 If someone could please let me know the propper youtube urls for high quality etc, that would be great At present im doing: trailer_token_url = 'http://www.youtube.com/get_video_info?&video_id=%s&el=detailpage&ps=default&eurl=&gl=US&hl=en' % trailer_id ..... trailer_token = urllib.unquote_plus( trailer_token_info['token'][0] ) then self.full_url = 'http://www.youtube.com/get_video?video_id=%s&t=%s%%3D' % ( trailer_id, trailer_token ) But, I see ember get " v7." etc etc full urs. I would love to know how to generate these For high quality, english etc - matthuisman - 2010-02-09 trey Wrote:Great, works now! HEY! Worked out highquality for you. Will make an option when i create settings. For now, if you open main.py in notepad and change the line: self.full_url = 'http://www.youtube.com/get_video?video_id=%s&t=%s%%3D' % ( trailer_id, trailer_token ) to: self.full_url = 'http://www.youtube.com/get_video?video_id=%s&t=%s&fmt=18' % ( trailer_id, trailer_token ) That will make all the trailers high quality - trey - 2010-02-09 stanley87 Wrote:HEY!Your so fast. Really great work! fmt=18 is for 480p hd=1 is for 720p Don't know whats for 1080p. And I tried to see the fallback if you for exampel choose hd=1 but best quality is only 480p. Will it choose 480p or 360p? Not sure. But now i know where to change it. Nice =) - trey - 2010-02-09 trey Wrote:Your so fast. Really great work! hd=1 doesn't work for your script though. For exampel, this movie: http://www.themoviedb.org/movie/8373. The youtube link (on tmdb) for the trailer has 360p, 480p and 720p when you go to youtube.com. And if you put hd=1 in the url you get the 720p. If you put fmt=18 you get the 480p. But if i put hd=1 in youtrailer it goes with the 360p (.flv if you check onscreen info - O in xbmc). If i put fmt=18 i get the 480p (h264 420p if you press O). A bug though, with the fmt=18 the trailer starts in the background (as fanart) and the infodialog in front of it (need to double tab it away). Man this will be my most used script in xbmc. The ability to get trailers for soon all my movies is great. My girlfriend (me also actually) hates reading the textinfo about the movies. More fun to watch a trailer, even though trailer often make you think movies are better then they really are =) - matthuisman - 2010-02-09 HI! Iv found a great resource script to use to figure out quality/language settings etc Soon, you will be able to set "max" quality to fetch trailers in, the script will try that format, then all formats "below" it till it finds a valid format then it will play this. It will then keep track of the "highest" format for this video in its database so next time it will just play this format straight away. There will be options to refresh database if the user in the future decides he wants to fetch higher quality vids If you pass the FMT values below into the youtube url, you get 1080p etc. My script doesnt pass urls like this, but appends a FMT value to the end of the "full url" I think: 37 = 1080p HD 22 = 720p HD 18 = 480p "even though trailer often make you think movies are better then they really are " I couldn't agree more, i certain movie named "Open Water" comes to mind... argggghhhh!! I paid to see it 2!!. Id feel duped even if i downloaded it for free Any way, try these values for fmt= _available_formats = ['37', '22', '35', '18', '5', '17', '13'] 37 = highest this may very will be 1080 EDIT: OK. Just did a few tests http://www.youtube.com/watch?v=XoiYkaYC_9M Transformers FMT = 37 INVALID FORMAT FMT = 22 VALID FORMAT -> H264 yuv420p 1280x534 FMT = 35 VALID FORMAT -> H264 818kb/s ? x ? FMT = 18 VALID FORMAT -> H264 yuv420p 480x200 FMT = 5 VALID FORMAT -> flv 261kb/s FMT = 17 VALID FORMAT -> mpeg4 yuv420p 176x144 FMT = 13 VALID FORMAT -> H263 yuv420p 176x144 FMT = NONE VALID FORMAT PLAYING -> flv 261kb/s HD TEST: http://www.youtube.com/watch?v=Cu20ele1ojQ FMT = 37 VALID FORMAT -> H264 yuv420p 1920x1080 1080P HD FMT = 22 VALID FORMAT -> H264 yuv420p 1280x720 720P HD FMT = 35 VALID FORMAT -> H264 1227kb/s ? x ? FMT = 18 VALID FORMAT -> H264 yuv420p 480x270 FMT = 5 VALID FORMAT -> flv 295kb/s FMT = 17 VALID FORMAT -> mpeg4 yuv420p 176x144 FMT = 13 VALID FORMAT -> H263 yuv420p 176x144 FMT = NONE VALID FORMAT -> flv 295kb/s So Looks like leaving out FMT defaults to FMT of 5 - matthuisman - 2010-02-09 PS: once the script is pretty stable, an email to boxee may be in order... I can see it now, select a movie in boxee, that dialog comes up, PLAY LOCAL, then all the lil icons below it "more info", etc... I can see a new icon... "Watch Trailer" ooo. heres something interesting, if the script gets a youtube url:"http://www.youtube.com/watch?v=Cu20ele1ojQ&fmt=37" with the fmt value in it, it doesnt need to append "fmt" to the full url. youtube must fetch the correct trailer and return it automatically. This is very handy, as now you can store all your trailer links in your .nfo files with your prefered quality and my script will use that , or fallback to lower quality if not available. By nfo files i mean, once xbmc scans these, the xbmc db trailer url is what i try first. BUT, as 1st post, make sure all your nfo trailer files containt urls like: http://www.youtube.com/watch?v=Cu20ele1ojQ&fmt=37 The same url you would use in your browser, or the script wont work Ember has added this to his program (in svn only at present), but will be in his next build - aptalca - 2010-02-09 stanley87, this script sounds like exactly what I've been waiting for. I just can't get it to work. I made all the changes to my dialogvideoinfo.xml in Transparency. When I click on the trailer button, your script is run, I see the "Fetching data from XBMC. . .etc" pop up, but then I get a "YouTrailer - ERROR" with "No Trailer Found For This Movie" I tried it with about 15 recent movies (as you can see in my debug log below) some of which I have confirmed to have trailers listed on tmdb. Btw, I am using the tmdb scraper and not an external media manager like ember. Debug: http://pastebin.com/m4f0df5dc any ideas? thanks - ppic - 2010-02-09 from your log, i find: Quote:# seems to be a problem when no url finded? or not a youtube url in nfo maybe? - matthuisman - 2010-02-09 aptalca Wrote:stanley87, this script sounds like exactly what I've been waiting for. I just can't get it to work. Hi, This is your problem "Btw, I am using the tmdb scraper" At present, the trailer script ONLY supports the IMDB scraper. Funny I know, as it gets the trailers from TMDB But, the TMDB scraper does not fetch the IMDB id, which at present, is what my script uses to look up on TMDB. However, I see it does fetch the TMDB ID, so i will work in support for this soon. It will actually make it faster, as it will only need to request the TMDB api once (to get the trailer using the TMDB id), as normally it has to request TMDB id using the IMDB Id, then request the trailer using the TMDB id. I did this as i think most people use IMDB scraper. For now, if you wish to use, change your scraper to IMDB and re-scan - aptalca - 2010-02-09 oh I see, I guess I missed that part about the imdb scraper in the description. I was just assuming most ppl use tmdb scraper since it is the default in xbmc now. I was just getting tired of the imdb scraper breaking all the time. Tmdb is stable, and it has gotten really good in terms of content. I haven't really encountered a movie that didn't exist on tmdb. (I don't have many obscure or really old movies) I think I'll just wait rather than rescan my library - matthuisman - 2010-02-09 Working on it now, should be done by 3pm today (NZ TIME) = 6 hours away. Ill do it on my lunch break - aptalca - 2010-02-10 man, you're on fire |