Delete page "Generate-a-po_token-and-visitor_data-for-inv.nadeko.net"

Fijxu 2024-12-14 19:38:06 -03:00
parent 2caf5ab03e
commit f48e8e8a33

@ -1,82 +0,0 @@
# **2024-10-24: Seems like video playback doesn't work too well now (Maybe google is changing things again). If you get an error, try generating new tokens, then open another video (not from the popular page) on the same backend and video playback should work well. If that doesn't work either, just remove the tokens from your account leaving `preferences_po_token` and `preferences_visitor_data` blank without any characters.**
# **2024-10-25: User tokens and generation has been disabled for now because of the message above. I'm Just testing things now :p**
# **NOTE: THIS IS A WORKAROUND ONLY FOR MY INSTANCE, DO NOT REPORT ANY ISSUES TO https://github.com/iv-org/invidious/issues IF THIS DOESN'T WORK FOR YOU!**
### **My instance is already able to play videos without you having to do this, but I still recommend you to do this. Why? Because if you use your own tokens, the probabilities of getting blocked are very low and you will be helping to prevent the instance from being blocked.**
Note: **"These identity tokens (po_token and visitor_data) generated using this tool will make your entire YouTube session more easily traceable by YouTube because it is tied to a unique identifier."**
*From: https://github.com/iv-org/youtube-trusted-session-generator?tab=readme-ov-file#whats-po_token*
However, if you want want to use my instance a lot, I really recommend you to do this because the chances of getting blocked are very low. The method below generates the 2 tokens 100% server side, your IP and other unique identifiers (like the browser fingerprint) are not passed to google servers at all.
It's under your choice :*
# Right inside Invidious
**THIS DOESN'T RUN ANY GOOGLE JAVASCRIPT ON YOUR BROWSER, EVERYTHING IS SERVER SIDE**
1. go to https://inv.nadeko.net/preferences
2. CLICK THERE ->>>> ![](https://culiao.lol/57M)
2. Wait...
3. Done.
(If you get an error, try on another backend, if none of the backends work, then make an issue)
>Why you didn't add the server side generator for people without accounts?
When I was about to finish this feature I noticed that I did the change only for users with accounts. I may fix it later because I'm tired.
![](https://culiao.lol/dq7)
Hello google, fuck you google :*
![](https://cdn.7tv.app/emote/65e1742b943edad569639579/4x.avif)
# Any OS
## Firefox and Chrome (or any other Chromium based browser, Chrome is bullshit, don't use it)
1. Open incognito tab
2. Create a bookmark with this url:
```
javascript:(function()%7Bconst%20overwriteMethod%20%3D%20(Class%2C%20name%2C%20callback)%20%3D%3E%20%7B%0A%20%20const%20orig%20%3D%20Class.prototype%5Bname%5D%3B%0A%20%20Class.prototype%5Bname%5D%20%3D%20function(...args)%20%7B%0A%20%20%20%20return%20callback(this%2Corig.bind(this)%2C...args)%3B%0A%20%20%7D%3B%0A%7D%0Aconst%20xhr_to_open_params%20%3D%20new%20WeakMap()%3B%0AoverwriteMethod(XMLHttpRequest%2C%22open%22%2C(self%2Corig%2Cmethod%2Curl%2Casync%2Cuser%2Cpassword)%3D%3E%7B%0A%20%20xhr_to_open_params.set(self%2C%7Bmethod%2Curl%2Casync%2Cuser%2Cpassword%7D)%3B%0A%20%20return%20orig(method%2Curl%2Casync%2Cuser%2Cpassword)%3B%0A%7D)%3B%0AoverwriteMethod(XMLHttpRequest%2C%22send%22%2C(self%2Corig%2Cbody)%3D%3E%7B%0A%20%20try%20%7B%0A%20%20%20%20const%20params%20%3D%20xhr_to_open_params.get(self)%3B%0A%20%20%20%20const%20data%20%3D%20JSON.parse(body)%3B%0A%20%20%20%20const%20url%20%3D%20new%20URL(params.url%2Clocation.href)%3B%0A%20%20%20%20console.log(params%2Cdata)%3B%0A%20%20%20%20if(%2F%5E%5C%2Fyoutubei%5C%2Fv1%5C%2Fplayer%2F.test(url.pathname))%20%7B%0A%20%20%20%20%20%20const%20visitor_data%20%3D%20data.context.client.visitorData%3B%0A%20%20%20%20%20%20const%20po_token%20%3D%20data.serviceIntegrityDimensions.poToken%3B%0A%20%20%20%20%20%20console.log(%7Bvisitor_data%2Cpo_token%7D)%3B%0A%20%20%20%20%20%20prompt(%22visitor_data%22%2Cvisitor_data)%3B%0A%20%20%20%20%20%20prompt(%22po_token%22%2Cpo_token)%3B%0A%20%20%20%20%7D%0A%20%20%7D%20catch(e)%20%7B%0A%20%20%20%20console.error(e)%3B%0A%20%20%7D%0A%20%20return%20orig(body)%3B%0A%7D)%3B%7D)()%3B
```
3. Open https://www.youtube.com/embed/jNQXAC9IVRw
4. Click the bookmark that you created
5. Click the button to play the video
6. There you go, you got a `po_token` and a `visitor_data`, put them in https://inv.nadeko.net/preferences
## Chrome Bookmarks
![](https://culiao.lol/Jjq)
## Firefox Bookmarks
![](https://culiao.lol/uAK)
Thanks to the anon who shared the script.
# Linux
## Tutorial without Docker
1. Install Chromium or Google Chrome.
2. Clone `https://github.com/iv-org/youtube-trusted-session-generator` and open a terminal on it
2. Create a new virtualenv: `virtualenv venv`
3. Activate the virtualenv: `source venv/bin/activate`
4. Install the dependencies: `pip install -r requirements.txt`
5. Run the script: `python index.py`
6. Copy paste the values of these the two parameters (`po_token` and `visitor_data`) in https://inv.nadeko.net/preferences
## Tutorial with Docker
1. Run the script: `docker run quay.io/invidious/youtube-trusted-session-generator`
2. Copy paste the values of these the two parameters (`po_token` and `visitor_data`) in https://inv.nadeko.net/preferences
![](https://culiao.lol/sKw)
---
If you don't want to do any of this, you can use FreeTube with Local API, otherwise, we just have to wait until Invidious maintainers to find solution.