From 1858c751e790d21cd161b37c1e84038912ddc777 Mon Sep 17 00:00:00 2001 From: jbannon Date: Sun, 7 Aug 2022 05:29:49 +0000 Subject: [PATCH] use playlist_index instead --- src/ytdl_sub/downloaders/youtube/channel.py | 4 ++-- src/ytdl_sub/downloaders/youtube/playlist.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ytdl_sub/downloaders/youtube/channel.py b/src/ytdl_sub/downloaders/youtube/channel.py index 62ded376..f132393b 100644 --- a/src/ytdl_sub/downloaders/youtube/channel.py +++ b/src/ytdl_sub/downloaders/youtube/channel.py @@ -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): diff --git a/src/ytdl_sub/downloaders/youtube/playlist.py b/src/ytdl_sub/downloaders/youtube/playlist.py index dfe25865..514d2ab2 100644 --- a/src/ytdl_sub/downloaders/youtube/playlist.py +++ b/src/ytdl_sub/downloaders/youtube/playlist.py @@ -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