Skip to content

Commit

Permalink
[sites:reddit] Improved VideoNotFound error message
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed Jul 23, 2021
1 parent cd0949e commit 36b704b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chat_downloader/sites/reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ def get_chat_by_post_id(self, post_id, params, attempt_number=0, initial_info=No
if is_live and socket_url: # live stream

if not socket_url.startswith('wss://') or 'wss.redditmedia.com' not in socket_url:
self.retry(attempt_number, text='Invalid websocket URL: {}'.format(socket_url), **params)
self.retry(attempt_number, text='Invalid websocket URL: {}'.format(
socket_url), **params)
return self.get_chat_by_post_id(post_id, params, attempt_number + 1)


chat_item.chat = self._get_chat_messages_by_socket(
socket_url, params)

Expand All @@ -399,7 +399,7 @@ def get_chat_by_post_id(self, post_id, params, attempt_number=0, initial_info=No
raise RedditError(data)

elif status == 'video not found':
raise VideoNotFound(status_message)
raise VideoNotFound('Video not found')

else: # Unknown
raise UnexpectedError('Info: {}'.format(initial_info))
Expand Down

0 comments on commit 36b704b

Please sign in to comment.