Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoOwO committed Mar 19, 2021
1 parent 4fd1dc9 commit 16364b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ def stop(self):
def urlopen(url, retry = 0):
try:
return urllib.request.urlopen(url)
except urllib.error.URLError as e:
if retry < const.HTTP_RETRY:
return urlopen(url, retry + 1)
else:
raise e
except urllib.error.HTTPError as e:
if e.code == 503:
if retry < const.HTTP_RETRY:
Expand All @@ -59,6 +54,11 @@ def urlopen(url, retry = 0):
raise e
else:
raise e
except urllib.error.URLError as e:
if retry < const.HTTP_RETRY:
return urlopen(url, retry + 1)
else:
raise e

def is_live(channel_id):
url = f"https://www.youtube.com/channel/{channel_id}/live"
Expand Down

0 comments on commit 16364b1

Please sign in to comment.