From 5342d573c2f2345477ebd1859b642546581ebf27 Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 20 Feb 2022 10:45:53 -0700 Subject: [PATCH 1/2] Using yt-dlp's match-filter to skip live videos. --- modules/videos/downloader.py | 6 +++--- wrolpi/downloader.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/videos/downloader.py b/modules/videos/downloader.py index 44eb1f47..57902d25 100755 --- a/modules/videos/downloader.py +++ b/modules/videos/downloader.py @@ -163,6 +163,7 @@ class VideoDownloader(Downloader, ABC): str(YT_DLP_BIN), '-cw', # Continue downloads, do not clobber existing files. '-f', PREFERRED_VIDEO_FORMAT, + '--match-filter', '!is_live', # Do not attempt to download Live videos. '--write-subs', '--write-auto-subs', '--write-thumbnail', @@ -217,9 +218,8 @@ class VideoDownloader(Downloader, ABC): raise ValueError(f'Output directory does not exist! {out_dir=}') # YoutubeDL expects specific options, add onto the default options - config = get_downloader_config().dict() - options = config.copy() - options['outtmpl'] = f'{out_dir}/{config["file_name_format"]}' + options = get_downloader_config().dict() + options['outtmpl'] = f'{out_dir}/{options["file_name_format"]}' options['merge_output_format'] = PREFERRED_VIDEO_EXTENSION # We don't need "format" when getting the filename. del options['format'] diff --git a/wrolpi/downloader.py b/wrolpi/downloader.py index 19f58f45..1d32a472 100644 --- a/wrolpi/downloader.py +++ b/wrolpi/downloader.py @@ -590,7 +590,7 @@ class DownloadManager: return data @optional_session - def get_pending_downloads(self, session: Session): + def get_pending_downloads(self, session: Session) -> List[Download]: return session.query(Download).filter_by(status='pending').all() @optional_session From 79f16e11aea81cc6845765e41045b707f7ea3268 Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 20 Feb 2022 10:46:55 -0700 Subject: [PATCH 2/2] Bumping version. --- wrolpi/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrolpi/version.py b/wrolpi/version.py index e7a1c603..164f8f52 100644 --- a/wrolpi/version.py +++ b/wrolpi/version.py @@ -1,4 +1,4 @@ -__version__ = '0.3.1-beta' +__version__ = '0.3.2-beta' import subprocess