lanbogao commited on
Commit
7cbd2ac
1 Parent(s): 3482a30

Update fetchYoutubeSubtitle.py

Browse files
Files changed (1) hide show
  1. 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
- logger.error("req headers: {}".format(headers))
48
- logger.error("req reaponse: {}".format(response))
49
- if not response.status_code != 200:
50
- logger.error(headers)
51
- return {'title': None, 'subtitleList': None, 'error': response.statusText}
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', {})