mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
unify booru filename-patterns
This commit is contained in:
parent
c05dbd15b5
commit
3b0fe8f544
@ -14,7 +14,7 @@ info = {
|
||||
"category": "3dbooru",
|
||||
"extractor": "ThreeDeeBooruExtractor",
|
||||
"directory": ["{category}", "{tags}"],
|
||||
"filename": "{category}_{id}_{name}",
|
||||
"filename": "{category}_{id}_{md5}.{extension}",
|
||||
"pattern": [
|
||||
r"(?:https?://)?(?:www\.)?behoimi\.org/post(?:/(?:index)?)?\?tags=([^&]+).*",
|
||||
],
|
||||
|
@ -53,16 +53,18 @@ class BooruExtractor(Extractor):
|
||||
"""Collect metadata for extractor-job"""
|
||||
return {
|
||||
"category": self.info["category"],
|
||||
"tags": self.tags.replace("/", "_"),
|
||||
"tags": self.tags
|
||||
}
|
||||
|
||||
def get_file_metadata(self, data):
|
||||
"""Collect metadata for a downloadable file"""
|
||||
data["category"] = self.info["category"]
|
||||
data["name"] = text.unquote(
|
||||
data["filename"] = text.unquote(
|
||||
text.filename_from_url(self.get_file_url(data))
|
||||
)
|
||||
data["extension"] = os.path.splitext(data["name"])[1][1:]
|
||||
name, ext = os.path.splitext(data["filename"])
|
||||
data["name"] = name
|
||||
data["extension"] = ext[1:]
|
||||
return data
|
||||
|
||||
def get_file_url(self, data):
|
||||
|
@ -14,7 +14,7 @@ info = {
|
||||
"category": "danbooru",
|
||||
"extractor": "DanbooruExtractor",
|
||||
"directory": ["{category}", "{tags}"],
|
||||
"filename": "{category}_{name}",
|
||||
"filename": "{category}_{id}_{md5}.{extension}",
|
||||
"pattern": [
|
||||
r"(?:https?://)?(?:www\.)?danbooru.donmai.us/posts\?(?:utf8=%E2%9C%93&)?tags=([^&]+).*",
|
||||
],
|
||||
|
@ -14,7 +14,7 @@ info = {
|
||||
"category": "e621",
|
||||
"extractor": "E621Extractor",
|
||||
"directory": ["{category}", "{tags}"],
|
||||
"filename": "{category}_{name}",
|
||||
"filename": "{category}_{id}_{md5}.{extension}",
|
||||
"pattern": [
|
||||
r"(?:https?://)?(?:www\.)?e621\.net/post/index/\d+/([^?]+)",
|
||||
r"(?:https?://)?(?:www\.)?e621\.net/post\?tags=([^&]+).*"
|
||||
|
@ -15,7 +15,7 @@ info = {
|
||||
"category": "gelbooru",
|
||||
"extractor": "GelbooruExtractor",
|
||||
"directory": ["{category}", "{tags}"],
|
||||
"filename": "{category}_{name}",
|
||||
"filename": "{category}_{id}_{md5}.{extension}",
|
||||
"pattern": [
|
||||
r"(?:https?://)?(?:www\.)?gelbooru\.com/(?:index\.php)?\?page=post&s=list&tags=([^&]+).*",
|
||||
],
|
||||
|
@ -14,7 +14,7 @@ info = {
|
||||
"category": "konachan",
|
||||
"extractor": "KonachanExtractor",
|
||||
"directory": ["{category}", "{tags}"],
|
||||
"filename": "{category}_{md5}.{extension}",
|
||||
"filename": "{category}_{id}_{md5}.{extension}",
|
||||
"pattern": [
|
||||
r"(?:https?://)?(?:www\.)?konachan\.com/post\?tags=([^&]+).*",
|
||||
],
|
||||
|
@ -14,7 +14,7 @@ info = {
|
||||
"category": "safebooru",
|
||||
"extractor": "SafebooruExtractor",
|
||||
"directory": ["{category}", "{tags}"],
|
||||
"filename": "{category}_{name}",
|
||||
"filename": "{category}_{id}_{md5}.{extension}",
|
||||
"pattern": [
|
||||
r"(?:https?://)?(?:www\.)?safebooru\.org/(?:index\.php)?\?page=post&s=list&tags=([^&]+).*",
|
||||
],
|
||||
|
@ -14,7 +14,7 @@ info = {
|
||||
"category": "yandere",
|
||||
"extractor": "YandereExtractor",
|
||||
"directory": ["{category}", "{tags}"],
|
||||
"filename": "{category}_{md5}.{extension}",
|
||||
"filename": "{category}_{id}_{md5}.{extension}",
|
||||
"pattern": [
|
||||
r"(?:https?://)?(?:www\.)?yande\.re/post\?tags=([^&]+).*",
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user