Raise `TranscriptsDisabled` if 'playerCaptionsTracklistRenderer' is not found (Fixes #136)
This commit is contained in:
		
							parent
							
								
									904acaf153
								
							
						
					
					
						commit
						bd8d8919b2
					
				|  | @ -60,7 +60,9 @@ class TranscriptListFetcher(object): | ||||||
| 
 | 
 | ||||||
|         captions_json = json.loads( |         captions_json = json.loads( | ||||||
|             splitted_html[1].split(',"videoDetails')[0].replace('\n', '') |             splitted_html[1].split(',"videoDetails')[0].replace('\n', '') | ||||||
|         )['playerCaptionsTracklistRenderer'] |         ).get('playerCaptionsTracklistRenderer') | ||||||
|  |         if captions_json is None: | ||||||
|  |             raise TranscriptsDisabled(video_id) | ||||||
| 
 | 
 | ||||||
|         if 'captionTracks' not in captions_json: |         if 'captionTracks' not in captions_json: | ||||||
|             raise NoTranscriptAvailable(video_id) |             raise NoTranscriptAvailable(video_id) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue