mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Using yt-dlp's match-filter to skip live videos.
This commit is contained in:
parent
595a82cce9
commit
5342d573c2
2 changed files with 4 additions and 4 deletions
|
|
@ -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']
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue