The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
fix(youtube): 没勾选封面时不再下载封面
XiaoYouChReadf83890115
diff --git a/features/yt_dlp_pack/task.py b/features/yt_dlp_pack/task.pyindex b49b1d1c..c45eda37 100644--- a/features/yt_dlp_pack/task.py+++ b/features/yt_dlp_pack/task.py@@ -820,5 +820,5 @@ class YouTubeCoverStep(HttpTaskStep):return str(self.task.toSidePath(None, "jpg"))async def run(self, reportSpeed, waitForSpeedLimit) -> None:- if self.url:+ if self.url and self.task.isCoverEnabled:await super().run(reportSpeed, waitForSpeedLimit)diff --git a/tests/yt_dlp_pack/test_task.py b/tests/yt_dlp_pack/test_task.pynew file mode 100644index 00000000..b5ae075b--- /dev/null+++ b/tests/yt_dlp_pack/test_task.py@@ -0,0 +1,19 @@+from __future__ import annotations++from tests.helpers import buildFileContent, buildRangeHandler+++async def test_run_without_cover_saves_no_cover_file(tmp_path, startServer):+ from yt_dlp_pack.task import YouTubeCoverStep, YouTubeTask++ url = await startServer(buildRangeHandler(buildFileContent(8)))+ task = YouTubeTask(name="片.mp4", url="https://www.youtube.com/watch?v=x", outputFolder=tmp_path)+ task.setCoverUrl(url)+ cover = next(s for s in task.steps if isinstance(s, YouTubeCoverStep))++ async def waitForSpeedLimit():+ pass++ await cover.run(lambda n: None, waitForSpeedLimit)++ assert not list(tmp_path.glob("*.jpg"))