Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error on video with auto-generated subtitles #259

Open
PetrKubes97 opened this issue Feb 25, 2024 · 0 comments
Open

Parse error on video with auto-generated subtitles #259

PetrKubes97 opened this issue Feb 25, 2024 · 0 comments

Comments

@PetrKubes97
Copy link

To Reproduce

Steps to reproduce the behavior:

I am running

transcripts = YouTubeTranscriptApi.list_transcripts(video_url)
transcript = transcripts.find_transcript(language_codes=[desired_language])

if transcript is None:
    return 'no transcript was found', 400

downloaded = transcript.fetch()

Which Python version are you using?

Python 3.9.6

Which version of youtube-transcript-api are you using?

youtube-transcript-api 0.6.2

Expected behavior

Download transcript of the video id 26Ac1VJgd64

Actual behaviour

I get an error

For example: Instead I received the following error message:

    downloaded = transcript.fetch()
  File "/Library/Python/3.9/site-packages/youtube_transcript_api/_transcripts.py", line 292, in fetch
    return _TranscriptParser(preserve_formatting=preserve_formatting).parse(
  File "/Library/Python/3.9/site-packages/youtube_transcript_api/_transcripts.py", line 358, in parse
    for xml_element in ElementTree.fromstring(plain_data)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/xml/etree/ElementTree.py", line 1348, in XML
    return parser.close()
xml.etree.ElementTree.ParseError: no element found: line 1, column 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant