Skip to content

Commit

Permalink
Merge pull request #25 from rachpt/patch-3
Browse files Browse the repository at this point in the history
 修复域名变更链接判断失效
  • Loading branch information
zaxtyson authored Jun 26, 2020
2 parents 78b254a + 5de440e commit 09b6ad6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lanzou/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def is_name_valid(filename: str) -> bool:

def is_file_url(share_url: str) -> bool:
"""判断是否为文件的分享链接"""
base_pat = r'https?://.+?\.lanzous.com/.+'
user_pat = r'https?://.+?\.lanzous.com/i[a-z0-9]{5,}/?' # 普通用户 URL 规则
base_pat = r'https?://.+?\.lanzou[six].com/.+'
user_pat = r'https?://.+?\.lanzou[six].com/i[a-z0-9]{5,}/?' # 普通用户 URL 规则
if not re.fullmatch(base_pat, share_url):
return False
elif re.fullmatch(user_pat, share_url):
Expand All @@ -91,8 +91,8 @@ def is_file_url(share_url: str) -> bool:

def is_folder_url(share_url: str) -> bool:
"""判断是否为文件夹的分享链接"""
base_pat = r'https?://.+?\.lanzous.com/.+'
user_pat = r'https?://.+?\.lanzous.com/b[a-z0-9]{7,}/?'
base_pat = r'https?://.+?\.lanzou[six].com/.+'
user_pat = r'https?://.+?\.lanzou[six].com/b[a-z0-9]{7,}/?'
if not re.fullmatch(base_pat, share_url):
return False
elif re.fullmatch(user_pat, share_url):
Expand Down

0 comments on commit 09b6ad6

Please sign in to comment.