更改状态图片,更改liveDownloader的连接池,api使用连接池

This commit is contained in:
2019-07-17 09:26:39 +08:00
committed by Jerry Yan
parent 76f280172b
commit 95565c33ec
3 changed files with 11 additions and 10 deletions

View File

@ -15,11 +15,12 @@ isDownload = False
def download():
global isDownload
while Common.api.isLive and not Common.forceNotDownload:
session = requests.session()
if not Common.streamUrl:
Common.appendError("Download with No StreamUrl Specific")
break
path = datetime.strftime(datetime.now(), "%Y%m%d_%H%M.flv")
p = requests.get(Common.streamUrl, stream=True)
p = session.get(Common.streamUrl, stream=True, timeout=10)
if p.status_code != 200:
Common.appendDownloadStatus("Download with Response {}".format(p.status_code))
break