mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-29 01:48:28 +00:00
youtube: return different error message if video doesn't exist
This commit is contained in:
parent
44ecfeeea7
commit
b7697268e5
@ -62,8 +62,12 @@ export default async function(o) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
info = await yt.getBasicInfo(o.id, 'WEB');
|
info = await yt.getBasicInfo(o.id, 'WEB');
|
||||||
} catch {
|
} catch(e) {
|
||||||
return { error: 'ErrorCantConnectToServiceAPI' };
|
if (e?.message === 'This video is unavailable') {
|
||||||
|
return { error: 'ErrorCouldntFetch' };
|
||||||
|
} else {
|
||||||
|
return { error: 'ErrorCantConnectToServiceAPI' };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!info) return { error: 'ErrorCantConnectToServiceAPI' };
|
if (!info) return { error: 'ErrorCantConnectToServiceAPI' };
|
||||||
|
Loading…
Reference in New Issue
Block a user