diff --git a/Engine/kernel.py b/Engine/kernel.py index 00a538f..6a5345b 100644 --- a/Engine/kernel.py +++ b/Engine/kernel.py @@ -26,8 +26,11 @@ class CheckAll(object): res = batch.check() if res: live += res - except requests.exceptions.ConnectionError: - logger.exception(batch.__class__.__module__) + except requests.exceptions.SSLError as sslerr: + logger.info(batch.__class__.__module__+',requests.exceptions.SSLError:'+str(sslerr)) + except requests.exceptions.ConnectionError as connerr: + # logger.exception(batch.__class__.__module__) + logger.info(batch.__class__.__module__ + ',requests.exceptions.SSLError:' + str(connerr)) # except: # logger.exception() diff --git a/Engine/plugins/__init__.py b/Engine/plugins/__init__.py index 4f1c625..53658b7 100644 --- a/Engine/plugins/__init__.py +++ b/Engine/plugins/__init__.py @@ -19,12 +19,12 @@ class Download(object): @property def file_name(self): now = Engine.work.time_now() - if self.suffix == 'mp4': - file_name = '%s%s%s.mp4' % (self.fname, now, str(time.time())[:10]) - elif self.suffix == 'flv': - file_name = '%s%s%s.flv' % (self.fname, now, str(time.time())[:10]) - else: - raise ValueError + # if self.suffix == 'mp4': + file_name = '%s%s%s.%s' % (self.fname, now, str(time.time())[:10], self.suffix) + # elif self.suffix == 'flv': + # file_name = '%s%s%s.flv' % (self.fname, now, str(time.time())[:10]) + # else: + # raise ValueError return file_name def check_stream(self): @@ -97,6 +97,7 @@ class Download(object): self.run(event) finally: logger.info('退出下载') + return class BatchCheckBase(object): diff --git a/Engine/plugins/panda.py b/Engine/plugins/panda.py index 892e35d..dfb2992 100644 --- a/Engine/plugins/panda.py +++ b/Engine/plugins/panda.py @@ -35,6 +35,7 @@ class BatchCheck(BatchCheckBase): return url = API_ROOMS + ','.join(self.usr_list) res = requests.get(url) + res.close() for i in res.json()['data']: if type(i) == str: status = res.json()['data'][i]['stream_status'] @@ -52,7 +53,7 @@ class BatchCheck(BatchCheckBase): live.append(i['id']) else: print('err') - res.close() + return map(lambda x: self.usr_dict.get(x.lower()), live) diff --git a/config.yaml b/config.yaml index acfabca..87f8a24 100644 --- a/config.yaml +++ b/config.yaml @@ -13,7 +13,7 @@ links_id: - https://www.panda.tv/1150595 星际2sOs狗哥神族天梯第一视角: - https://www.panda.tv/1160930 - - https://www.twitch.tv/zx2362 + - https://www.twitch.tv/jinairsos1 星际2Stats拔本神族天梯第一视角: - https://www.twitch.tv/kimdaeyeob3 星际2Dark暗本虫族天梯第一视角: @@ -36,6 +36,8 @@ links_id: - https://www.twitch.tv/partingthebigboy 星际2Rogue脑虫虫族天梯第一视角: - https://www.twitch.tv/roguejinair + 星际2Classic经典神皇神族第一视角: + - https://www.twitch.tv/kimclassic # test: # - https://www.twitch.tv/roguejinair # - https://www.panda.tv/2068335