Skip to content

best way to save what you love

youtube: return different error message if video doesn't exist

dumbmoronb7697268e50c
diff --git a/src/modules/processing/services/youtube.js b/src/modules/processing/services/youtube.js
index c97d8c24..fae4e04d 100644
--- a/src/modules/processing/services/youtube.js
+++ b/src/modules/processing/services/youtube.js
@@ -62,8 +62,12 @@ export default async function(o) {
try {
info = await yt.getBasicInfo(o.id, 'WEB');
- } catch {
- return { error: 'ErrorCantConnectToServiceAPI' };
+ } catch(e) {
+ if (e?.message === 'This video is unavailable') {
+ return { error: 'ErrorCouldntFetch' };
+ } else {
+ return { error: 'ErrorCantConnectToServiceAPI' };
+ }
}
if (!info) return { error: 'ErrorCantConnectToServiceAPI' };