Add support for m dot urls

This commit is contained in:
Alex Grant 2024-04-24 20:24:20 -04:00 committed by Ivan Habunek
parent 0f17d92a8c
commit c00a9c3597
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2.2.4:
date: 2024-04-24
changes:
- "Add m dot url support to video and clip regexes"
2.2.3: 2.2.3:
date: 2024-04-24 date: 2024-04-24
changes: changes:

View File

@ -84,13 +84,13 @@ def titlify(value: str) -> str:
VIDEO_PATTERNS = [ VIDEO_PATTERNS = [
r"^(?P<id>\d+)?$", r"^(?P<id>\d+)?$",
r"^https://(www.)?twitch.tv/videos/(?P<id>\d+)(\?.+)?$", r"^https://(www\.|m\.)?twitch\.tv/videos/(?P<id>\d+)(\?.+)?$",
] ]
CLIP_PATTERNS = [ CLIP_PATTERNS = [
r"^(?P<slug>[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)$", r"^(?P<slug>[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)$",
r"^https://(www.)?twitch.tv/\w+/clip/(?P<slug>[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)(\?.+)?$", r"^https://(www\.|m\.)?twitch\.tv/\w+/clip/(?P<slug>[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)(\?.+)?$",
r"^https://clips.twitch.tv/(?P<slug>[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)(\?.+)?$", r"^https://clips\.twitch\.tv/(?P<slug>[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)(\?.+)?$",
] ]