[philomena] improve tag escapes handling (fixes #1629)
This commit is contained in:
@@ -107,11 +107,11 @@ class PhilomenaPostExtractor(PhilomenaExtractor):
|
|||||||
"source_url": "https://www.deviantart.com/speccysy/art"
|
"source_url": "https://www.deviantart.com/speccysy/art"
|
||||||
"/Afternoon-Flight-215193985",
|
"/Afternoon-Flight-215193985",
|
||||||
"spoilered": False,
|
"spoilered": False,
|
||||||
"tag_count": 37,
|
"tag_count": 38,
|
||||||
"tag_ids": list,
|
"tag_ids": list,
|
||||||
"tags": list,
|
"tags": list,
|
||||||
"thumbnails_generated": True,
|
"thumbnails_generated": True,
|
||||||
"updated_at": "2021-04-07T06:01:30Z",
|
"updated_at": "2021-05-28T17:39:38Z",
|
||||||
"uploader": "Clover the Clever",
|
"uploader": "Clover the Clever",
|
||||||
"uploader_id": 211188,
|
"uploader_id": 211188,
|
||||||
"upvotes": int,
|
"upvotes": int,
|
||||||
@@ -149,6 +149,10 @@ class PhilomenaSearchExtractor(PhilomenaExtractor):
|
|||||||
"range": "40-60",
|
"range": "40-60",
|
||||||
"count": 21,
|
"count": 21,
|
||||||
}),
|
}),
|
||||||
|
(("https://derpibooru.org/tags/"
|
||||||
|
"artist-colon--dash-_-fwslash--fwslash-%255Bkorroki%255D_aternak"), {
|
||||||
|
"count": ">= 2",
|
||||||
|
}),
|
||||||
("https://ponybooru.org/search?q=cute", {
|
("https://ponybooru.org/search?q=cute", {
|
||||||
"range": "40-60",
|
"range": "40-60",
|
||||||
"count": 21,
|
"count": 21,
|
||||||
@@ -159,7 +163,18 @@ class PhilomenaSearchExtractor(PhilomenaExtractor):
|
|||||||
PhilomenaExtractor.__init__(self, match)
|
PhilomenaExtractor.__init__(self, match)
|
||||||
groups = match.groups()
|
groups = match.groups()
|
||||||
if groups[-1]:
|
if groups[-1]:
|
||||||
self.params = {"q": groups[-1]}
|
q = groups[-1]
|
||||||
|
for old, new in (
|
||||||
|
("-colon-" , ":"),
|
||||||
|
("-dash-" , "-"),
|
||||||
|
("-dot-" , "."),
|
||||||
|
("-plus-" , "+"),
|
||||||
|
("-fwslash-", "/"),
|
||||||
|
("-bwslash-", "\\"),
|
||||||
|
):
|
||||||
|
if old in q:
|
||||||
|
q = q.replace(old, new)
|
||||||
|
self.params = {"q": text.unquote(text.unquote(q))}
|
||||||
else:
|
else:
|
||||||
self.params = text.parse_query(groups[-2])
|
self.params = text.parse_query(groups[-2])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user