From c00a9c3597692d0f3a9fc719ab64036529056911 Mon Sep 17 00:00:00 2001 From: Alex Grant Date: Wed, 24 Apr 2024 20:24:20 -0400 Subject: [PATCH] Add support for m dot urls --- changelog.yaml | 5 +++++ twitchdl/utils.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/changelog.yaml b/changelog.yaml index 49196fb..a240ca6 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -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: date: 2024-04-24 changes: diff --git a/twitchdl/utils.py b/twitchdl/utils.py index 9c37e4d..b10e040 100644 --- a/twitchdl/utils.py +++ b/twitchdl/utils.py @@ -84,13 +84,13 @@ def titlify(value: str) -> str: VIDEO_PATTERNS = [ r"^(?P\d+)?$", - r"^https://(www.)?twitch.tv/videos/(?P\d+)(\?.+)?$", + r"^https://(www\.|m\.)?twitch\.tv/videos/(?P\d+)(\?.+)?$", ] CLIP_PATTERNS = [ r"^(?P[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)$", - r"^https://(www.)?twitch.tv/\w+/clip/(?P[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)(\?.+)?$", - r"^https://clips.twitch.tv/(?P[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)(\?.+)?$", + r"^https://(www\.|m\.)?twitch\.tv/\w+/clip/(?P[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)(\?.+)?$", + r"^https://clips\.twitch\.tv/(?P[A-Za-z0-9]+(?:-[A-Za-z0-9_-]{16})?)(\?.+)?$", ]