-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
域名又开始挂了,修改最新域名,并把可替换域名作为属性方便初始化后可自行修改 #68
Conversation
🎉👍 还有 |
了解 |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_all_possible_urls 需要微调下,改成先尝试原始链接,然后再生成其他备选的域名的链接。
主要作用是,极个别中间用到的中转文件链接只有在原始的链接的域名中有效,其他域名中会提示 分享已取消 ,比如下面这个地方的url
LanZouCloud-API/lanzou/api/core.py
Line 527 in 779da62
download_page = self._get(fake_url, allow_redirects=False) |
修改后的参考代码
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
No description provided.