oops: part 2
This commit is contained in:
parent
7472b1732a
commit
5b61e95c1f
2 changed files with 18 additions and 13 deletions
|
@ -59,6 +59,7 @@
|
|||
},
|
||||
"tiktok": {
|
||||
"patterns": [":user/video/:postId", ":id", "t/:id"],
|
||||
"audioFormats": ["best", "m4a", "mp3"],
|
||||
"enabled": true
|
||||
},
|
||||
"douyin": {
|
||||
|
|
|
@ -45,9 +45,24 @@ export default function(r, host, ip, audioFormat, isAudioOnly) {
|
|||
return apiJSON(1, { u: r.urls })
|
||||
}
|
||||
} else {
|
||||
let type = "render"
|
||||
let copy = false
|
||||
if (host == "reddit" && r.typeId == 1 || audioIgnore.includes(host)) return apiJSON(0, { t: r.audioFilename });
|
||||
|
||||
let type = "render";
|
||||
let copy = false;
|
||||
if (!supportedAudio.includes(audioFormat)) audioFormat = "best";
|
||||
|
||||
if ((host == "tiktok" || host == "douyin") && r.isAudio && services.tiktok.audioFormats.includes(audioFormat)) {
|
||||
if (r.isMp3) {
|
||||
if (audioFormat == "mp3" || audioFormat == "best") {
|
||||
audioFormat = "mp3"
|
||||
type = "bridge"
|
||||
}
|
||||
} else if (audioFormat == "best") {
|
||||
audioFormat = "m4a"
|
||||
type = "bridge"
|
||||
}
|
||||
}
|
||||
|
||||
if ((audioFormat == "best" && services[host]["bestAudio"]) || services[host]["bestAudio"] && (audioFormat == services[host]["bestAudio"])) {
|
||||
audioFormat = services[host]["bestAudio"]
|
||||
type = "bridge"
|
||||
|
@ -55,17 +70,6 @@ export default function(r, host, ip, audioFormat, isAudioOnly) {
|
|||
audioFormat = "m4a"
|
||||
copy = true
|
||||
}
|
||||
if ((host == "tiktok" || host == "douyin") && r.isAudio && audioFormat == "best") {
|
||||
if (r.isMp3) {
|
||||
audioFormat = "mp3"
|
||||
type = "bridge"
|
||||
copy = false
|
||||
} else {
|
||||
type = "bridge"
|
||||
copy = false
|
||||
}
|
||||
}
|
||||
if (host == "reddit" && r.typeId == 1 || audioIgnore.includes(host)) return apiJSON(0, { t: r.audioFilename });
|
||||
return apiJSON(2, {
|
||||
type: type,
|
||||
u: Array.isArray(r.urls) ? r.urls[1] : r.urls, service: host, ip: ip,
|
||||
|
|
Loading…
Reference in a new issue