Respect --dry-run when downloading videos

This commit is contained in:
Ivan Habunek 2024-04-24 08:56:24 +02:00
parent 2422871d70
commit 69b848d341
No known key found for this signature in database
GPG Key ID: F5F0623FF5EBCB3D

View File

@ -273,6 +273,10 @@ def _download_video(video_id: str, args: DownloadOptions) -> None:
vods_m3u8 = load_m3u8(vods_text)
vods = enumerate_vods(vods_m3u8, start, end)
if args.dry_run:
click.echo("Dry run, video not downloaded.")
return
base_uri = re.sub("/[^/]+$", "/", playlist.url)
target_dir = _crete_temp_dir(base_uri)