修复虎牙可能导致进程终止问题(统一写法) (#450)

* 修复抖音可能导致进程卡死问题

* 修复抖音获取串流导致进程卡死(return false版)

* 修复虎牙可能导致进程终止问题

* 统一代码写法
This commit is contained in:
Kataick authored and GitHub committed 2023-06-04 04:57:13 +00:00
1 parent a8657d1f91
commit d4eec0b282
1 file changed
+6 -2
+6 -2
View File
@@ -19,8 +19,12 @@ class Huya(DownloadBase):
def check_stream(self):
logger.debug(self.fname)
res = requests.get(self.url, timeout=5, headers=self.fake_headers)
res.close()
try:
res = requests.get(self.url, timeout=5, headers=self.fake_headers)
except:
return False
finally:
res.close()
huya = None
if match1(res.text, '"stream": "([a-zA-Z0-9+=/]+)"'):
huya = base64.b64decode(match1(res.text, '"stream": "([a-zA-Z0-9+=/]+)"')).decode()