mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Downloading video even if the channel cannot be found.
This commit is contained in:
parent
acce338565
commit
bab7082634
1 changed files with 8 additions and 4 deletions
|
|
@ -197,9 +197,13 @@ class VideoDownloader(Downloader, ABC):
|
|||
channel = None
|
||||
if channel_name or source_channel_id:
|
||||
# Try to find the channel via info_json from yt-dlp.
|
||||
channel = get_or_create_channel(source_id=source_channel_id, url=channel_url, name=channel_name)
|
||||
if channel:
|
||||
found_channel = 'yt_dlp'
|
||||
try:
|
||||
channel = get_or_create_channel(source_id=source_channel_id, url=channel_url, name=channel_name)
|
||||
if channel:
|
||||
found_channel = 'yt_dlp'
|
||||
except UnknownChannel:
|
||||
# Can't find a channel, use the no channel directory.
|
||||
pass
|
||||
|
||||
settings = download.settings or dict()
|
||||
local_channel_id = settings.get('channel_id')
|
||||
|
|
@ -392,7 +396,7 @@ def get_or_create_channel(source_id: str = None, url: str = None, name: str = No
|
|||
pass
|
||||
|
||||
if not name:
|
||||
raise ValueError(f'Cannot create channel without a name')
|
||||
raise UnknownChannel(f'Cannot create channel without a name')
|
||||
|
||||
# Channel does not exist. Create one in the video directory.
|
||||
channel_directory = get_videos_directory() / escape_file_name(name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue