fix
This commit is contained in:
1 parent
6005b0d97d
commit
fa4800bb73
4 files changed
+17
-10
No files matched your search
+5
-2
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
+3
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user