Merge pull request #356 from qvalentin/beatbumpSearch
Add redirect of youtubeMusic search query to beatbump
This commit is contained in:
commit
1b2444faf3
|
@ -65,6 +65,11 @@ https://music.youtube.com/playlist?list=OLAK5uy_nBOTxAc3_RGB82-Z54jdARGxGaCYlpng
|
||||||
https://beatbump.ml/release?id=MPREb_QygdC0wEoLe
|
https://beatbump.ml/release?id=MPREb_QygdC0wEoLe
|
||||||
|
|
||||||
https://music.youtube.com/watch?v=R6gSMSYKhKU&list=OLAK5uy_n-9HVh3cryV2gREZM9Sc0JwEKYjjfi0dU
|
https://music.youtube.com/watch?v=R6gSMSYKhKU&list=OLAK5uy_n-9HVh3cryV2gREZM9Sc0JwEKYjjfi0dU
|
||||||
|
|
||||||
|
Search
|
||||||
|
https://music.youtube.com/search?q=test
|
||||||
|
https://beatbump.ml/search/test?filter=EgWKAQIIAWoKEAMQBBAKEAkQBQ%3D%3D
|
||||||
|
|
||||||
*/
|
*/
|
||||||
function redirect(url) {
|
function redirect(url) {
|
||||||
if (disableYoutubeMusic) return;
|
if (disableYoutubeMusic) return;
|
||||||
|
@ -76,7 +81,8 @@ function redirect(url) {
|
||||||
return `${randomInstance}${url.pathname}${url.search}`
|
return `${randomInstance}${url.pathname}${url.search}`
|
||||||
.replace("/watch?v=", "/listen?id=")
|
.replace("/watch?v=", "/listen?id=")
|
||||||
.replace("/channel/", "/artist/")
|
.replace("/channel/", "/artist/")
|
||||||
.replace("/playlist?list=", "/playlist/VL");
|
.replace("/playlist?list=", "/playlist/VL")
|
||||||
|
.replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=EgWKAQIIAWoKEAMQBBAKEAkQBQ%3D%3D");
|
||||||
}
|
}
|
||||||
|
|
||||||
async function initDefaults() {
|
async function initDefaults() {
|
||||||
|
|
Loading…
Reference in New Issue