|
|
@ -47,11 +47,17 @@ class Twitch(object):
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
def get_messages(self, user_id, since):
|
|
|
|
def get_messages(self, user_id, since):
|
|
|
|
videos = self._get_videos(user_id)
|
|
|
|
try:
|
|
|
|
result = []
|
|
|
|
videos = self._get_videos(user_id)
|
|
|
|
for video in [v for v in videos if v['date'] >= since]:
|
|
|
|
result = []
|
|
|
|
|
|
|
|
for video in [v for v in videos if v['date'] >= since]:
|
|
|
|
|
|
|
|
if self.log:
|
|
|
|
|
|
|
|
self.log.info('Processing VOD %d (%s)', video['id'], video['title'])
|
|
|
|
|
|
|
|
comments = self._get_comments(video['id'])
|
|
|
|
|
|
|
|
result.extend(comments)
|
|
|
|
|
|
|
|
except requests.exceptions.HTTPError as e:
|
|
|
|
if self.log:
|
|
|
|
if self.log:
|
|
|
|
self.log.info('Processing VOD %d (%s)', video['id'], video['title'])
|
|
|
|
self.log.error('Failed to retrieve VOD messages: %s', str(e))
|
|
|
|
comments = self._get_comments(video['id'])
|
|
|
|
return None
|
|
|
|
result.extend(comments)
|
|
|
|
else:
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|