Skip to content

Commit

Permalink
deneme 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ensargx committed Apr 7, 2024
1 parent b492d86 commit b1d8399
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,24 @@ def do_POST(self):
assert 'id' in video

# get refresh token from code
refresh_token = GetRefreshTokenFromCode(code)
DownloadVideos(refresh_token, videos)

print("Getting refresh token...")
try:
refresh_token = GetRefreshTokenFromCode(code)
except Exception as e:
print("Error getting refresh token:", e)
self.send_response(500)
self.end_headers()
return

print("Downloading videos...")
try:
DownloadVideos(refresh_token, videos)
except Exception as e:
print("Error downloading videos:", e)
self.send_response(500)
self.end_headers()
return

exit(0)

Expand Down

0 comments on commit b1d8399

Please sign in to comment.