Parallel URL Fetching - Is it possible?
#1
Hey there all,

I am working on a plugin that scrapes a site for links and then displays them in xbmc.

However, site itself is a content aggregation site that embeds videos from other sites (megavideo, etc etc) in their own webpages. So what ends up happening when I fetch the "most popular links of the last 7 days" is that I end up having to traverse each link, go to the local page with the embedded video on it then then goto the actual 3rd party site to get the file to play

As you can imagine its a bit slow loading. Is there anyway to speed up this fetching? Maybe via parallel fetching of the links on the page? Or any other way?

I know there are python libraries that do this but was wondering if anyone has any experience integrating them into xbmc.

Thanks.
Reply
#2
you can use setResolvedUrl to do that.
Reply
#3
ppic Wrote:you can use setResolvedUrl to do that.

Thanks looking into that briefly but that function doesnt appear to be documented that well, can you give me an example?
Reply
#4
xbmcplugin.setResolvedUrl replaces your call to xbmcplugin.endOfDirectory.

Steps you might take:
* Read the popular list and addList items that call back to your script (add what video to play in the url per usual). You might have to set listitem("isPlayable", true).
* In your call back do all the scraping to get the direct url to the video for that video and call setResolvedUrl with it instead of endOfDirectory.

Have a look at bluecops TNT addon. It seems to be the easiest to follow. I could be wrong, but I don't see the different between using setResolvedUrl or calling the Player directly.
Reply
#5
There's a huge difference between using setResolvedUrl or calling the player directly.

Use setResolvedUrl whenever possible. It allows watched/playcount etc. tracking (assuming ofcourse that the URL that you use in the item itself is stable, which it normally is).

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#6
daledude Wrote:xbmcplugin.setResolvedUrl replaces your call to xbmcplugin.endOfDirectory.

Steps you might take:
* Read the popular list and addList items that call back to your script (add what video to play in the url per usual). You might have to set listitem("isPlayable", true).
* In your call back do all the scraping to get the direct url to the video for that video and call setResolvedUrl with it instead of endOfDirectory.

Have a look at bluecops TNT addon. It seems to be the easiest to follow. I could be wrong, but I don't see the different between using setResolvedUrl or calling the Player directly.

Thanks that helps a lot.
Reply
#7
jmarshall Wrote:There's a huge difference between using setResolvedUrl or calling the player directly.

Use setResolvedUrl whenever possible. It allows watched/playcount etc. tracking (assuming ofcourse that the URL that you use in the item itself is stable, which it normally is).

Cheers,
Jonathan

Thanks for that clarification.
Reply

Logout Mark Read Team Forum Stats Members Help
Parallel URL Fetching - Is it possible?0