use playlist_index instead

This commit is contained in:
jbannon 2022-08-07 05:29:49 +00:00
parent 8c01c473cc
commit 1858c751e7
2 changed files with 4 additions and 4 deletions

View file

@ -150,9 +150,9 @@ class YoutubeChannelDownloader(YoutubeDownloader[YoutubeChannelDownloaderOptions
url=self.download_options.channel_url,
)
self.channel = self._get_channel(entry_dicts=entry_dicts)
channel_videos = self._filter_entry_dicts(entry_dicts, sort_by="upload_date")
channel_videos = self._filter_entry_dicts(entry_dicts, sort_by="playlist_index")
# Iterate in reverse to process older videos first. In case an error occurs and a
# Iterate in descending order to process older videos first. In case an error occurs and a
# the channel must be redownloaded, it will fetch most recent metadata first, and break
# on the older video that's been processed and is in the download archive.
for idx, entry_dict in enumerate(reversed(channel_videos), start=1):

View file

@ -78,11 +78,11 @@ class YoutubePlaylistDownloader(
log_prefix_on_info_json_dl="Downloading metadata for",
url=self.download_options.playlist_url,
)
playlist_videos = self._filter_entry_dicts(entry_dicts, sort_by="upload_date")
# Iterate in reverse to process older videos first. In case an error occurs and a
# Iterate in reverse order to process older videos first. In case an error occurs and a
# the playlist must be redownloaded, it will fetch most recent metadata first, and break
# on the older video that's been processed and is in the download archive.
playlist_videos = self._filter_entry_dicts(entry_dicts, sort_by="playlist_index")
for idx, entry_dict in enumerate(reversed(playlist_videos), start=1):
video = YoutubePlaylistVideo(
entry_dict=entry_dict, working_directory=self.working_directory