-
-
Save uhwot/8250904f3e4bfbad684c5ec26943e082 to your computer and use it in GitHub Desktop.
| // ==UserScript== | |
| // @name qobuz auth token login | |
| // @namespace io.github.uhwot.qbztoken | |
| // @match https://play.qobuz.com/* | |
| // @grant none | |
| // @version 1.0 | |
| // @author uh wot | |
| // @description allows logging in via auth tokens on qobuz | |
| // @homepageURL https://gist.github.com/uhwot/8250904f3e4bfbad684c5ec26943e082 | |
| // @downloadURL https://gist.github.com/uhwot/8250904f3e4bfbad684c5ec26943e082/raw/qbztoken.user.js | |
| // @icon https://play.qobuz.com/resources/favicon/favicon-96x96.png | |
| // @run-at document-start | |
| // ==/UserScript== | |
| function waitForElm(selector) { | |
| return new Promise(resolve => { | |
| if (document.querySelector(selector)) { | |
| return resolve(document.querySelector(selector)); | |
| } | |
| const observer = new MutationObserver(mutations => { | |
| if (document.querySelector(selector)) { | |
| resolve(document.querySelector(selector)); | |
| observer.disconnect(); | |
| } | |
| }); | |
| observer.observe(document.body, { | |
| childList: true, | |
| subtree: true | |
| }); | |
| }); | |
| } | |
| function ass() { | |
| if (window.location.pathname === "/login") { | |
| waitForElm("div.LoginPage__content").then((_) => { | |
| const element = document.querySelector("div.LoginPage__content") | |
| const div = document.createElement("div") | |
| div.setAttribute("style", "width: 100%") | |
| const p = document.createElement("p") | |
| p.innerText = "Token:" | |
| p.setAttribute("style", "color: #FFFFFF") | |
| div.appendChild(p) | |
| const input = document.createElement("input") | |
| input.setAttribute("class", "SearchBar__input") | |
| input.setAttribute("type", "password") | |
| input.setAttribute("style", "padding: 0px 10px 0px 10px; width: 100%") | |
| input.addEventListener("keypress", function(event) { | |
| if (event.key === "Enter") { | |
| event.preventDefault() | |
| localStorage.setItem("shitass", input.value) | |
| window.location = "https://play.qobuz.com/featured?code_autorisation=!shitass!" | |
| } | |
| }) | |
| div.appendChild(input) | |
| element.appendChild(div) | |
| }) | |
| } | |
| } | |
| const token = localStorage.getItem("shitass") | |
| if (window.location == "https://play.qobuz.com/featured?code_autorisation=!shitass!" && token !== null) { | |
| localStorage.removeItem("shitass") | |
| window.fetch = (function (fetch) { | |
| return async function (url, init) { | |
| if (url.startsWith("https://www.qobuz.com/api.json/0.2/oauth/callback?code=!shitass!")) { | |
| window.fetch = fetch | |
| return new Response(JSON.stringify({ | |
| token: token, | |
| user_id: "1" | |
| })) | |
| } | |
| return await fetch(url, init) | |
| } | |
| })(window.fetch); | |
| } | |
| window.addEventListener('load', function() { | |
| ass() | |
| const replaceState = window.history.replaceState | |
| Object.defineProperty(window.history, 'replaceState', { | |
| get(_) {return function() { | |
| replaceState.apply(window.history, arguments) | |
| ass() | |
| }}, | |
| set(_) {}, | |
| }); | |
| const pushState = window.history.pushState | |
| Object.defineProperty(window.history, 'pushState', { | |
| get(_) {return function() { | |
| pushState.apply(window.history, arguments) | |
| ass() | |
| }}, | |
| set(_) {}, | |
| }); | |
| }, false) |
@uhwot im not using VPN or anything gives me this
Its happening probably because the token you're using was not generated for the current x-app-id header the new web version is using and this extension does not changes that header
Is there anyway we can use play.qobuz.com? Does someone find any fix?
Is there anyway we can use play.qobuz.com? Does someone find any fix?
My workaround for now is using burp or httptoolkit (requires pro version) to intercept the requests and change the x-app-id header to the version the token is for, the easiest way is to get a token that it works with the new header
Is there anyway we can use play.qobuz.com? Does someone find any fix?
My workaround for now is using burp or httptoolkit (requires pro version) to intercept the requests and change the
x-app-idheader to the version the token is for, the easiest way is to get a token that it works with the new header
I totally understand the concept behind it. Kind of a long stretch personally. But hope someone make an extension, like the above one. May be I'll get my hands on it soon. If you come across any simple solution. Please post it here. I totally loved playing songs in hi res using web player more than downloading them. Thanks for the reply bro :)))
Guys, i've added streamurl function to streamrip, and added listen feature to my MediaHarbor project. you guys may want to check it.
https://github.com/mediaharbor/mediaharbor

@uhwot im not using VPN or anything gives me this
