Skip to content

Commit

Permalink
Merge pull request #296 from openzim/fix-main-playlist
Browse files Browse the repository at this point in the history
Fix main playlist selection to respect the order of provided playlist IDs
  • Loading branch information
dan-niles authored Aug 20, 2024
2 parents 594680e + e1c24be commit a07f5e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

- Report scraper progress in a JSON file specified with `--stats-filename` (#228)
- Fix main playlist selection to respect the order of provided playlist IDs (#286)

## [3.0.1] - 2024-08-13

Expand Down
3 changes: 2 additions & 1 deletion scraper/src/youtube2zim/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ def extract_playlists_details_from(collection_type, youtube_id):
raise NotImplementedError("unsupported collection_type")

return (
[Playlist.from_id(playlist_id) for playlist_id in list(set(playlist_ids))],
# dict.fromkeys maintains the order of playlist_ids while removing duplicates
[Playlist.from_id(playlist_id) for playlist_id in dict.fromkeys(playlist_ids)],
main_channel_id,
uploads_playlist_id,
)

0 comments on commit a07f5e0

Please sign in to comment.