script.module.urlresolver development - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Python Add-on Development (/forumdisplay.php?fid=26)
+--- Thread: script.module.urlresolver development (/showthread.php?tid=105707)
- t0mm0 - 2011-09-14 16:25
so i have pushed a new branch in urlresolver called videoid. i haven't updated the docs yet as i don't know if this is the best way to go yet, please read below to see what is going on. i have only updated the putlocker/sockshare plugin.
it adds some complication to the situation, but it also add some flexibility so i'd like to know what people think and whether i should move to this method instead of the existing way of doing things.
it should solve some problems people have had (such as being able to pass a host and media id instead of a full url for example) and although i haven't yet aded it, this will also mean it is easy to sort the choose_source() stuff as it can now be a list of HostdMediaFile objects instead of the current dictionary.
a new object is introduced called HostedMediaFile which represents a (surprise!) hosted media file, check it out here
you make one by passing either a url or a host and a media id:
add_video_item() has been changed slightly to allow you to pass anything you like. play is now a dict. so you can pass url, or host and media_id (or anything else you like - should fix eldorados problem)
rather than calling a function i urlresolver, you now call the resolve method on your HostedMediaFile. so t0mm0 test addon has been modified thus:
so, plugins also become slightly more complicated as you have to implement 2 more methods though they are pretty straightforward.
get_url() turns a host and media_id into a proper url for the hoster. in putlicker it goes like this:
get_host_and_id() does the exact opposite - putlocker implementation follows:
valid_url() also has to be updated to check for either valid url or host:
get_media_url now takes host and media_id arguments instead of url, you can get the url by doing self.get_url(host, media_id)
i hope that all makes sense. please take a look and tell me where i am going wrong, and if you think it is worth making these alterations. it certainly solves a fair few problems but i don't want to end up making everything much more complicated!
- Eldorado - 2011-09-14 18:32
t0mm0 Wrote:so i have pushed a new branch in urlresolver called videoid. i haven't updated the docs yet as i don't know if this is the best way to go yet, please read below to see what is going on. i have only updated the putlocker/sockshare plugin.
On the cover this sounds very good, don't be too concerned about adding some complexity as it's tough to expand the features while keeping the coding simple
I'll create a 2nd branch in my addon as well and give this a go and let you know how I make out!
- whufclee - 2011-09-14 20:03
Hi guys only me popping my head in again - I've just made a new discovery so thought I'd share it with you clever people. By complete accident I came across the Stagevu plugin from AJ's repo and installed it on the xbox and Win7 setup, not only does it work great but it has a great feature that maybe you could use... As well as download, download with jdownloader and download & play (which I believe needs a patched version of xbmc to work) it has "download quietly". This downloads in the background so you can carry on using xbmc as normal, you can even set another download off and have simultaneous downloads or you can watch a stream whilst it's downloading. I've tested this and honestly it really does work - even on xbox, I can't quite believe it! On xbox I tried downloading from stagevu whilst streaming from icefilms and it was great, I could even download from icefilms & stagevu at the same time or do simultaneous downloads from stagevu. Who is this AJ? I'm very impressed!
- k_zeon - 2011-09-16 22:13
just tried the megaupload link in your test addon and it fails.
I saw that you had some code somewhere to wait the 45 secs.
Is there an example and how to use it.
- t0mm0 - 2011-09-16 22:16
k_zeon Wrote:Hi t0mm0
sorry, i think the update i committed the other day from anarchintosh may have broken it and i didn't test fully, you could always try going back before that commit. i will try and fix that tomorrow when i also intend to move the countdown code to t0mm0.common.addon
for an example of how to use it see the megaupload plugin
- k_zeon - 2011-09-16 22:44
went back to Sep 03 and still has wont play that megaload link
I deleted all the folder from Apptle TV2 of yours , then put the sept 03 ones back and set correct permissions etc
Is there any other module i am maybe missing
- rogerthis - 2011-09-16 23:03
Did you try a different url, the one in the t0mm0.test is not working http://www.megaupload.com/?d=TQPQJM5H
- Eldorado - 2011-09-16 23:36
Looking to do another site as I'm starting to have some fun now
Anyone currently working on either of these sites:
I really like quicksilverscreen and might jump on that one first if no one else has?
- rogerthis - 2011-09-16 23:48
Eldorado Wrote:Looking to do another site as I'm starting to have some fun now
I started quicksilverscreen, but I'm really swamped with work for the next month. So no problem.
There isn't a full link url for the play files, but you will find the info below the body.
- slyi - 2011-09-17 09:50
I was playing with an ice resolver http://dl.dropbox.com/u/6589941/icefilms_resolver/icefilms.py.txt (it works for TV) but i dont use the standard url calls to be able to use the net class. Is this allowable?
Sample app http://dl.dropbox.com/u/6589941/icefilms_resolver/plugin.video.t0mm0.icefilms2.zip