mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
Downloader: rename UrlToJPG to urlToJPG
This commit is contained in:
@ -5,7 +5,7 @@ module.exports.getFolder = (customFolder) =>
|
|||||||
module.exports.defaultMenuDownloadLabel = "Download playlist";
|
module.exports.defaultMenuDownloadLabel = "Download playlist";
|
||||||
|
|
||||||
const orderedQualityList = ["maxresdefault", "hqdefault", "mqdefault", "sdddefault"];
|
const orderedQualityList = ["maxresdefault", "hqdefault", "mqdefault", "sdddefault"];
|
||||||
module.exports.UrlToJPG = (imgUrl, videoId) => {
|
module.exports.urlToJPG = (imgUrl, videoId) => {
|
||||||
if (!imgUrl || imgUrl.includes(".jpg")) return imgUrl;
|
if (!imgUrl || imgUrl.includes(".jpg")) return imgUrl;
|
||||||
//it will almost never get further than hqdefault
|
//it will almost never get further than hqdefault
|
||||||
for (const quality of orderedQualityList) {
|
for (const quality of orderedQualityList) {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ const ytdl = require("ytdl-core");
|
|||||||
|
|
||||||
const { triggerAction, triggerActionSync } = require("../utils");
|
const { triggerAction, triggerActionSync } = require("../utils");
|
||||||
const { ACTIONS, CHANNEL } = require("./actions.js");
|
const { ACTIONS, CHANNEL } = require("./actions.js");
|
||||||
const { getFolder, UrlToJPG } = require("./utils");
|
const { getFolder, urlToJPG } = require("./utils");
|
||||||
const { cleanupArtistName } = require("../../providers/song-info");
|
const { cleanupArtistName } = require("../../providers/song-info");
|
||||||
|
|
||||||
const { createFFmpeg } = FFmpeg;
|
const { createFFmpeg } = FFmpeg;
|
||||||
@ -43,7 +43,7 @@ const downloadVideoToMP3 = async (
|
|||||||
artist: videoDetails?.media?.artist || cleanupArtistName(videoDetails?.author?.name) || "",
|
artist: videoDetails?.media?.artist || cleanupArtistName(videoDetails?.author?.name) || "",
|
||||||
title: videoDetails?.media?.song || videoDetails?.title || "",
|
title: videoDetails?.media?.song || videoDetails?.title || "",
|
||||||
imageSrcYTPL: thumbnails ?
|
imageSrcYTPL: thumbnails ?
|
||||||
UrlToJPG(thumbnails[thumbnails.length - 1].url, videoDetails?.videoId)
|
urlToJPG(thumbnails[thumbnails.length - 1].url, videoDetails?.videoId)
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user