Skip to content

Fix broken YT scraping with YT API #4005

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bobbercheng
Copy link

Pull Request Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ”¨ chore
  • πŸ“ docs

Relevant Issues

resolves #4004

What is in this change?

Use Youtube API https://www.youtube.com/youtubei/v1/get_transcript to get transcript instead of https://www.youtube.com/ptracking from youtube scripts. For unknown reason, https://www.youtube.com/ptracking returns empty content for xml transcript and causes current yt scraping fails.

Additional Information

As Youtube API has rate limit, scraping may fails after reaching api limit. For long term solution, it's better to offload ty scraping to npm package youtubei like https://github.com/LuanRT/YouTube.js/blob/main/examples/transcript/index.ts.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

Copy link

@LIHUA919 LIHUA919 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR:needs review Needs review by core team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Youtube transcript doesn't work
3 participants