Fix queuefile extension selection when NoSuchChannel.

This commit is contained in:
voussoir 2020-08-12 10:26:57 -07:00
parent 5f38dea3b3
commit 7a7b1455ef

View file

@ -257,13 +257,14 @@ class YCDLDBVideoMixin:
try: try:
channel = self.get_channel(video.author_id) channel = self.get_channel(video.author_id)
download_directory = channel.download_directory or self.config['download_directory'] download_directory = channel.download_directory or self.config['download_directory']
extension = channel.queuefile_extension or self.config['queuefile_extension']
except exceptions.NoSuchChannel: except exceptions.NoSuchChannel:
download_directory = self.config['download_directory'] download_directory = self.config['download_directory']
extension = self.config['queuefile_extension']
download_directory = pathclass.Path(download_directory) download_directory = pathclass.Path(download_directory)
os.makedirs(download_directory.absolute_path, exist_ok=True) os.makedirs(download_directory.absolute_path, exist_ok=True)
extension = channel.queuefile_extension or self.config['queuefile_extension']
queuefile = download_directory.with_child(video_id).replace_extension(extension) queuefile = download_directory.with_child(video_id).replace_extension(extension)
open(queuefile.absolute_path, 'a').close() open(queuefile.absolute_path, 'a').close()