Merge pull request #356 from qvalentin/beatbumpSearch

Add redirect of youtubeMusic search query to beatbump
This commit is contained in:
ManeraKai 2022-06-22 16:59:31 +00:00 committed by GitHub
commit 1b2444faf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -65,6 +65,11 @@ https://music.youtube.com/playlist?list=OLAK5uy_nBOTxAc3_RGB82-Z54jdARGxGaCYlpng
https://beatbump.ml/release?id=MPREb_QygdC0wEoLe
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) {
if (disableYoutubeMusic) return;
@ -76,7 +81,8 @@ function redirect(url) {
return `${randomInstance}${url.pathname}${url.search}`
.replace("/watch?v=", "/listen?id=")
.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() {