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