|
|
|
@ -138,7 +138,7 @@ class ReqAction: |
|
|
|
|
return [shareid_list[0], user_id_list[0], fs_id_list] |
|
|
|
|
|
|
|
|
|
# 转存文件函数 |
|
|
|
|
@retry(stop_max_attempt_number=9, wait_fixed=random.randint(1000, 3000)) |
|
|
|
|
@retry(stop_max_attempt_number=3, wait_fixed=random.randint(1000, 3000)) |
|
|
|
|
def transfer_files(self, verify_links_reason, target_directory_name): |
|
|
|
|
url = f'{BASE_URL}/share/transfer?shareid={verify_links_reason[0]}&from={verify_links_reason[1]}&bdstoken={self.bdstoken}&channel=chunlei&web=1&clienttype=0' |
|
|
|
|
post_data = {'fsidlist': f'[{",".join(i for i in verify_links_reason[2])}]', |
|
|
|
@ -147,8 +147,11 @@ class ReqAction: |
|
|
|
|
allow_redirects=False, verify=False) |
|
|
|
|
print('transfer_files') |
|
|
|
|
print(response.text) |
|
|
|
|
file_name = response.json()['extra']['list'][0]['from'] |
|
|
|
|
return response.json()['errno'], file_name |
|
|
|
|
result = response.json()['errno'] |
|
|
|
|
file_name = None |
|
|
|
|
if result == 0: |
|
|
|
|
file_name = response.json()['extra']['list'][0]['from'] |
|
|
|
|
return result, file_name |
|
|
|
|
|
|
|
|
|
def prepare(self): |
|
|
|
|
self.get_cookies() |
|
|
|
@ -167,7 +170,7 @@ class ReqAction: |
|
|
|
|
verified_links = self.verify_links(save_link, save_code) |
|
|
|
|
if isinstance(verified_links, list): |
|
|
|
|
result, name = self.transfer_files(verified_links, save_path) |
|
|
|
|
if result == 0: |
|
|
|
|
if result == 0 or result == 4: |
|
|
|
|
return True, name |
|
|
|
|
return False, None |
|
|
|
|
|
|
|
|
|