mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 19:36:20 -05:00
Don't process channel downloads.
This commit is contained in:
parent
25e638ed10
commit
8f62cb895f
1 changed files with 3 additions and 3 deletions
|
|
@ -43,9 +43,9 @@ PREFERRED_VIDEO_EXTENSION = 'mp4'
|
|||
PREFERRED_VIDEO_FORMAT = 'best[height=720],22,720p,mp4-480p,mp4-360p,mp4-240p,18,bestvideo+bestaudio'
|
||||
|
||||
|
||||
def extract_info(url: str, ydl: YoutubeDL = YDL) -> dict:
|
||||
def extract_info(url: str, ydl: YoutubeDL = YDL, process=False) -> dict:
|
||||
"""Get info about a video. Separated for testing."""
|
||||
return ydl.extract_info(url, download=False, process=True)
|
||||
return ydl.extract_info(url, download=False, process=process)
|
||||
|
||||
|
||||
def prepare_filename(entry: dict, ydl: YoutubeDL = YDL) -> str:
|
||||
|
|
@ -264,7 +264,7 @@ class VideoDownloader(Downloader, ABC):
|
|||
ydl.add_default_info_extractors()
|
||||
|
||||
# Get the path where the video will be saved.
|
||||
entry = extract_info(url, ydl=ydl)
|
||||
entry = extract_info(url, ydl=ydl, process=True)
|
||||
final_filename = pathlib.Path(prepare_filename(entry, ydl=ydl)).absolute()
|
||||
if final_filename.suffix.lower() != f'.{PREFERRED_VIDEO_EXTENSION}':
|
||||
raise DownloadError(f'Cannot download video {url} because yt-dlp filename is invalid.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue