iv-org/youtube-trusted-session-generator

[Question] Questions about youtube-trusted-session-generator

Closed this issue · 4 comments

Is your enhancement request related to a problem? Please describe.
Issue #4947

Describe the solution you'd like
You have added documentation on how to enable usage of the web client with session keys to Invidious installation instructions. Your solution works well, however, the documentation could use an improvement. For example, there's no mention that youtube-trusted-session-generator session generator tool requires a working X server and Chromium/Chrome browser installed. And no workarounds are provided for running the tool headlessly.

Since the session generator tool requires no user interaction, there's a simple workaround which would enable the session generator to run on headless systems:
install and run an Xvfb server (I run it as a systemd service, but simple shell backgrounding will work too) and set the DISPLAY variable to it's display before running the session generator tool.

One more thing would be useful is to know approximately how often does one need to rotate the session keys.
I wrote an automated tool for my own internal use but not sure how often I should run it.

Headless doesn't work: #2

Since the session generator tool requires no user interaction, there's a simple workaround which would enable the session generator to run on headless systems:
install and run an Xvfb server (I run it as a systemd service, but simple shell backgrounding will work too) and set the DISPLAY variable to it's display before running the session generator tool.

That's what the Docker version do: https://github.com/iv-org/youtube-trusted-session-generator/blob/master/docker/scripts/startup.sh


One more thing would be useful is to know approximately how often does one need to rotate the session keys.
I wrote an automated tool for my own internal use but not sure how often I should run it.

We don't know either, theoretically it should be valid for long time. So if you are rotating it just do it like every hour. That's why we said:

There is currently no official automatic tool to periodically change these tokens. This is working in progress but, for the time being, this is the solution the Invidious team is offering.
If you want to be less traceable, you can always script the process by changing the identities every X hour.

Taken from https://docs.invidious.io/installation/#docker

image

Thanks. Sorry, didn't notice the tool had a Dockerfile.

I said nothing about using Chromium headless mode, didn't even consider using it.
Even though using Xvfb technically isn't "headless", I consider running this tool using Xvfb to be headless as Xvfb is a purely virtual/dummy X server with no output, perfect for running GUI applications where no manual interaction is required.
Since you have a dedicated section in your documentation on how to setup Invidious without Docker, documenting a way to do run this tool on a headless server without Docker would still be useful.

As for token rotation, I will setup my tool to run once a day, hopefully that will be enough.
Rotating every hour seems a bit overkill to me, considering there's no way to update the tokens without restating the Invidious service.

Thanks. Sorry, didn't notice the tool had a Dockerfile.

I said nothing about using Chromium headless mode, didn't even consider using it. Even though using Xvfb technically isn't "headless", I consider running this tool using Xvfb to be headless as Xvfb is a purely virtual/dummy X server with no output, perfect for running GUI applications where no manual interaction is required. Since you have a dedicated section in your documentation on how to setup Invidious without Docker, documenting a way to do run this tool on a headless server without Docker would still be useful.

As for token rotation, I will setup my tool to run once a day, hopefully that will be enough. Rotating every hour seems a bit overkill to me, considering there's no way to update the tokens without restating the Invidious service.

Hello, YouTube trusted session generator has been added to the Invidious-Updater

Runs headless without Docker.

./invidious_update.sh -iytsg

Thanks @tmiland for your work on Invidious Updater.
I'll keep using Xvfb to be safe, not sure if using "headless=true" won't trip antibot.

It would be good to have some kind of integration for these key updates to avoid the need to restart the server on every key rotation.
PR #6 adds a HTTP API which could in theory be integrated with Invidious, just like the signature helper. Not sure why it isn't merged yet.