1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

unify booru filename-patterns

This commit is contained in:
Mike Fährmann 2015-11-06 16:48:33 +01:00
parent c05dbd15b5
commit 3b0fe8f544
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
8 changed files with 12 additions and 10 deletions

View File

@ -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=([^&]+).*",
],

View File

@ -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):

View File

@ -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=([^&]+).*",
],

View File

@ -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=([^&]+).*"

View File

@ -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=([^&]+).*",
],

View File

@ -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=([^&]+).*",
],

View File

@ -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=([^&]+).*",
],

View File

@ -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=([^&]+).*",
],