Skip to content

Commit

Permalink
[youtube] fix caption tracks extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
soimort committed Dec 29, 2024
1 parent 51a7eb5 commit f25ddca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/you_get/extractors/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ def prepare(self, **kwargs):
for ct in caption_tracks:
ttsurl, lang = ct['baseUrl'], ct['languageCode']

if ttsurl.startswith('/'):
ttsurl = 'https://www.youtube.com' + ttsurl
tts_xml = parseString(get_content(ttsurl))
transcript = tts_xml.getElementsByTagName('transcript')[0]
texts = transcript.getElementsByTagName('text')
Expand Down

0 comments on commit f25ddca

Please sign in to comment.