2011-08-17, 01:07
DragonWin Wrote:Hi,no problem! happy to help if i can
I have just started (2 days ago) to learn to code python and xbmc addons, so please be gentle if my questions warrants a slap or two
DragonWin Wrote:I saw a request to make an addon for http://www.solarmovies.eu on the forum and the site makes use of a lot of links, so I figured it would be a good place to start learning how to code addons, specially after I found urlresolver.nice - looks like a good site!
DragonWin Wrote:I have written 3 plugins for the resolver (divexstage, 2gb-hosting, nolimitvideo), which all still needs extensive testing, but I plan to release them once I'm confident that they work properly.great - the more people who contribute resolvers the more useful the project will be - please feel free to send them when you're happy - if possible a pull request on github is the best method as it's easier for me to keep track of all the patches.
DragonWin Wrote:So here is my question about urlresolver:now you've lost me - putlocker seems to be working fine for me? (it already sends back cookies)
How do I make use of cookies, so I can grap the cookies sent to me through a get, and then do a post and at the same time "return" the cookies I just received ?
I have tried fixing / changing the putlocker plugin as the "post" no longer work due to missing cookies.
DragonWin Wrote:Would it be possible to show an example of how to generate the cookie path, set the cookie_file, how to "catch" the cookie, and how to "return" the cookie, by using the self.net.set_cookies(self.cookie_file) etc?well, cookies are automatically handled already, assuming you use the same instance of Net. for example if you do
Code:
self.net = Net()
response1 = self.net.http_GET('http://example.com/page1')
response2 = self.net.http_GET('http://example.com/page2')
you only need to use a cookie file if you want to store cookies between different executions of the plugin.
to do that (which you probably don't ever need to do at the moment - it might be useful in login code if i add a function to auto log in to all sites that require it), when you create the Net instance, set the cookie_file and it will load in any previously saved cookies, and before your program quits call save_cookies()
eg.
Code:
#obviously you would generate the cookie file using
self.net = Net(cookie_file='/my/cookie/file')
response1 = self.net.http_GET('http://example.com/page1')
self.net.save_cookies('/my/cookie/file')
hope that makes sense?
DragonWin Wrote:ps. Great work on the resolver, it makes creating addons a breeze.
that's the plan
just bear in mind that as the module is not yet released there may be changes that mess up your code until the first real release is done!
any suggestions to make it easier are always welcome too...
t0mm0