mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-16 10:18:28 +00:00
Resolve cyclic dependency to fix JS-E1008 in DeepSource
This commit is contained in:
parent
c631aeb3d5
commit
834c03a39b
@ -18,45 +18,6 @@ import soundcloud from "./services/soundcloud.js";
|
|||||||
import instagram from "./services/instagram.js";
|
import instagram from "./services/instagram.js";
|
||||||
import vine from "./services/vine.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
|
* @param {PostInfo} obj Post information
|
||||||
*/
|
*/
|
||||||
@ -88,7 +49,6 @@ export default async function (host, patternMatch, url, lang, obj) {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "youtube":
|
case "youtube":
|
||||||
/** @type {YouTubeFetchInfo} */
|
|
||||||
let fetchInfo = {
|
let fetchInfo = {
|
||||||
id: patternMatch["id"].slice(0, 11),
|
id: patternMatch["id"].slice(0, 11),
|
||||||
quality: obj.vQuality,
|
quality: obj.vQuality,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Innertube } from 'youtubei.js';
|
import { Innertube } from 'youtubei.js';
|
||||||
import { maxVideoDuration } from '../../config.js';
|
import { maxVideoDuration } from '../../config.js';
|
||||||
import { YouTubeFetchInfo } from '../match.js';
|
|
||||||
|
|
||||||
const yt = await Innertube.create();
|
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.
|
* Creates a filename to be downloaded for the requested YouTube video.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user