Handle video URLs containing account name

fixes #162
This commit is contained in:
Ivan Habunek 2024-08-30 07:55:01 +02:00
parent f57612ffcc
commit ff4a514b8a
No known key found for this signature in database
GPG Key ID: 01DB3DD0D824504C
2 changed files with 2 additions and 0 deletions

View File

@ -7,6 +7,7 @@ TEST_VIDEO_PATTERNS = [
("702689313", "https://twitch.tv/videos/702689313"), ("702689313", "https://twitch.tv/videos/702689313"),
("702689313", "https://www.twitch.tv/videos/702689313"), ("702689313", "https://www.twitch.tv/videos/702689313"),
("702689313", "https://m.twitch.tv/videos/702689313"), ("702689313", "https://m.twitch.tv/videos/702689313"),
("2223719525", "https://www.twitch.tv/r0dn3y/video/2223719525"),
] ]
TEST_CLIP_PATTERNS = { TEST_CLIP_PATTERNS = {

View File

@ -85,6 +85,7 @@ def titlify(value: str) -> str:
VIDEO_PATTERNS = [ VIDEO_PATTERNS = [
r"^(?P<id>\d+)?$", r"^(?P<id>\d+)?$",
r"^https://(www\.|m\.)?twitch\.tv/videos/(?P<id>\d+)(\?.+)?$", r"^https://(www\.|m\.)?twitch\.tv/videos/(?P<id>\d+)(\?.+)?$",
r"^https://(www\.|m\.)?twitch\.tv/\w+/video/(?P<id>\d+)(\?.+)?$",
] ]
CLIP_PATTERNS = [ CLIP_PATTERNS = [