|
|
|
@ -1,3 +1,5 @@ |
|
|
|
|
import os |
|
|
|
|
|
|
|
|
|
import requests |
|
|
|
|
import urllib3 |
|
|
|
|
import random |
|
|
|
@ -142,21 +144,24 @@ class ReqAction: |
|
|
|
|
return response.json()['errno'] |
|
|
|
|
|
|
|
|
|
def main(self): |
|
|
|
|
target_dir = '/Temp/leshe/1' |
|
|
|
|
dir_name = '2' |
|
|
|
|
link_list = [] |
|
|
|
|
self.get_cookies() |
|
|
|
|
self.bdstoken = self.get_bdstoken() |
|
|
|
|
dir_list = self.get_dir_list('/Temp/leshe') |
|
|
|
|
print([_dir['path'] for _dir in dir_list]) |
|
|
|
|
if target_dir in [_dir['path'] for _dir in dir_list]: |
|
|
|
|
print('找到了') |
|
|
|
|
# if dir_name and dir_name not in [_dir('path') for _dir in self.dir_list]: |
|
|
|
|
# self.create_dir(r'/Temp/leshe/1') |
|
|
|
|
# 执行转存 |
|
|
|
|
for link in link_list: |
|
|
|
|
verified_links = self.verify_links(link[0], link[1]) |
|
|
|
|
self.transfer_files(verified_links, target_dir) |
|
|
|
|
base_dir = '/Temp/' |
|
|
|
|
cate_dir = 'leshe/' |
|
|
|
|
target_dir_name = '2' |
|
|
|
|
target_dir = os.path.join(base_dir, cate_dir, target_dir_name) |
|
|
|
|
print(target_dir) |
|
|
|
|
# link_list = [] |
|
|
|
|
# self.get_cookies() |
|
|
|
|
# self.bdstoken = self.get_bdstoken() |
|
|
|
|
# dir_list = self.get_dir_list('/Temp/leshe') |
|
|
|
|
# print([_dir['path'] for _dir in dir_list]) |
|
|
|
|
# if target_dir in [_dir['path'] for _dir in dir_list]: |
|
|
|
|
# print('找到了') |
|
|
|
|
# # if dir_name and dir_name not in [_dir('path') for _dir in self.dir_list]: |
|
|
|
|
# # self.create_dir(r'/Temp/leshe/1') |
|
|
|
|
# # 执行转存 |
|
|
|
|
# for link in link_list: |
|
|
|
|
# verified_links = self.verify_links(link[0], link[1]) |
|
|
|
|
# self.transfer_files(verified_links, target_dir) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
|