From 1dabf6e5efb5a826b8ad25a3fff0c9b12eb63075 Mon Sep 17 00:00:00 2001 From: RogerWork Date: Sat, 5 Aug 2023 10:03:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- req.py | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/req.py b/req.py index 72cd96b..0103017 100644 --- a/req.py +++ b/req.py @@ -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__':