Skip to content

Commit

Permalink
Remove cookie from headers of _secret_or_not, try to fix #142
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDing committed Jan 24, 2019
1 parent ca39081 commit ddef9c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pan.baidu.com.py
Original file line number Diff line number Diff line change
Expand Up @@ -1639,8 +1639,8 @@ def save_share(self, url, remotepath, infos=None):
def _secret_or_not(url):
ss.headers['Referer'] = 'http://pan.baidu.com'
r = ss.get(url, headers=headers)

if r.status_code != 200 and r.status_code != 302:
print('cookies', ss.cookies.get_dict())
ss.headers['Cookie'] = ';'.join(['{}={}'.format(k, v) for k, v in ss.cookies.get_dict().items()])
r = ss.get(url, headers=headers, cookies=r.cookies)

Expand All @@ -1663,8 +1663,8 @@ def _secret_or_not(url):
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept': '*/*',
'X-Requested-With': 'XMLHttpRequest',
'Cookie': 'BAIDUID=0F38C66B2C9AC2FC887BD3FEB059F5AC:FG=1; PANWEB=1',
'Connection': 'keep-alive',
'Referer': 'http://pan.baidu.com'
}
r = ss.post(url, data=data, headers=theaders)
if r.json()['errno']:
Expand Down

0 comments on commit ddef9c6

Please sign in to comment.