[BUGFIX] Handle source_uploader when it is empty (#207)

This commit is contained in:
Jesse Bannon 2022-09-02 00:06:44 -07:00 committed by GitHub
parent 968fa47b0f
commit ffb45f6eb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -134,7 +134,7 @@ class YoutubeChannelDownloader(YoutubeDownloader[YoutubeChannelDownloaderOptions
.. code-block:: yaml
overrides:
source_uploader: # The channel's name
source_uploader: # The channel's name. NOTE: sometimes it's empty, use with caution
source_title: # The channel's name
source_description: # The channel's description
"""
@ -197,7 +197,7 @@ class YoutubeChannelDownloader(YoutubeDownloader[YoutubeChannelDownloaderOptions
self.overrides.add_override_variables(
variables_to_add={
"source_uploader": self.channel.kwargs("uploader"),
"source_uploader": self.channel.kwargs_get("uploader", "__failed_to_scrape__"),
"source_title": self.channel.kwargs("title"),
"source_description": self.channel.kwargs_get("description", ""),
}

View file

@ -73,7 +73,7 @@ class YoutubePlaylistDownloader(
.. code-block:: yaml
overrides:
source_uploader: # The playlist's owner's channel name
source_uploader: # The playlist's owner's channel name. NOTE: sometimes it's empty, use with caution
source_title: # The playlist's title
source_description: # The playlist's description
"""
@ -100,7 +100,7 @@ class YoutubePlaylistDownloader(
self.overrides.add_override_variables(
variables_to_add={
"source_title": playlist["title"],
"source_uploader": playlist["uploader"],
"source_uploader": playlist.get("uploader", "__failed_to_scrape__"),
"source_description": playlist.get("description", ""),
}
)