Spaces:
Sleeping
Sleeping
Update fetchYoutubeSubtitle.py
Browse files- fetchYoutubeSubtitle.py +5 -5
fetchYoutubeSubtitle.py
CHANGED
@@ -44,11 +44,11 @@ def fetchYoutubeSubtitleUrls(video_id):
|
|
44 |
}
|
45 |
|
46 |
response = session.post(SUBTITLE_DOWNLOADER_URL + '/action/extract', json=data, headers=headers)
|
47 |
-
|
48 |
-
|
49 |
-
if
|
50 |
-
logger.error(
|
51 |
-
return {'title': None, 'subtitleList': None, 'error': response.
|
52 |
else:
|
53 |
try:
|
54 |
json = response.json().get('response', {})
|
|
|
44 |
}
|
45 |
|
46 |
response = session.post(SUBTITLE_DOWNLOADER_URL + '/action/extract', json=data, headers=headers)
|
47 |
+
|
48 |
+
|
49 |
+
if response.status_code != 200:
|
50 |
+
logger.error("response.status_code: {}".format(response.status_code))
|
51 |
+
return {'title': None, 'subtitleList': None, 'error': response.reason}
|
52 |
else:
|
53 |
try:
|
54 |
json = response.json().get('response', {})
|