![]() |
|
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-08-21 13:15 DragonWin Wrote:Javascript I found ^ is a bitwise XOR (in both python and javascript) which (rather handily!) is it's own inverse function (so if you do a bitwies XOR twice you end up back where you started). so for example the first number is found using: Code: n4t0=5349Code: x = r8h8z6^n4t0Code: x = 1^n4t0^n4t0Code: x = 1so basically no calculations are required at all - all you have to do is grab the numbers out of the initial javascript line and it becomes a simple process of substitution to find the port number. Code: ...i knew all those maths classes would be useful some time ![]() t0mm0 - DragonWin - 2011-08-21 13:29 haha awesome thanks :-) - DragonWin - 2011-08-21 19:18 It's getting there, at least I seem to have the US proxies under control now. Below is a sample output of my ehmm I think it's called dict in python but hash with hashes ![]() As you can see it contains more information than what it just required right now, but it might come in handy at a later stage, like making a filter on proxytype (HIA = high anonymity, ANM = Anonymous, NOA = no anonymity at all) The socket timeout were set to 2 sec during that run, to also test for timeouts etc. Code: {'208.101.63.210:8118': {'proxytype': 'HIA', 'location': 'United States (Dallas)', 'testtime': 0.312000036239624}, '205.209.188.235:80': {'proxytype': 'NOA', 'location': 'United States (Redwood City)', 'testtime': 0.38499999046325684}, '173.0.50.237:3128': {'proxytype': 'HIA', 'location': 'United States (Kansas City)', 'testtime': 1.8899998664855957}, '198.36.222.8:80': {'proxytype': 'ANM', 'location': 'United States (Rush City)', 'testtime': 0.31799983978271484}, '204.93.211.219:80': {'proxytype': 'ANM', 'location': 'United States (Skokie)', 'testtime': 0.41899991035461426}, '69.114.243.229:8909': {'proxytype': 'HIA', 'location': 'United States (Brooklyn)', 'testtime': 0.42099976539611816}, '198.36.222.8:3128': {'proxytype': 'ANM', 'location': 'United States (Rush City)', 'testtime': 1.0750000476837158}}With a bit of luck I can reuse the function for all the other countries. - rogerthis - 2011-08-21 20:00 I posted here http://forum.xbmc.org/showthread.php?tid=108110 about adding metadata and watched status through to addons, like favourites is. I think both functionality would be a big advantage to our addons. It would save a lot of work on our side, and it is something that would hopefully be easy enough to implement on there side. I might be the fact that they are presently blocking it to addons, I don't know. I have put it up as a feature request http://forum.xbmc.org/showthread.php?tid=108304. Please feel free to make any comments you think are needed. - t0mm0 - 2011-08-21 21:33 DragonWin Wrote:It's getting there, at least I seem to have the US proxies under control now. Below is a sample output of my ehmmlooks like you're making some interesting progress there! rogerthis Wrote:I posted here http://forum.xbmc.org/showthread.php?tid=108110 about adding metadata and watched status through to addons, like favourites is.i don't know enough about the metadata stuff but the watched status would be really nice. i can't think of a way of doing it in the addon itself other than marking as watched as soon as you press play (using setResolvedUrl() you can't specify what player is used (i posted a thread about that a while ago) so i don't think you can use your own sub-classed player to mark something as watched when it gets near the end) but maybe that would be ok with an option in the context menu to 'mark as unwatched'? i'm afraid i haven't done much on this code today as i've been slacking one thing i did try and fail at was using stacking for multi-part videos. looks like you can't use stack:// on plugin:// urls and i guess links would expire if you resolve them first. i guess i'll have to do something with playlists unless someone has any ideas? t0mm0 - DragonWin - 2011-08-21 22:15 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 22:34 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 18:13 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 21:36 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 22:11 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. |