Resolve cyclic dependency to fix JS-E1008 in DeepSource

This commit is contained in:
fluofoxxo 2023-05-08 01:09:23 -04:00
parent c631aeb3d5
commit 834c03a39b
2 changed files with 39 additions and 41 deletions

View File

@ -18,45 +18,6 @@ import soundcloud from "./services/soundcloud.js";
import instagram from "./services/instagram.js";
import vine from "./services/vine.js";
export class YouTubeFetchInfo {
/**
* ID of the YouTube video.
*
* @type {string}
*/
id
/**
* Quality of the YouTube video.
*
* @type {string}
*/
quality
/**
* Format of the YouTube video to be downloaded.
*
* @type {string}
*/
format
/**
* Whether only the audio of the YouTube video should be gotten.
*
* @type {boolean}
*/
isAudioOnly
/**
* Whether audio of the YouTube video should be muted.
*
* @type {boolean}
*/
isAudioMuted
/**
* Dub language to use for the video.
*
* @type {boolean | string}
*/
dubLang
}
/**
* @param {PostInfo} obj Post information
*/
@ -88,7 +49,6 @@ export default async function (host, patternMatch, url, lang, obj) {
});
break;
case "youtube":
/** @type {YouTubeFetchInfo} */
let fetchInfo = {
id: patternMatch["id"].slice(0, 11),
quality: obj.vQuality,

View File

@ -1,6 +1,5 @@
import { Innertube } from 'youtubei.js';
import { maxVideoDuration } from '../../config.js';
import { YouTubeFetchInfo } from '../match.js';
const yt = await Innertube.create();
@ -22,6 +21,45 @@ const c = {
}
}
export class YouTubeFetchInfo {
/**
* ID of the YouTube video.
*
* @type {string}
*/
id
/**
* Quality of the YouTube video.
*
* @type {string}
*/
quality
/**
* Format of the YouTube video to be downloaded.
*
* @type {string}
*/
format
/**
* Whether only the audio of the YouTube video should be gotten.
*
* @type {boolean}
*/
isAudioOnly
/**
* Whether audio of the YouTube video should be muted.
*
* @type {boolean}
*/
isAudioMuted
/**
* Dub language to use for the video.
*
* @type {boolean | string}
*/
dubLang
}
/**
* Creates a filename to be downloaded for the requested YouTube video.
*