diff --git a/bcloud/pcs.py b/bcloud/pcs.py index bbe41f3..d30c19b 100644 --- a/bcloud/pcs.py +++ b/bcloud/pcs.py @@ -542,7 +542,7 @@ def list_dir(cookie, tokens, path, page=1, num=100): ]) req = net.urlopen(url, headers={ 'Content-type': const.CONTENT_FORM_UTF8, - 'Cookie': cookie.sub_output('BAIDUID', 'BDUSS', 'PANWEB', 'cflag'), + 'Cookie': cookie.sub_output('BAIDUID', 'BDUSS', 'PANWEB', 'cflag', 'SCRC', 'STOKEN'), }) if req: content = req.data @@ -717,7 +717,7 @@ def get_download_link(cookie, tokens, path): dlink = metas['info'][0]['dlink'] url = '{0}&cflg={1}'.format(dlink, cookie.get('cflag').value) req = net.urlopen_without_redirect(url, headers={ - 'Cookie': cookie.sub_output('BAIDUID', 'BDUSS', 'cflag'), + 'Cookie': cookie.sub_output('BAIDUID', 'BDUSS', 'cflag', 'SCRC', 'STOKEN'), 'Accept': const.ACCEPT_HTML, }) if not req: @@ -799,7 +799,7 @@ def upload(cookie, source_path, path, upload_mode): '&ondup=', ondup, '&dir=', encoder.encode_uri_component(dir_name), '&filename=', encoder.encode_uri_component(file_name), - '&', cookie.sub_output('BDUSS'), + '&', cookie.sub_output('BDUSS', 'SCRC', 'STOKEN'), ]) with open(source_path, 'rb') as fh: data = fh.read() @@ -830,7 +830,7 @@ def rapid_upload(cookie, tokens, source_path, path, upload_mode): '&content-md5=', content_md5, '&slice-md5=', slice_md5, '&path=', encoder.encode_uri_component(path), - '&', cookie.sub_output('BDUSS'), + '&', cookie.sub_output('BDUSS', 'SCRC', 'STOKEN'), '&bdstoken=', tokens['bdstoken'], ]) req = net.urlopen(url, headers={'Cookie': cookie.header_output()}) @@ -850,7 +850,7 @@ def slice_upload(cookie, data): url = ''.join([ const.PCS_URL_C, 'file?method=upload&type=tmpfile&app_id=250528', - '&', cookie.sub_output('BDUSS'), + '&', cookie.sub_output('BDUSS', 'SCRC', 'STOKEN'), ]) fields = [] files = [('file', ' ', data)] @@ -872,7 +872,7 @@ def create_superfile(cookie, path, block_list): const.PCS_URL_C, 'file?method=createsuperfile&app_id=250528', '&path=', encoder.encode_uri_component(path), - '&', cookie.sub_output('BDUSS'), + '&', cookie.sub_output('BDUSS', 'SCRC', 'STOKEN'), ]) param = {'block_list': block_list} data = 'param=' + json.dumps(param) @@ -907,7 +907,7 @@ def get_metas(cookie, tokens, filelist, dlink=True): data = ('dlink=0&target=' + encoder.encode_uri_component(json.dumps(filelist))) req = net.urlopen(url, headers={ - 'Cookie': cookie.sub_output('BDUSS'), + 'Cookie': cookie.sub_output('BDUSS', 'SCRC', 'STOKEN'), 'Content-type': const.CONTENT_FORM, }, data=data.encode()) if req: