mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-13 05:37:44 +02:00
throw a critical error when youtube api returns a stub
This commit is contained in:
@ -151,9 +151,15 @@ export default async function(host, patternMatch, url, lang, obj) {
|
||||
if (r.isAudioOnly) isAudioOnly = true;
|
||||
let isAudioMuted = isAudioOnly ? false : obj.isAudioMuted;
|
||||
|
||||
if (r.error) return apiJSON(0, {
|
||||
t: Array.isArray(r.error) ? loc(lang, r.error[0], r.error[1]) : loc(lang, r.error)
|
||||
})
|
||||
if (r.error && r.critical)
|
||||
return apiJSON(6, { t: loc(lang, r.error) })
|
||||
|
||||
if (r.error)
|
||||
return apiJSON(0, {
|
||||
t: Array.isArray(r.error)
|
||||
? loc(lang, r.error[0], r.error[1])
|
||||
: loc(lang, r.error)
|
||||
})
|
||||
|
||||
return matchActionDecider(r, host, obj.aFormat, isAudioOnly, lang, isAudioMuted, disableMetadata, obj.filenamePattern)
|
||||
} catch (e) {
|
||||
|
@ -83,6 +83,12 @@ export default async function(o) {
|
||||
youtubeDubName: isDubbed ? o.dubLang : false
|
||||
}
|
||||
|
||||
if (filenameAttributes.title === "Video Not Available" && filenameAttributes.author === "YouTube Viewers")
|
||||
return {
|
||||
error: 'ErrorCantConnectToServiceAPI',
|
||||
critical: true
|
||||
}
|
||||
|
||||
if (hasAudio && o.isAudioOnly) return {
|
||||
type: "render",
|
||||
isAudioOnly: true,
|
||||
|
Reference in New Issue
Block a user