Merge pull request #34 from TNTcraftHIM/master

添加自动多次尝试切换代理功能
This commit is contained in:
Pentacene 2020-08-28 00:05:34 +08:00 committed by GitHub
commit bec607f767
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -282,10 +282,10 @@
}, },
{ {
"name": "neteasemusic", "name": "neteasemusic",
"version": "1.6", "version": "1.7",
"section": "daily", "section": "daily",
"maintainer": "TNTcraftHIM", "maintainer": "TNTcraftHIM",
"size": "22.2 kb", "size": "22.5 kb",
"supported": true, "supported": true,
"des-short": "网易云点歌", "des-short": "网易云点歌",
"des": "可以在线搜索并且快速点歌歌曲信息齐全支持直接回复点歌。命令nem。" "des": "可以在线搜索并且快速点歌歌曲信息齐全支持直接回复点歌。命令nem。"

View File

@ -311,6 +311,10 @@ async def nem(context):
with open(file, 'wb') as fp: with open(file, 'wb') as fp:
fp.write(content) fp.write(content)
for __ in range(6): #最多尝试6次 for __ in range(6): #最多尝试6次
if proxynum > (len(proxy) -1): #代理自动切换至下一个
proxynum = 0
proxies = proxy[proxynum]
proxynum += 1
try: try:
WangyiyunDownload().download() WangyiyunDownload().download()
ccimported = True ccimported = True