Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Add Referer header fix error=2 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sdvcrx committed Jun 26, 2016
1 parent db95daf commit f936783
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bddown_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,12 @@ def verify_passwd(self, url, secret=None):
else:
# FIXME: Improve translation
pwd = raw_input("Please input this sharing password\n")
data = {'pwd': pwd, 'vcode': ''}
url = "{0}&t={1}&".format(url.replace('init', 'verify'), int(time()))
data = {'pwd': pwd, 'vcode': '', 'vcode_str': ''}
verify_url = "{0}&t={1}&channel=chunlei&clienttype=0&web=1".format(url.replace('init', 'verify'), int(time()))
logger.debug(url, extra={'type': 'url', 'method': 'POST'})
r = self.session.post(url=url, data=data, headers=self.headers)
headers = self.headers.copy()
headers['Referer'] = url
r = self.session.post(url=verify_url, data=data, headers=headers)
mesg = r.json()
logger.debug(mesg, extra={'type': 'JSON', 'method': 'POST'})
errno = mesg.get('errno')
Expand Down

0 comments on commit f936783

Please sign in to comment.