script.module.urlresolver development - Printable Version
+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Add-ons (/forumdisplay.php?fid=26)
+--- Thread: script.module.urlresolver development (/showthread.php?tid=105707)
- DragonWin - 2011-08-29 06:55
k1m0s Wrote:First off I must say, Probably the best creation for making addons ever. Really appreciate your guys work. Makes thing easier on a meat head like me. I spet a cpl weeks trying to get megaup file to play with no luck at all till I tried this and it took just minutes. I have been messing with the test addon and was wondering if there is a way to add icons to the links in the format given
I think you can, give this a try
so I guess
Also have a look at this add_video_item
Hope it helps more than confuse
Thanks I'll give that a look when I get home from work.
- k1m0s - 2011-08-29 12:47
Thanks DragonWin, That worked perfect.. I kept trying , 'thumb': 'http://.....' and 'thumbnail' : But didnet need any of that. Thanks again man
- t0mm0 - 2011-08-29 15:52
k1m0s Wrote:First off I must say, Probably the best creation for making addons ever. Really appreciate your guys work. Makes thing easier on a meat head like me.
thanks k1m0s - please shout if you can think of anything that would make it easier!
- mynumbistongue - 2011-08-29 18:00
I dont know if this is possible but with megavideo having a 72 minute watch limit would there be a way to just stream those videos straight from megaupload to bypass the watch limit sorta like what this site does http://daiphyer.com/megavideo.com/download/link/generator ,just an idea to make life easier for the end user with no megavideo premium account.
- t0mm0 - 2011-08-29 18:39
mynumbistongue Wrote:I dont know if this is possible but with megavideo having a 72 minute watch limit would there be a way to just stream those videos straight from megaupload to bypass the watch limit sorta like what this site does http://daiphyer.com/megavideo.com/download/link/generator ,just an idea to make life easier for the end user with no megavideo premium account.
if the megavideo link uses 'd=XYZ1234' then it is easy, but i have no idea how to convert if it is the more usual 'v=XYZ1234' - does anyone know how it works?
on the other hand i have a feeling that the time limit may be implemented in the flash player and therefore not affect xbmc - does anyone know if this is the case (i've never tried to watch anything long with megavideo)?
even if that is the case it would be nice if it is possible to get the link to the original file on megaupload from any megavideo link....
- Eldorado - 2011-08-29 19:11
t0mm0 Wrote:without running the code but comparing it to rogerthis code, i think you want to use http_POST() instead of http_GET(). the 'header' variable you are creating is not actually headers but form data to POST.
Is now resolving final url, though having some issues getting the link to play.. I'm thinking it could have to do with the time delay they impose on the site, also might be good to include a login process as the site states better speeds, shorter wait times on registered/premium users the same as MegaUpload
XBMC logs only show error - "error probing input format".. possibly because the link is no longer valid and is instead returning the html page
I'll get what I have into source for now, as the FLV portion works with no problems
- Eldorado - 2011-08-29 19:22
t0mm0 Wrote:check out the letmewatchthis addon which uses choose_source()
Since you guys are talking about this, thought I would chime in as well
Is it possible for choose_source() to sort the list?
Also it could use some handling if a user doesn't select a source - currently it tries to play no matter what
And... add_video_item, currently I'm leaning towards a need to have more information passed when the user clicks on a video item.. such as a distinction between a tv show or a movie, so passing another tag other than just the 'play=' would be handy
Is it currently possible?
- t0mm0 - 2011-08-29 19:50
you can reuse the countdown code that megaupload uses. it's not currently documented, but this is mainly as i think it is best moved out of urlresolver an into t0mm0.common.addon - for now look at the megaupload plugin for info.
Eldorado Wrote:Since you guys are talking about this, thought I would chime in as wellanything is possible
i guess sorting by resolver plugin priority order would be handy? or do you mean you want to specify an order (i can see that would be useful too)? i am still planning a setting to just try the highest priority link rather than pop up the list (falling through to the next one if the first doesn't work and so on)
Eldorado Wrote:Also it could use some handling if a user doesn't select a source - currently it tries to play no matter whati think there is no way to tell if the selection is 'cancelled' (by pressing escape for example). maybe it should add a 'cancel' option in the list?
Eldorado Wrote:And... add_video_item, currently I'm leaning towards a need to have more information passed when the user clicks on a video item.. such as a distinction between a tv show or a movie, so passing another tag other than just the 'play=' would be handy
yes i think so if you urlencode it into the url but it's not pretty. why would that sort of info be needed when you are playing? you should have already set up the listitem with all the infolabels and such by that point?
by the way i am back working on this again. today i've been experimenting with the ways to use hoster and video id rather than full url. not come up with anything i like better than my previous proposal yet though... whatever i try seems to add a lot of complication for not much gain in functionality.
- Eldorado - 2011-08-29 21:38
t0mm0 Wrote:you can reuse the countdown code that megaupload uses. it's not currently documented, but this is mainly as i think it is best moved out of urlresolver an into t0mm0.common.addon - for now look at the megaupload plugin for info.
Yep, I have put in the countdown clock but still not able to play.. I'm going to pause on this guy for now to get more work done on my addon
When I check it into your repository I'll disable the AVI selection until myself or someone else can get to it
t0mm0 Wrote:anything is possible
Sorting.. now that you mention the priority idea, I think there could be many ways of sorting.. by priority, key or value.. etc.
Maybe just only do by priority and have it optional, leave it up to the developer to pre-sort the dict before passing it in?
For when a user cancels on the dialog box you can check the index value, -1 means nothing was selected
I have done this on my own addon but after 3-4 times I still get the 'failed to play items' msg box
t0mm0 Wrote:yes i think so if you urlencode it into the url but it's not pretty. why would that sort of info be needed when you are playing? you should have already set up the listitem with all the infolabels and such by that point?
This might be because I painted myself into a corner when doing my addon.. and using your letmewatchthis addon as a bit of a template
If I can explain my situation correctly..
When I list movies I use the add_video_item method to add them, when a user clicks on the movie the 'play=' tag is passed and picked up in my script
Sudo code of what i do:
My issue is by using a catch all 'if play' block, I sometimes will be passing in a url where the sources need to be parsed out differently, such as movies have their sources laid out in one way while TV shows have theirs structured in another..
So in this design it would be nice to be able to optionally pass another tag that I could check and know how I need to parse the page
Obviously I could modify my design, but I'm a bit stuck on how to do so without writing in my own methods to add a video item.. or maybe making the movies a directory instead of a video item.. but presents a few more design changes, and I think will take away some functionality for metadata etc.
Ideas? Can maybe take this topic to my dev thread I started
- k1m0s - 2011-08-30 01:53
t0mm0 Wrote:thanks k1m0s - please shout if you can think of anything that would make it easier!
I would love to help but I do not have alot of time right now and am still pretty virgin to coding, enjoying learning what I can tho. Been studying your url resover files tho and am seeing things Ive never caught on to b4. Will be plugging around when I can tho. Thx again t0mm0
- DragonWin - 2011-08-30 18:23
I noticed that some novamov links don't work. They work fine in my browser but when I test them using the test addon no stream is available. I modified novamov to also return true on "embed.novamov.com/embed.php?width
I did a few tcpdumps and I noticed 3 differences.
- t0mm0 - 2011-08-30 20:55
DragonWin Wrote:what really bugs me is the HEAD that is done from xbmc before the GET, where does that come from?
i'll take a look at the rest later, but i believe xbmc does a HEAD first to see if it can determine the mime type from that in order to choose the correct player.
- t0mm0 - 2011-09-01 01:14
just merged a load of cool stuff from DragonWin including
- DragonWin - 2011-09-01 06:42
t0mm0 Wrote:just merged a load of cool stuff from DragonWin including
Your welcome, glad I could give some thing back with all the help I have received here
I have started to look into context menu items, as the next step for favorites. I'm thinking it could work some thing like this (I have not decided yet, just got some individual parts to work last night.)
function to generate the context menu items via t0mm0.addon, this object would then be returned to the user.
MyContextObject = create_contextmenu(menuname, scriptargs, mode=True/False, [contextobject]):
Where menuname, is what is displayed to the user on right click, scriptargs is the arguments passed to the plugin, mode indicates if the function that is hit creates a new listitem with add_dir, add_item ect, contextmenuitem object is an existing object. The object is a previously returned contextmenu, and only used if the user wants to add more menu items for that individual list item to be added using add_item add_video_item add_music_item (eg. Go to favories, Add item as favorite)
As far as I could make out using XBMC.Container.Update() forces it to clear the itemlist, and accept a new itemlist to be displayed (eg. Go to favorite menu item), or XBMC.RunPlugin() is used for eg. "add to favorites" as that would not generate a new itemlist. Which is why we need to know from the addon what type it is, hence the True/False in the create_contextmenu()
add_item, add_video_item, add_music_item
would prob need 1 new arg, where it is the object returned from the create_contextmenu.
The end goal is to see if a functions like "add_favorite", "del_favorite", "show_favorites" can be created, so it's very easy to manage favorites. Of cause the end user also have the options to use the other functions, bypassing the favorite part entirely.
t0mm0 Wrote:ps. sorry but i'm too tired now so the novamov stuff will have to wait till tomorrow...
No problem it was more of a heads up and just a quick peek to see if I could help out with a bit of debug information.
- DragonWin - 2011-09-01 07:12
I just noticed that you change import pickle to cPickle. I omitted cPickle on purpose as there are some data type objects it can't handle (found it some where on the net can't remember what it is it can't handle) but pickle can.
Just thought I would mention it.