Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function knownProvider(url) {
return extract(url).catch((err) => {
return Promise.reject(new common.errors.InternalServerError({
message: err.message
}));
});
}
function knownProvider(url) {
return extract(url).catch((err) => {
return Promise.reject(new common.errors.InternalServerError({
message: err.message
}));
});
}
function knownProvider(url) {
return extract(url).catch((err) => {
return Promise.reject(new common.errors.InternalServerError({
message: err.message
}));
});
}
function knownProvider(url) {
return extract(url).catch((err) => {
return Promise.reject(new common.errors.InternalServerError({
message: err.message
}));
});
}
return new Promise((resolve, reject) => {
const vid = getYtid(url);
if (!vid) {
throw new Error('No video ID found');
}
url = `https://www.youtube.com/watch?v=${vid}`;
return extract(url).then((data) => {
return {
vid,
title: data.title,
canonicals: [
url,
`https://youtu.be/${vid}`,
`https://www.youtube.com/v/${vid}`,
`https://www.youtube.com/embed/${vid}`,
],
content: ``,
author: data.author_name,
source: data.provider_name,
image: data.thumbnail_url,
};
}).then((art) => {
return getDuration(art.vid).then((duration) => {