Skip to content

在huggingface官网试用时,报如下错误 #589

@dong13235

Description

@dong13235

DO NOT DELETE THIS! Please take the time to fill this out properly. I am not able to help you if I do not know what you are executing and what error messages you are getting. If you are having problems with a specific video make sure to include the video id.

To Reproduce

Steps to reproduce the behavior:

What code / cli command are you executing?

For example: I am running

YouTubeTranscriptApi().fetch() ...

Which Python version are you using?

Python x.y

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

youtube-transcript-api x.y.z

Expected behavior

Describe what you expected to happen.

For example: I expected to receive the english transcript

Actual behaviour

Describe what is happening instead of the Expected behavior. Add error messages if there are any.

For example: Instead I received the following error message:

# ... error message ...

TranscriptsDisabled: Could not retrieve a transcript for the video https://www.youtube.com/watch?v=iruyNY5T5Mo?si=3x6uhCn7vfTrgp3V! This is most likely caused by: Subtitles are disabled for this video If you are sure that the described cause is not responsible for this error and that a transcript should be retrievable, please create an issue at https://github.com/jdepoix/youtube-transcript-api/issues. Please add which version of youtube_transcript_api you are using and provide the information needed to replicate the error. Also make sure that there are no open issues which already describe your problem!
Traceback:
File "/home/user/.local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
exec(code, module.dict)
File "/home/user/app/app.py", line 87, in
summary = summarize_video(video_url)
File "/home/user/app/app.py", line 21, in summarize_video
transcript = YouTubeTranscriptApi.get_transcript(video_id)
File "/home/user/.local/lib/python3.10/site-packages/youtube_transcript_api/_api.py", line 137, in get_transcript
return cls.list_transcripts(video_id, proxies, cookies).find_transcript(languages).fetch(preserve_formatting=preserve_formatting)
File "/home/user/.local/lib/python3.10/site-packages/youtube_transcript_api/_api.py", line 71, in list_transcripts
return TranscriptListFetcher(http_client).fetch(video_id)
File "/home/user/.local/lib/python3.10/site-packages/youtube_transcript_api/_transcripts.py", line 48, in fetch
self._extract_captions_json(self._fetch_video_html(video_id), video_id),
File "/home/user/.local/lib/python3.10/site-packages/youtube_transcript_api/_transcripts.py", line 62, in _extract_captions_json
raise TranscriptsDisabled(video_id)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions