Skip to content

Commit

Permalink
Update version 3.0.8
Browse files Browse the repository at this point in the history
下载文件中途会出现Request has expired,大概15分就出现 #76
文件名错误替换导致秒传链接无法导入
  • Loading branch information
wxy1343 committed Jul 27, 2022
1 parent be26d46 commit 2f383cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aliyunpan/about.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.0.7'
__version__ = '3.0.8'
8 changes: 4 additions & 4 deletions aliyunpan/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def upload(self, path, upload_path='root', timeout=10.0, retry=3, force=False, s
share_info = parse_share_url(path, self._disk.access_token)
file = self._path_list.get_path_node(share_info.name, update=False)
if file and not file.data.type:
path = path.replace(share_info.name, share_info.name + str(int(time.time())))
path = f'{self._share_link}{path.lstrip(self._share_link).split("|")[0]}_{str(int(time.time()))}|{path.split("|", 1)[1]}'
share_info = parse_share_url(path, self._disk.access_token)
if not self._path_list.get_path_fid(share_info.name, update=False):
self.upload_share(share_info)
Expand Down Expand Up @@ -617,7 +617,7 @@ def share_(path, file_id, parent_file=''):
url = f'{self._share_link}{file.name}|{file.content_hash}|{url_base64}|{file.size}|{parent_file or "root"}'
share_txt += url + '\n'
share_txt += '导入链接'.center(50, '*') + '\n'
share_txt += f'python main.py upload "{url}"' + '\n\n'
share_txt += f'python aliyunpan.py upload "{url}"' + '\n\n'
print(share_txt)
GLOBAL_VAR.txt += share_txt
else:
Expand All @@ -635,7 +635,7 @@ def share_(path, file_id, parent_file=''):
with open(file_name, 'w', encoding='utf-8') as f:
f.write(GLOBAL_VAR.txt)
print('文件导入'.center(50, '*'))
print(f'python main.py upload -s {file_name}')
print(f'python aliyunpan.py upload -s {file_name}')
print('链接导入'.center(50, '*'))
file_id = self.upload(file_name)[0]
print()
Expand All @@ -644,7 +644,7 @@ def share_(path, file_id, parent_file=''):
file = self._path_list._tree.get_node(file_id).data
url_base64 = base64.b64encode(self.disk.get_download_url(file_id).encode()).decode()
url = f'{self._share_link}{Path(path).name}|{file.content_hash}|{url_base64}|{file.size}|root'
print(f'python main.py upload -s "{url}"')
print(f'python aliyunpan.py upload -s "{url}"')

def tui(self):
from aliyunpan.cli.tui import AliyunpanTUI
Expand Down

0 comments on commit 2f383cc

Please sign in to comment.