main
RogerWork 1 year ago
parent 9e0489fede
commit 1dabf6e5ef
  1. 35
      req.py

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

Loading…
Cancel
Save