Plugin advice - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Plugin advice (/showthread.php?tid=80388) Pages:
1
2
|
Plugin advice - divingmule - 2010-09-04 Hi, this is my first attempt at any kind of script so ... I have been trying to follow Vonage's plugin tutorial to make a plugin for nascar.com(steaming pile of a website). In the past I've used navix to get the streams, so I thought it might be possible. So far I've been able to get the index and thumbnails. This is what I get when trying to play a video. Code: DEBUG: CDVDDemuxFFmpeg::Open - probing detected format [swf] If anyone cares to take a look plugin.video.nascar xbmc.log Thanks for any advice, even if it's to quit wasting my time - BlueCop - 2010-09-04 It looks like you are giving xbmc the swf url from the logs. the swf is the flash component and not a video itself. I think you are looking for the video link. edit: I was looking around the site and found a couple interesting feeds you might want to check out. http://i.cdn.turner.com/nascar/feeds/partners/embeded_player/latest.xml http://i.cdn.turner.com/nascar/feeds/partners/embeded_player/mostPopular.xml also the http link to the flv is served from with an xml file and not actually embedded in the html. You need to figure out the information given to the player or flash variable passed to get that xml url. example of one of the files. http://www.nascar.com/video/truck/2010/09/03/cwts_ken_high_winner.nascar.xml in it you will see <files> <file bitrate="500" type="standard"> truck/2010/09/03/cwts_ken_high_winner.nascar.ws.flv </file> </files> that is what you are looking for I think. Good Luck! - divingmule - 2010-09-04 Quote:I was looking around the site and found a couple interesting feeds you might want to check out. Yeah, that is what I used for the index. I sniffed a download-able link. http://i.cdn.turner.com/nascar/big/truck/2010/09/03/cwts_ken_high_two.nascar.ws.flv And these xml's http://i.cdn.turner.com/nascar/.element/xml/2.0/video/cvp/container.xml http://i.cdn.turner.com/nascar/.element/xml/2.0/video/cvp/config.xml Not sure where to go from here? - BlueCop - 2010-09-04 It seems to me you could figure out the url of the xml file containing the flv url just from taking elements from the page url. If you want to be sure what is happening grab a program to extract the action script from the swf player and then you can see everything that is going on. Action script is pretty easy to read. I would just build the XML URL from the relevant data in the page URL if it is consistent. - divingmule - 2010-09-06 I need to append the url I scraped. The how-to says to do this. Code: for url in match: The log shows the same error: Code: ERROR: Error Type: exceptions.ValueError I also tried this: Code: for url in match: Anybody know what I'm doing wrong? - divingmule - 2010-09-07 Maybe I can explain a little better. In the videolinks section, the match for the url is something like this: cup/2010/09/06/cup_atl2_chatter_biffle.nascar the actual url is: hxxp://i.cdn.turner.com/nascar/big/cup/2010/09/06/cup_atl2_chatter_biffle.nascar.ws.flv In Vin's plugin tutorial it says you can do this at the addLink: for url in match: addLink(name,'http://i.cdn.turner.com/nascar/'+url,'') Looking at the xbmc log, it doesn't seem to add to the url. default.py xbmc.log Thanks for any input. - ppic - 2010-09-07 the problem is before that ! look here Code: addDir(name,url,2,thumbnail) you're passing url to step 2 then when starting step 2: Code: 09:35:34 T:3256 M:1119154176 DEBUG: ------ Window Deinit (DialogBusy.xml) ------ see that your url is not complete ! this code is failing: Code: req = urllib2.Request(url) because your url is bad : Code: 09:35:38 T:2668 M:1125883904 NOTICE: URL: cup/2010/09/06/cup_atl2_chatter_biffle.nascar should change that : Code: addDir(name,url,2,thumbnail) to that : Code: addDir(name,'http://URL_BASE'+url,2,thumbnail) where http://URL_BASE is the start of the url before "cup/2010/09/06/cup_atl2_chatter_biffle.nascar" - divingmule - 2010-09-07 Thanks. Thought I had tried that at one point. I'm trying to learn a bit. - ppic - 2010-09-07 the voinage plugin structure you use allow you to see your variable in log for each step, use it to vérify - divingmule - 2010-09-08 Sigh, another issue When selecting a video to play, I can see from my network activity that the file downloads or at least starts to, then an empty list appears. default.py xbmc.log Sorry to seem so helpless. I really have been try to figure this out myself. Thanks for any input. - divingmule - 2010-09-10 Well, I finally got it working If anyone wants to check it out I'll leave it up here for a while. plugin.video.nascar.zip - divingmule - 2010-09-12 I'm working on a TWiT plugin and I couldn't get the title and the url in the same string. So I did this: name=re.compile() url=re.compile() addLink(name,url) <error: argument 1 must be unicode or str Thanks for any input. - BlueCop - 2010-09-12 could we see more of your code? it apparently name isn't a string but I don't see why from what you have posted. Good luck with twit. Also if NASCAR only uses http then consider submitting it to the official repo. Others might find it useful. - ppic - 2010-09-12 need more code, but i guess your passing a list instead of a string - divingmule - 2010-09-13 Thanks for the reply's. default.py xbmc.log |