mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-17 21:18:47 +03:00
Add back youtube api error handling
This commit is contained in:
@@ -27,6 +27,7 @@ export class YouTubeAPI {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const { ytErr, data } = await new Promise((resolve) => _youTubeAPI.videos.list({
|
||||
part,
|
||||
id: videoID,
|
||||
@@ -50,5 +51,8 @@ export class YouTubeAPI {
|
||||
} else {
|
||||
return { err: ytErr, data };
|
||||
}
|
||||
} catch (err) {
|
||||
return {err, data: null}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user