[audiochan] relax 'pattern'

This commit is contained in:
Mike Fährmann
2025-12-12 09:21:44 +01:00
parent 739e940a95
commit 05817c523f
2 changed files with 9 additions and 8 deletions

View File

@@ -103,7 +103,7 @@ class AudiochanExtractor(Extractor):
class AudiochanAudioExtractor(AudiochanExtractor):
subcategory = "audio"
pattern = rf"{BASE_PATTERN}/a/(\w+)"
pattern = rf"{BASE_PATTERN}/a/([^/?#]+)"
example = "https://audiochan.com/a/SLUG"
def posts(self):
@@ -114,7 +114,7 @@ class AudiochanAudioExtractor(AudiochanExtractor):
class AudiochanUserExtractor(AudiochanExtractor):
subcategory = "user"
pattern = rf"{BASE_PATTERN}/u/(\w+)"
pattern = rf"{BASE_PATTERN}/u/([^/?#]+)"
example = "https://audiochan.com/u/USER"
def posts(self):
@@ -130,7 +130,7 @@ class AudiochanUserExtractor(AudiochanExtractor):
class AudiochanCollectionExtractor(AudiochanExtractor):
subcategory = "collection"
pattern = rf"{BASE_PATTERN}/c/(\w+)"
pattern = rf"{BASE_PATTERN}/c/([^/?#]+)"
example = "https://audiochan.com/c/SLUG"
def posts(self):

View File

@@ -19,18 +19,18 @@ __tests__ = (
"You wake up in the middle of the night, noticing that your boyfriend is still awake and restlessly moving around. Work-related worries are making him anxious and keeping him from falling asleep so you do your best to take care of him, calm him down, and help him get some rest."
],
"user": {
"username": "lil_lovergirl",
"username": "lil-lovergirl",
},
},
{
"#url" : "https://audiochan.com/u/lil_lovergirl",
"#url" : "https://audiochan.com/u/lil-lovergirl",
"#class" : audiochan.AudiochanUserExtractor,
"#pattern" : r"https://stream\.audiochan\.com/v\?token=\w+\&exp=\d+\&st=.+",
"#count" : range(35, 50),
"user": {
"username": "lil_lovergirl",
"username": "lil-lovergirl",
},
},
@@ -45,6 +45,7 @@ __tests__ = (
"https://content.audiochan.com/audios/d8b05ea3-e4db-4e64-936b-436b72c895b1/Q33gP6yAg8jEM1C4Ic.mp3",
"https://content.audiochan.com/audios/d8b05ea3-e4db-4e64-936b-436b72c895b1/Fwy5YxgK4zc7sQ9xx3.mp3",
"https://content.audiochan.com/audios/d8b05ea3-e4db-4e64-936b-436b72c895b1/P3YrtAdKVekYb3BTgy.mp3",
"https://content.audiochan.com/audios/d8b05ea3-e4db-4e64-936b-436b72c895b1/kWYsadsb4XgVh7YPVW.mp3",
),
"collection": {
@@ -53,14 +54,14 @@ __tests__ = (
"title": "💗SFW",
},
"user": {
"username": "lil_lovergirl",
"username": "lil-lovergirl",
},
},
{
"#url" : "https://audiochan.com/search?q=Cozy&sort=trending&timeRange=all",
"#class" : audiochan.AudiochanSearchExtractor,
"#count" : range(25, 40),
"#count" : range(15, 40),
"search_tags": "Cozy",
"description": list,