mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +03:00
[youtube] fix extraction of caption tracks, close #2866
This commit is contained in:
parent
81d416d1cd
commit
240b7a8111
@ -352,8 +352,11 @@ class YouTube(VideoExtractor):
|
|||||||
for _ in stream['signatureCipher'].split('&')]))
|
for _ in stream['signatureCipher'].split('&')]))
|
||||||
|
|
||||||
# Prepare caption tracks
|
# Prepare caption tracks
|
||||||
|
try:
|
||||||
try:
|
try:
|
||||||
caption_tracks = json.loads(ytplayer_config['args']['player_response'])['captions']['playerCaptionsTracklistRenderer']['captionTracks']
|
caption_tracks = json.loads(ytplayer_config['args']['player_response'])['captions']['playerCaptionsTracklistRenderer']['captionTracks']
|
||||||
|
except:
|
||||||
|
caption_tracks = ytInitialPlayerResponse['captions']['playerCaptionsTracklistRenderer']['captionTracks']
|
||||||
for ct in caption_tracks:
|
for ct in caption_tracks:
|
||||||
ttsurl, lang = ct['baseUrl'], ct['languageCode']
|
ttsurl, lang = ct['baseUrl'], ct['languageCode']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user