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

Add YouTube PO token & IP rotation #1772

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MichailiK
Copy link
Collaborator

@MichailiK MichailiK commented Nov 25, 2024

This pull request...

  • Fixes a bug
  • Introduces a new feature
  • Improves an existing feature
  • Boosts code quality or performance

Description

  • Adds config options to provide a PO token & visitor data. Omitting these makes it obvious to YouTube you're a bot & can easily lead to an IP ban.
  • Adds IP(v6) rotation in the hopes of reducing chances of getting IP bans.

Unfortunately the setup for both are fairly complicated. I'm hoping that obtaining a PO token bit can be automated (thus this being a draft PR). IPv6 rotation is even more complicated & hosting-dependent, so this is probably reserved for power users.

Purpose

Allows for (semi-)reliable YouTube playback again

Relevant Issue(s)

Somewhat fixes #1588

Somewhat fixes #1682

TODO

  • Document or automate PO token retrieval.
    • Lavalink's youtube-source README suggests to run the youtube-trusted-session-generator python script/docker image to generate these.
    • Alternatively, yt-dlp's wiki has a guide on manually retrieving PO tokens
      • In step 6, instead of exporting cookies, I believe you can extract the visitor id in the player request at context.client.visitorData, im not sure if its the identical though i have to yet double check.
      • In step 7, instead of using yt-dlp you put the PO token & visitor data in the config.txt, of course
  • Document IPv6 rotation.
  • Some cleanup & fixing inconsistencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant