Plugin advice
#1
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]
ERROR: ffmpeg[E28]: [swf] Compressed SWF format not supported
ERROR: CDVDDemuxFFmpeg::Open - Error, could not open file http://i.cd......
ERROR: CDVDPlayer::OpenDemuxStream - Error creating demuxer

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 Big Grin
Reply
#2
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/par...latest.xml
http://i.cdn.turner.com/nascar/feeds/par...opular.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/0...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!
Reply
#3
Quote: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/par...latest.xml


Yeah, that is what I used for the index.

I sniffed a download-able link.
http://i.cdn.turner.com/nascar/big/truck...car.ws.flv
And these xml's
http://i.cdn.turner.com/nascar/.element/...tainer.xml
http://i.cdn.turner.com/nascar/.element/...config.xml
Not sure where to go from here?
Reply
#4
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.
Reply
#5
I need to append the url I scraped. The how-to says to do this.
Code:
for url in match:
                addLink(name,'http://i.cdn.turner.com/nascar/'+url,'')

The log shows the same error:
Code:
ERROR: Error Type: exceptions.ValueError
ERROR: Error Contents: unknown url type: cup/2010/09/.....

I also tried this:
Code:
for url in match:
                url = 'http://i.cdn.turner.com/nascar/' + url
                addLink(name,+url,'')

Anybody know what I'm doing wrong?
Reply
#6
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.
Reply
#7
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) ------
09:35:38 T:2668 M:1125883904  NOTICE: Mode: 2
09:35:38 T:2668 M:1125883904  NOTICE: URL: cup/2010/09/06/cup_atl2_chatter_biffle.nascar
09:35:38 T:2668 M:1125883904  NOTICE: Name: Race Chatter: Greg Biffle
09:35:38 T:2668 M:1125883904  NOTICE: cup/2010/09/06/cup_atl2_chatter_biffle.nascar
09:35:38 T:2668 M:1125883904    INFO: -->Python script returned the following error<--
09:35:38 T:2668 M:1125883904   ERROR: Error Type: exceptions.ValueError
09:35:38 T:2668 M:1125883904   ERROR: Error Contents: unknown url type: cup/2010/09/06/cup_atl2_chatter_biffle.nascar

see that your url is not complete !

this code is failing:
Code:
req = urllib2.Request(url)
        req.addheaders = [('Referer', 'http://www.nascar.com/videos'),
                          ('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)')]
        response = urllib2.urlopen(req)
        link=response.read()
        response.close()

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"
Reply
#8
Thanks. Thought I had tried that at one point. I'm trying to learn a bit.
Reply
#9
the voinage plugin structure you use allow you to see your variable in log for each step, use it to vérify Wink
Reply
#10
Sigh, another issue Confused

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.
Reply
#11
Well, I finally got it workingShocked

If anyone wants to check it out I'll leave it up here for a while.

plugin.video.nascar.zip
Reply
#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.
Reply
#13
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.
Reply
#14
need more code, but i guess your passing a list instead of a string Wink
Reply
#15
Thanks for the reply's.

default.py xbmc.log
Reply

Logout Mark Read Team Forum Stats Members Help
Plugin advice0