[audiochan] relax 'pattern'
This commit is contained in:
@@ -103,7 +103,7 @@ class AudiochanExtractor(Extractor):
|
|||||||
|
|
||||||
class AudiochanAudioExtractor(AudiochanExtractor):
|
class AudiochanAudioExtractor(AudiochanExtractor):
|
||||||
subcategory = "audio"
|
subcategory = "audio"
|
||||||
pattern = rf"{BASE_PATTERN}/a/(\w+)"
|
pattern = rf"{BASE_PATTERN}/a/([^/?#]+)"
|
||||||
example = "https://audiochan.com/a/SLUG"
|
example = "https://audiochan.com/a/SLUG"
|
||||||
|
|
||||||
def posts(self):
|
def posts(self):
|
||||||
@@ -114,7 +114,7 @@ class AudiochanAudioExtractor(AudiochanExtractor):
|
|||||||
|
|
||||||
class AudiochanUserExtractor(AudiochanExtractor):
|
class AudiochanUserExtractor(AudiochanExtractor):
|
||||||
subcategory = "user"
|
subcategory = "user"
|
||||||
pattern = rf"{BASE_PATTERN}/u/(\w+)"
|
pattern = rf"{BASE_PATTERN}/u/([^/?#]+)"
|
||||||
example = "https://audiochan.com/u/USER"
|
example = "https://audiochan.com/u/USER"
|
||||||
|
|
||||||
def posts(self):
|
def posts(self):
|
||||||
@@ -130,7 +130,7 @@ class AudiochanUserExtractor(AudiochanExtractor):
|
|||||||
|
|
||||||
class AudiochanCollectionExtractor(AudiochanExtractor):
|
class AudiochanCollectionExtractor(AudiochanExtractor):
|
||||||
subcategory = "collection"
|
subcategory = "collection"
|
||||||
pattern = rf"{BASE_PATTERN}/c/(\w+)"
|
pattern = rf"{BASE_PATTERN}/c/([^/?#]+)"
|
||||||
example = "https://audiochan.com/c/SLUG"
|
example = "https://audiochan.com/c/SLUG"
|
||||||
|
|
||||||
def posts(self):
|
def posts(self):
|
||||||
|
|||||||
@@ -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."
|
"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": {
|
"user": {
|
||||||
"username": "lil_lovergirl",
|
"username": "lil-lovergirl",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"#url" : "https://audiochan.com/u/lil_lovergirl",
|
"#url" : "https://audiochan.com/u/lil-lovergirl",
|
||||||
"#class" : audiochan.AudiochanUserExtractor,
|
"#class" : audiochan.AudiochanUserExtractor,
|
||||||
"#pattern" : r"https://stream\.audiochan\.com/v\?token=\w+\&exp=\d+\&st=.+",
|
"#pattern" : r"https://stream\.audiochan\.com/v\?token=\w+\&exp=\d+\&st=.+",
|
||||||
"#count" : range(35, 50),
|
"#count" : range(35, 50),
|
||||||
|
|
||||||
"user": {
|
"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/Q33gP6yAg8jEM1C4Ic.mp3",
|
||||||
"https://content.audiochan.com/audios/d8b05ea3-e4db-4e64-936b-436b72c895b1/Fwy5YxgK4zc7sQ9xx3.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/P3YrtAdKVekYb3BTgy.mp3",
|
||||||
|
"https://content.audiochan.com/audios/d8b05ea3-e4db-4e64-936b-436b72c895b1/kWYsadsb4XgVh7YPVW.mp3",
|
||||||
),
|
),
|
||||||
|
|
||||||
"collection": {
|
"collection": {
|
||||||
@@ -53,14 +54,14 @@ __tests__ = (
|
|||||||
"title": "💗SFW",
|
"title": "💗SFW",
|
||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"username": "lil_lovergirl",
|
"username": "lil-lovergirl",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"#url" : "https://audiochan.com/search?q=Cozy&sort=trending&timeRange=all",
|
"#url" : "https://audiochan.com/search?q=Cozy&sort=trending&timeRange=all",
|
||||||
"#class" : audiochan.AudiochanSearchExtractor,
|
"#class" : audiochan.AudiochanSearchExtractor,
|
||||||
"#count" : range(25, 40),
|
"#count" : range(15, 40),
|
||||||
|
|
||||||
"search_tags": "Cozy",
|
"search_tags": "Cozy",
|
||||||
"description": list,
|
"description": list,
|
||||||
|
|||||||
Reference in New Issue
Block a user