diff --git a/src/provider/youtube-dl.js b/src/provider/youtube-dl.js index d74a25bc4b..4e128f69a0 100644 --- a/src/provider/youtube-dl.js +++ b/src/provider/youtube-dl.js @@ -47,24 +47,18 @@ async function getUrl(args) { } } -const search = async (info) => { - const { id } = await getUrl(dlArguments(byKeyword(info.keyword))); - return id; -}; - -const track = async (id) => { - const { url } = await getUrl(dlArguments(byId(id))); +const track = async (info) => { + const { url } = await getUrl(dlArguments(byKeyword(info.keyword))); return url; }; const cs = getManagedCacheStorage('youtube-dl'); const check = (info) => cs - .cache(info, () => search(info)) - .then(track) + .cache(info, () => track(info)) .catch((e) => { if (e) logger.error(e); throw e; }); -module.exports = { check, track }; +module.exports = { check }; diff --git a/src/provider/yt-dlp.js b/src/provider/yt-dlp.js index 901740b6aa..e573e0f87e 100644 --- a/src/provider/yt-dlp.js +++ b/src/provider/yt-dlp.js @@ -47,24 +47,18 @@ async function getUrl(args) { } } -const search = async (info) => { - const { id } = await getUrl(dlArguments(byKeyword(info.keyword))); - return id; -}; - -const track = async (id) => { - const { url } = await getUrl(dlArguments(byId(id))); +const track = async (info) => { + const { url } = await getUrl(dlArguments(byKeyword(info.keyword))); return url; }; const cs = getManagedCacheStorage('yt-dlp'); const check = (info) => cs - .cache(info, () => search(info)) - .then(track) + .cache(info, () => track(info)) .catch((e) => { if (e) logger.error(e); throw e; }); -module.exports = { check, track }; +module.exports = { check };