mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
[booru] unquote tags to fix multiple tags in urls
This commit is contained in:
parent
f2c68a5753
commit
2a7dbd8868
4
config
4
config
@ -21,5 +21,5 @@ regex0 = (?:https?://)?(?:www\.)?imgbox\.com(/.*)
|
|||||||
regex0 = (?:https?://)?(?:www\.)?imagebam\.com/(gallery|image)/([^/]+).*
|
regex0 = (?:https?://)?(?:www\.)?imagebam\.com/(gallery|image)/([^/]+).*
|
||||||
|
|
||||||
[e621]
|
[e621]
|
||||||
regex0 = (?:https?://)?(?:www\.)?e621\.net/post/index/\d+/(\w+)
|
regex0 = (?:https?://)?(?:www\.)?e621\.net/post/index/\d+/([^?]+)
|
||||||
regex1 = e(?:621)?[.:-_](\w.+)
|
regex1 = e(?:621)?[.:-_](\w.+)
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
from .common import AsyncExtractor
|
from .common import AsyncExtractor
|
||||||
from ..util import filename_from_url
|
from ..util import filename_from_url
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
class BooruExtractor(AsyncExtractor):
|
class BooruExtractor(AsyncExtractor):
|
||||||
|
|
||||||
def __init__(self, match, config):
|
def __init__(self, match, config):
|
||||||
AsyncExtractor.__init__(self, config)
|
AsyncExtractor.__init__(self, config)
|
||||||
self.tags = match.group(1)
|
self.tags = urllib.parse.unquote(match.group(1))
|
||||||
self.category = "booru"
|
self.category = "booru"
|
||||||
self.params = {"tags": self.tags}
|
self.params = {"tags": self.tags}
|
||||||
self.page = "page"
|
self.page = "page"
|
||||||
@ -18,7 +19,6 @@ class BooruExtractor(AsyncExtractor):
|
|||||||
root = ET.fromstring(
|
root = ET.fromstring(
|
||||||
self.request(self.api_url, verify=True, params=self.params).text
|
self.request(self.api_url, verify=True, params=self.params).text
|
||||||
)
|
)
|
||||||
# root = tree.getroot()
|
|
||||||
if len(root) == 0:
|
if len(root) == 0:
|
||||||
return
|
return
|
||||||
for item in root:
|
for item in root:
|
||||||
|
Loading…
Reference in New Issue
Block a user