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

YouTube Transcript API no longer works #184

Closed
chand1012 opened this issue Feb 16, 2023 · 2 comments
Closed

YouTube Transcript API no longer works #184

chand1012 opened this issue Feb 16, 2023 · 2 comments

Comments

@chand1012
Copy link

chand1012 commented Feb 16, 2023

To Reproduce

Steps to reproduce the behavior:

  1. Attempt to download any video transcript.
    image

Which Python version are you using?

3.10.10 on M1 Mac

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

0.5.0

What code / cli command are you executing?

youtube_transcript_api https://www.youtube.com/watch\?v\=-f906Sy79hA and

from youtube_transcript_api import YouTubeTranscriptApi

data = { 'url': 'https://www.youtube.com/watch\?v\=-f906Sy79hA' }
resp = YouTubeTranscriptApi.get_transcript(data['url'].split("=")[-1])

Expected behavior

List of dictionaries response of the API.

Actual behaviour

Could not retrieve a transcript for the video https://www.youtube.com/watch?v=https://www.youtube.com/watch?v=-f906Sy79hA! 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:/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!

Additional information

Youtube-DL seems to have also broken, and the issue seems to vary by region. I will update if the issues goes away.

@chand1012
Copy link
Author

This line seems to be the problem.

splitted_html = html.split('"captions":')

I stored the raw HTML as a file for this video and then tried to manually search for the string "captions": in the html and found nothing. I hope that there is a way around this, but for now I hope this information helps someone fix the issue.

@chand1012
Copy link
Author

chand1012 commented Feb 17, 2023

Okay, this seems to have been user error. I was accidentally inputting the entire video URL rather than just the ID to the video. Sorry for the inconvenience!

For example, this will not work.

python -m youtube_transcript_api https://www.youtube.com/watch\?v\=fE2sunDZhzg

But this will:

python -m youtube_transcript_api fE2sunDZhzg

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