mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 19:28:29 +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 snapchat from "./services/snapchat.js";
|
||||||
import loom from "./services/loom.js";
|
import loom from "./services/loom.js";
|
||||||
import facebook from "./services/facebook.js";
|
import facebook from "./services/facebook.js";
|
||||||
|
import spotify from "./services/spotify.js";
|
||||||
|
import applemusic from "./services/applemusic.js";
|
||||||
|
|
||||||
let freebind;
|
let freebind;
|
||||||
|
|
||||||
@ -206,6 +208,12 @@ export default async function(host, patternMatch, lang, obj) {
|
|||||||
...patternMatch
|
...patternMatch
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "spotify":
|
||||||
|
r = await spotify({});
|
||||||
|
break;
|
||||||
|
case "apple":
|
||||||
|
r = await applemusic({});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return createResponse("error", {
|
return createResponse("error", {
|
||||||
t: loc(lang, 'ErrorUnsupported')
|
t: loc(lang, 'ErrorUnsupported')
|
||||||
|
@ -139,6 +139,8 @@ export default function(r, host, userFormat, isAudioOnly, lang, isAudioMuted, di
|
|||||||
case "streamable":
|
case "streamable":
|
||||||
case "snapchat":
|
case "snapchat":
|
||||||
case "loom":
|
case "loom":
|
||||||
|
case "spotify":
|
||||||
|
case "apple":
|
||||||
responseType = "redirect";
|
responseType = "redirect";
|
||||||
break;
|
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"],
|
"patterns": ["share/:id"],
|
||||||
"enabled": true
|
"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": {
|
"facebook": {
|
||||||
"alias": "facebook videos",
|
"alias": "facebook videos",
|
||||||
"altDomains": ["fb.watch"],
|
"altDomains": ["fb.watch"],
|
||||||
|
@ -64,6 +64,9 @@ export const testers = {
|
|||||||
"youtube": (patternMatch) =>
|
"youtube": (patternMatch) =>
|
||||||
patternMatch.id?.length <= 11,
|
patternMatch.id?.length <= 11,
|
||||||
|
|
||||||
|
"spotify": (patternMatch) => 1,
|
||||||
|
"apple": (patternMatch) => 1,
|
||||||
|
|
||||||
"facebook": (patternMatch) =>
|
"facebook": (patternMatch) =>
|
||||||
patternMatch.shortLink?.length <= 11
|
patternMatch.shortLink?.length <= 11
|
||||||
|| patternMatch.username?.length <= 30
|
|| patternMatch.username?.length <= 30
|
||||||
|
Loading…
Reference in New Issue
Block a user