This commit is contained in:
NicoBeh 2026-07-05 17:06:51 +01:00 committed by GitHub
commit 812a31643a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 3 deletions

View File

@ -114,7 +114,9 @@ class Parser:
item_type = "video"
elif len_id_str == 24:
item_type = "channel"
elif len_id_str in (34, 26, 18) or id_str.startswith("TA_playlist_"):
elif len_id_str in (34, 26, 18, 13) or id_str.startswith(
"TA_playlist_"
):
item_type = "playlist"
else:
raise ValueError(f"not a valid id_str: {id_str}")

View File

@ -77,15 +77,28 @@ CHANNEL_VID_TYPES = [
PLAYLIST_URL_IN = [
"PL96C35uN7xGJu6skU4TBYrIWxggkZBrF5",
"https://www.youtube.com/playlist?list=PL96C35uN7xGJu6skU4TBYrIWxggkZBrF5",
"https://www.youtube.com/playlist?list=PLE6-bhDW8GWg",
]
PLAYLIST_OUT = [
{
"type": "playlist",
"url": "PL96C35uN7xGJu6skU4TBYrIWxggkZBrF5",
"vid_type": "unknown",
}
},
{
"type": "playlist",
"url": "PL96C35uN7xGJu6skU4TBYrIWxggkZBrF5",
"vid_type": "unknown",
},
{
"type": "playlist",
"url": "PLE6-bhDW8GWg",
"vid_type": "unknown",
},
]
PLAYLIST_TEST_CASES = [
(i, [PLAYLIST_OUT[idx]]) for idx, i in enumerate(PLAYLIST_URL_IN)
]
PLAYLIST_TEST_CASES = [(i, PLAYLIST_OUT) for i in PLAYLIST_URL_IN]
# personal playlists
EXPECTED_WL = [{"type": "playlist", "url": "WL", "vid_type": "unknown"}]