mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 03:08:30 +00:00
add apple music and spotify support
This commit is contained in:
parent
afa33c4043
commit
d6d0832e19
@ -27,6 +27,8 @@ import dailymotion from "./services/dailymotion.js";
|
||||
import snapchat from "./services/snapchat.js";
|
||||
import loom from "./services/loom.js";
|
||||
import facebook from "./services/facebook.js";
|
||||
import spotify from "./services/spotify.js";
|
||||
import applemusic from "./services/applemusic.js";
|
||||
|
||||
let freebind;
|
||||
|
||||
@ -206,6 +208,12 @@ export default async function(host, patternMatch, lang, obj) {
|
||||
...patternMatch
|
||||
});
|
||||
break;
|
||||
case "spotify":
|
||||
r = await spotify({});
|
||||
break;
|
||||
case "apple":
|
||||
r = await applemusic({});
|
||||
break;
|
||||
default:
|
||||
return createResponse("error", {
|
||||
t: loc(lang, 'ErrorUnsupported')
|
||||
|
@ -139,6 +139,8 @@ export default function(r, host, userFormat, isAudioOnly, lang, isAudioMuted, di
|
||||
case "streamable":
|
||||
case "snapchat":
|
||||
case "loom":
|
||||
case "spotify":
|
||||
case "apple":
|
||||
responseType = "redirect";
|
||||
break;
|
||||
}
|
||||
|
5
src/modules/processing/services/applemusic.js
Normal file
5
src/modules/processing/services/applemusic.js
Normal file
@ -0,0 +1,5 @@
|
||||
export default async function({}) {
|
||||
return {
|
||||
urls: "https://http.cat/451"
|
||||
}
|
||||
}
|
5
src/modules/processing/services/spotify.js
Normal file
5
src/modules/processing/services/spotify.js
Normal file
@ -0,0 +1,5 @@
|
||||
export default async function({}) {
|
||||
return {
|
||||
urls: "https://http.cat/451"
|
||||
}
|
||||
}
|
@ -125,6 +125,18 @@
|
||||
"patterns": ["share/:id"],
|
||||
"enabled": true
|
||||
},
|
||||
"spotify": {
|
||||
"alias": "spotify music",
|
||||
"patterns": ["album/:id", "track/:id", "embed/track/:id"],
|
||||
"subdomains": ["open"],
|
||||
"enabled": true
|
||||
},
|
||||
"apple": {
|
||||
"alias": "apple music",
|
||||
"patterns": [":country/album/:albumname/:id"],
|
||||
"subdomains": ["music"],
|
||||
"enabled": true
|
||||
},
|
||||
"facebook": {
|
||||
"alias": "facebook videos",
|
||||
"altDomains": ["fb.watch"],
|
||||
|
@ -64,6 +64,9 @@ export const testers = {
|
||||
"youtube": (patternMatch) =>
|
||||
patternMatch.id?.length <= 11,
|
||||
|
||||
"spotify": (patternMatch) => 1,
|
||||
"apple": (patternMatch) => 1,
|
||||
|
||||
"facebook": (patternMatch) =>
|
||||
patternMatch.shortLink?.length <= 11
|
||||
|| patternMatch.username?.length <= 30
|
||||
|
Loading…
Reference in New Issue
Block a user