域名又开始挂了,修改最新域名,并把可替换域名作为属性方便初始化后可自行修改#68
Closed
wxh0402 wants to merge 5 commits intozaxtyson:masterfrom
wxh0402:master
Closed
域名又开始挂了,修改最新域名,并把可替换域名作为属性方便初始化后可自行修改#68wxh0402 wants to merge 5 commits intozaxtyson:masterfrom wxh0402:master
wxh0402 wants to merge 5 commits intozaxtyson:masterfrom
wxh0402:master
Conversation
|
🎉👍 还有 |
Owner
|
了解 |
fzls
reviewed
Dec 17, 2021
Comment on lines
+102
to
+105
| def _all_possible_urls(self, url: str) -> List[str]: | ||
| """蓝奏云的主域名有时会挂掉, 此时尝试切换到备用域名""" | ||
| available_domains = [ | ||
| 'lanzoui.com', # 鲁ICP备15001327号-6, 2020-06-09, SEO 排名最低 | ||
| 'lanzoux.com', # 鲁ICP备15001327号-5, 2020-06-09 | ||
| 'lanzous.com' # 主域名, 备案异常, 部分地区已经无法访问 | ||
| return [ | ||
| re.sub(r'lanzou\w\.com', d, url) for d in self.available_domains |
Contributor
There was a problem hiding this comment.
_all_possible_urls 需要微调下,改成先尝试原始链接,然后再生成其他备选的域名的链接。
主要作用是,极个别中间用到的中转文件链接只有在原始的链接的域名中有效,其他域名中会提示 分享已取消 ,比如下面这个地方的url
LanZouCloud-API/lanzou/api/core.py
Line 527 in 779da62
修改后的参考代码
def _all_possible_urls(self, url: str) -> List[str]:
# 先把原始链接放到第一个
urls = [url]
# 然后再尝试其他的
for d in self.available_domains:
new_url = re.sub(r'lanzou\w\.com', d, url)
if new_url not in urls:
urls.append(new_url)
return urls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.