mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-18 19:28:29 +00:00
cleanup: fix deepsource warnings
This commit is contained in:
parent
2439be868f
commit
30949eda00
@ -18,7 +18,7 @@ async function video(obj) {
|
|||||||
json = JSON.parse(req);
|
json = JSON.parse(req);
|
||||||
} catch { return { error: 'ErrorEmptyDownload' }; }
|
} catch { return { error: 'ErrorEmptyDownload' }; }
|
||||||
const highestQuality = Object.keys(json.sources)[0];
|
const highestQuality = Object.keys(json.sources)[0];
|
||||||
const video = json.sources[highestQuality][0].src;
|
const videoSrc = json.sources[highestQuality][0].src;
|
||||||
if (!json.sources[highestQuality][0].type.includes('mp4')) {
|
if (!json.sources[highestQuality][0].type.includes('mp4')) {
|
||||||
return { error: 'ErrorCouldntFetch' };
|
return { error: 'ErrorCouldntFetch' };
|
||||||
}
|
}
|
||||||
@ -29,7 +29,7 @@ async function video(obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
urls: video,
|
urls: videoSrc,
|
||||||
filenameAttributes: {
|
filenameAttributes: {
|
||||||
service: "newgrounds",
|
service: "newgrounds",
|
||||||
id: obj.id,
|
id: obj.id,
|
||||||
@ -81,7 +81,7 @@ async function music(obj) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function(obj) {
|
export default function(obj) {
|
||||||
// handle video downloads
|
// handle video downloads
|
||||||
if (obj.type == 'portal') {
|
if (obj.type == 'portal') {
|
||||||
return video(obj);
|
return video(obj);
|
||||||
|
Loading…
Reference in New Issue
Block a user