From 57234f64b2286f841fdc6dd02b717345d1b8b3bf Mon Sep 17 00:00:00 2001 From: Fijxu Date: Fri, 11 Oct 2024 13:41:49 -0300 Subject: [PATCH] Update Generate a po_token and visitor_data for inv.nadeko.net --- ...ken-and-visitor_data-for-inv.nadeko.net.md | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Generate-a-po_token-and-visitor_data-for-inv.nadeko.net.md b/Generate-a-po_token-and-visitor_data-for-inv.nadeko.net.md index 88e59cb..7ff1120 100644 --- a/Generate-a-po_token-and-visitor_data-for-inv.nadeko.net.md +++ b/Generate-a-po_token-and-visitor_data-for-inv.nadeko.net.md @@ -2,6 +2,27 @@ # **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!** +# Any OS + +## Firefox and Chrome + +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` + +## Chrome +![](https://culiao.lol/Jjq) + +## Firefox +![](https://culiao.lol/uAK) + +Thanks to the anon who shared the script. https://hastebin.skyra.pw/ivajotorub.js # Linux @@ -20,13 +41,6 @@ ![](https://culiao.lol/sKw) -# Windows - -No idea. I don't use Windows, but if you have python installed just follow the instructions from [Tutorial without Docker](#Tutorial_without_docker) - -# MacOS - -Same, I don't use MacOS, but if you have python installed just follow the instructions from [Tutorial without Docker](#Tutorial_without_docker) ---