This commit is contained in:
wukko
2022-12-07 01:21:07 +06:00
parent 098a63638b
commit f13a82e152
25 changed files with 389 additions and 321 deletions

View File

@@ -1,6 +1,8 @@
import { apiJSON } from "../sub/utils.js";
import { errorUnsupported, genericError } from "../sub/errors.js";
import loc from "../../localization/manager.js";
import { testers } from "./servicesPatternTesters.js";
import bilibili from "../services/bilibili.js";
@@ -105,7 +107,9 @@ export default async function (host, patternMatch, url, lang, obj) {
default:
return apiJSON(0, { t: errorUnsupported(lang) });
}
return matchActionDecider(r, host, obj.ip, obj.aFormat, obj.isAudioOnly)
return !r.error ? matchActionDecider(r, host, obj.ip, obj.aFormat, obj.isAudioOnly, lang) : apiJSON(0, {
t: Array.isArray(r.error) ? loc(lang, r.error[0], r.error[1]) : loc(lang, r.error)
});
} catch (e) {
return apiJSON(0, { t: genericError(lang, host) })
}