script.module.urlresolver development - 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: script.module.urlresolver development (/showthread.php?tid=105707) |
- DragonWin - 2011-08-21 t0mm0 Wrote:looks like you're making some interesting progress there! It' coming along nicely it's now able to test the proxy's it has found, and choose the optimal proxy, and returns ip: port, location like: Code: 184.73.63.96:80, United States (Seattle) I did run into an error that I'm unsure if it should be the net class that handles it. Error showed itself a few times when I did a HEAD to http://www.google.com going through the proxy Code: Traceback (most recent call last): t0mm0 Wrote:i'm afraid i haven't done much on this code today as i've been slacking I'm way to inexperienced to be of any use regarding stack:// or plugin:// I have put the 3 plugins I have done up on github, and for now until I'm satisfied that they actually work I'll keep them separate from urlresolver, so I can update them without having to ask you to update your git repository, but feel free to abuse / break them and let me know if you succeed https://github.com/DragonWin/xbmc-urlresolver-plugins @rogerthis I wish I could be of help there, but I'm just starting with the xbmc stuff and python ... it's way over my head ... all though I must agree that the functionality would be great to have available for addons. - t0mm0 - 2011-08-21 DragonWin Wrote:It' coming along nicely it's now able to test the proxy's it has found, and choose the optimal proxy, and returns ip: port, location like:cool DragonWin Wrote:I did run into an error that I'm unsure if it should be the net class that handles it.not something i've come across before, don't think i can help much without running the code. DragonWin Wrote:I have put the 3 plugins I have done up on github, and for now until I'm satisfied that they actually work I'll keep them separate from urlresolver, so I can update them without having to ask you to update your git repository, but feel free to abuse / break them and let me know if you succeedgreat! i'll take a peek as soon as i get the chance. though it will be easier for both you and me if you fork my repo and commit the plugins in there instead (make branches if you want to work on different things at the same time). then when you are happy with them you can send a pull request and github keeps track of everything. thanks, t0mm0 - Eldorado - 2011-08-22 t0mm0 Wrote:i did some playing around and have come up with a proposal.... Sounds good! Are you restricted to do it this way, using > as the separator, or can you overload the method and do something like this: urlresolver.resolve('videoweed.com', 'crirmdz3tj116') And still at the same time allow it to be called supplying a standard full url: urlresolver.resolve('http://www.videoweed.com/videoid=crirmdz3tj116') I really need to start reading thru the urlresolver code Btw, excellent stuff so far, my addon is progressing quite well mainly due to making use of your common classes and of course the urlresolver, the majority of the time spent was really scraping of the site and learning how to do things in Python.. everything else from adding directories, video links, and of course playing video links was a piece of cake! - whufclee - 2011-08-22 Just noticed you were talking about stacking different sources. I have no idea how he done it but whilst testing out all the plugins recently I found that the ones on AJ Repo all had this feature. You can choose to watch parts (as you can in all other plugins) but there's also an option to watch the whole thing by somehow stacking. It works a treat so if you want to take a look at his code I think all of his ones had this feature. His repo is hosted here http://code.google.com/p/apple-tv2-xbmc/source/browse/#svn%2Ftrunk%2Faddons - t0mm0 - 2011-08-22 Eldorado Wrote:Sounds good!i think you might be right. i was trying to do as little change to the plugins as possible, and thought that doing it that way would mean writing new methods for each plugin and complicate the interface, but looking at it now i think it doesn't have to. i think it is still needed to send this to the plugin itself, but the urlresolver.resolve() could take two arguments and add the '>' before passing it on to the plugins. the only issue i see is with the stuff like urlresolver.filter_list() and choose_source() etc. how would you pass 2 separate arguments to those? you could have a class that represents a host and video id or perhaps? dunno, other ideas are welcome! Eldorado Wrote:Btw, excellent stuff so far, my addon is progressing quite well mainly due to making use of your common classes and of course the urlresolver, the majority of the time spent was really scraping of the site and learning how to do things in Python.. everything else from adding directories, video links, and of course playing video links was a piece of cake! thanks! that was the plan so i'm glad it's working out i'm sure we can make it simpler though as people such as yourself think of different ways of using stuff or other useful bits of code that can be abstracted out of addons and into the modules so they can be reused. whufclee Wrote:Just noticed you were talking about stacking different sources. I have no idea how he done it but whilst testing out all the plugins recently I found that the ones on AJ Repo all had this feature. You can choose to watch parts (as you can in all other plugins) but there's also an option to watch the whole thing by somehow stacking. It works a treat so if you want to take a look at his code I think all of his ones had this feature. His repo is hosted here http://code.google.com/p/apple-tv2-xbmc/source/browse/#svn%2Ftrunk%2Faddons thanks for the pointer - i just had a look and it looks like he is using playlists too. all the code to do this is in t0mm0.common already so i will definitely go that way. i just thought i'd have a play with stack:// as it exists and i hadn't tried it before t0mm0. - Eldorado - 2011-08-23 t0mm0 Wrote:i think you might be right. i was trying to do as little change to the plugins as possible, and thought that doing it that way would mean writing new methods for each plugin and complicate the interface, but looking at it now i think it doesn't have to. i think it is still needed to send this to the plugin itself, but the urlresolver.resolve() could take two arguments and add the '>' before passing it on to the plugins. For those 2 methods, would you be only passing in strings or would they be collections? (are they called dicts in python?) t0mm0 Wrote:thanks! that was the plan so i'm glad it's working out i'm sure we can make it simpler though as people such as yourself think of different ways of using stuff or other useful bits of code that can be abstracted out of addons and into the modules so they can be reused.t0mm0. I'm sure this could expand quite a bit once more people jump in, especially if this can be added to the main repo I'm starting to take a peak into the metadata code in Icefilms, another piece Anarchintosh was thinking of pulling out on it's own as part of Video Falcon.. hopefully we can eventually move onto that one and have a central meta data container for all addons that wish to use it! - rogerthis - 2011-08-23 In this addon VODie http://code.google.com/p/xbmc-vodie/ there is a function for recently played files (and favourites too). This is another option that would be handy for t0mm0.common, for people with bad memories like myself. It seems to be well coded, definitely worth a look. - matmabro - 2011-08-23 iDude Wrote:I personally think that favorites should be handled by the addons separately. That's because many sites have a "favorites" section once you sign up. letmewatchthis.ch has this for example and it's quite useful because you can add whole TV shows to your favorites and they update themselves when a new episode comes out. This in combination with XBMC.MyLibrary and you have a SickBeard for streaming (Works with movies too)iDude, could you briefly explain how you were implement this and get it to work? I have been messing around with XBMC.Mylibrary for a little bit and have had only limited success with it, although I think it's because I was trying to use Bluecop's Hulu plugin, which now seems ti be not really working. I think that if I could get the letmewatch.ch favorites into mylibrary, my wife would be one super happy camper. - t0mm0 - 2011-08-23 rogerthis Wrote:In this addon VODie http://code.google.com/p/xbmc-vodie/ there is a function for recently played files (and favourites too). This is another option that would be handy for t0mm0.common, for people with bad memories like myself. yes a very nice and simple favourites implementation - i might be persuaded to add something like that into t0mm0.common.addon after all is 'recently watched' useful? actually that might form the basis of a nice way to handle watched status too.... does anyone know what you need to set to get the tick that pops up on watched items? by the way i am really busy this week so probably won't be able to actually write any more code till after the weekend t0mm0 - DragonWin - 2011-08-25 Hey T0mm0 Sorry for being absent on the project without any word, but unfortunately a customer called (same as last), and asked how fast I could be at the airport , and they would arrange my travel plans. I'm still on the business trip, so I have not had any chance to look at forking / branching the code, but I will def. look into it once I'm back. I'll also try and look into how I build Proxyscraper (anon proxy what ever we are going to call it) as a class that can be implemented into the common part or net class to be used by other addons. I'm thinking of just stealing the framework from the net class and work from there. I'll look through all the post once I get back to catch all the tips you put there while I have been away Zshare plugin - Eldorado - 2011-08-25 I'm working on a ZShare plugin but having a bit of trouble Code: Code: import re Rather simple as I don't know how to do any fancy python stuff yet First - when I pass in zshare links to either urlresolver.choose_source() or urlresolver.filter_urls() they don't come back in the filtered list **Edit - oops, was a typo error in my addon! Second - the link I am returning doesn't seem to be playable when used via urlresolver eg. addon.add_video_item('http://www.zshare.net/video/93296873f03a68ec', {'title': 'zshare'}) Logs show errors trying to open the stream Code: 13:20:39 T:1740 M:1387261952 NOTICE: DVDPlayer: Opening: http://dl005.zshare.net/stream/e0fa06c3aa46583713037cbe84b53d78/93296873/1314292839/QSSDivX_lap-bdtc.avi.flv//5257303228/?start=0 Yet when I put this same resolved link into a STRM file it plays fine: Code: 13:20:15 T:1740 M:1408155648 NOTICE: DVDPlayer: Opening: http://dl005.zshare.net/stream/f16aaf43283b78078c651d5ffc00de7a/93296873/1314216558/QSSDivX_lap-bdtc.avi.flv//5256998104/?start=0 Again.. something I'm missing? The url does look odd ending with '//5256998104/?start=0', but this is what I found works and is what URL Snooper reports as the file being played - rogerthis - 2011-08-25 Hey Eldorado, I have been playing with your code, but I haven't found the solution. When I add only this to my strm file Code: http://dl005.zshare.net/stream/3b53563b806f9d64901f3be33531c263/93296873/1314298987/QSSDivX_lap-bdtc.avi.flv//5257327820/?start=0 Also what was the typo? I started working on it before you changed it. - t0mm0 - 2011-08-25 DragonWin Wrote:Hey T0mm0 no worries DragonWin, i am not able to do much coding this week either though i should be back at full(-ish) speed after the weekend. t0mm0 - t0mm0 - 2011-08-25 hi eldorado, i had written something almost exactly the same a few weeks back which worked fine but i hadn't released it as i hadn't done much testing. i tried my old code and that failed too (which i was expecting as it was pretty much the same as yours!) anyway, i looked at the requests in a browser and the only real difference seemed to be the http headers. so after a small bit of testing it seems they don't like the xbmc user-agent any more. replacing it with a normal browser user-agent seems to fix it: Code: import re is zshare fast enough to also stream the original file? might be worth adding as a setting if it is..... t0mm0. - Eldorado - 2011-08-25 rogerthis Wrote:Hey Eldorado, I have been playing with your code, but I haven't found the solution. Sorry I should have written more, I had a typo in my addon which calls urlresolver, not related to the plugin |