diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-06-03 03:20:44 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-06-03 03:20:44 -0700 |
commit | ccb795e31f2f9944b1c8b061906eb752009f8ea7 (patch) | |
tree | 9bc7ef7d42915b58dc0333efffcc7943b9ab4b00 | |
parent | 1807bfac4952c23dd4031007b44026e920951336 (diff) | |
download | yt-local-ccb795e31f2f9944b1c8b061906eb752009f8ea7.tar.lz yt-local-ccb795e31f2f9944b1c8b061906eb752009f8ea7.tar.xz yt-local-ccb795e31f2f9944b1c8b061906eb752009f8ea7.zip |
Ensure videos in subscriptions from same channel in order
-rw-r--r-- | youtube/subscriptions.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube/subscriptions.py b/youtube/subscriptions.py index a7b94bc..dc8412b 100644 --- a/youtube/subscriptions.py +++ b/youtube/subscriptions.py @@ -130,11 +130,11 @@ def _get_upstream_videos(channel_id): videos = [] json_channel_videos = channel.get_grid_items(channel.get_channel_tab(channel_id)[1]['response']) - for json_video in json_channel_videos: + for i, json_video in enumerate(json_channel_videos): info = yt_data_extract.renderer_info(json_video['gridVideoRenderer']) if 'description' not in info: info['description'] = '' - info['time_published'] = youtube_timestamp_to_posix(info['published']) + info['time_published'] = youtube_timestamp_to_posix(info['published']) - i # subtract a few seconds off the videos so they will be in the right order videos.append(info) return videos |