CodeReclaimers / btce-api

Python wrapper around the public and trading APIs of BTC-e.com
MIT License
191 stars 123 forks source link

Fixed main page scraping. #26

Closed sir-wabbit closed 11 years ago

sir-wabbit commented 11 years ago

I have recently noticed that the show-chat.py stopped working. A little investigation revealed that from now on the BTC-e site requires you to pass valid cookies to access its web-pages (not API). Cookies are set both using Set-Cookie header and document.cookie=... javascript code.

This pull-request adds a cookie variable to the BTCEConnection, which is automatically set whenever makeRequest is called with with_cookie=True. I would rather prefer to use cookielib instead of regular expressions, however cookielib doesn't work well with the httplib module.

alanmcintyre commented 11 years ago

Thank you for looking into this! I had noticed that it was broken but have been so busy lately I hadn't had time to figure out what to do about it.