update all other extractors

This commit is contained in:
Mike Fährmann
2015-11-21 04:26:30 +01:00
parent 2dfe97dd00
commit 4d56b76aa8
21 changed files with 131 additions and 256 deletions

View File

@@ -12,18 +12,13 @@ from .common import Extractor, Message
from .. import text
import os.path
info = {
"category": "imgur",
"extractor": "ImgurExtractor",
"directory": ["{category}", "{album-key} - {title}"],
"filename": "{category}_{album-key}_{num:>03}_{name}.{extension}",
"pattern": [
r"(?:https?://)?(?:www\.)?imgur\.com/(?:a|gallery)/([^/?&#]+)",
],
}
class ImgurExtractor(Extractor):
category = "imgur"
directory_fmt = ["{category}", "{album-key} - {title}"]
filename_fmt = "{category}_{album-key}_{num:>03}_{name}.{extension}"
pattern = [r"(?:https?://)?(?:www\.)?imgur\.com/(?:a|gallery)/([^/?&#]+)"]
def __init__(self, match):
Extractor.__init__(self)
self.album = match.group(1)
@@ -43,7 +38,7 @@ class ImgurExtractor(Extractor):
"""Collect metadata for extractor-job"""
page = self.request("https://imgur.com/a/" + self.album).text
data = {
"category": info["category"],
"category": self.category,
"album-key": self.album,
}
return text.extract_all(page, (