mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[e621] reorder
This commit is contained in:
parent
0f0ded53ae
commit
eb5955bacc
@ -8,9 +8,9 @@
|
||||
|
||||
"""Extractors for https://e621.net/ and other e621 instances"""
|
||||
|
||||
from ..cache import memcache
|
||||
from .common import Message
|
||||
from . import danbooru
|
||||
from ..cache import memcache
|
||||
from .. import text, util
|
||||
|
||||
|
||||
@ -22,18 +22,6 @@ class E621Extractor(danbooru.DanbooruExtractor):
|
||||
per_page = 320
|
||||
request_interval_min = 1.0
|
||||
|
||||
def _get_notes(self, id):
|
||||
return self.request(
|
||||
"{}/notes.json?search[post_id]={}".format(self.root, id)).json()
|
||||
|
||||
@memcache(keyarg=1)
|
||||
def _get_pools(self, ids):
|
||||
pools = self.request(
|
||||
"{}/pools.json?search[id]={}".format(self.root, ids)).json()
|
||||
for pool in pools:
|
||||
pool["name"] = pool["name"].replace("_", " ")
|
||||
return pools
|
||||
|
||||
def items(self):
|
||||
self.session.headers["User-Agent"] = util.USERAGENT + " (by mikf)"
|
||||
|
||||
@ -72,6 +60,18 @@ class E621Extractor(danbooru.DanbooruExtractor):
|
||||
yield Message.Directory, post
|
||||
yield Message.Url, file["url"], post
|
||||
|
||||
def _get_notes(self, id):
|
||||
return self.request(
|
||||
"{}/notes.json?search[post_id]={}".format(self.root, id)).json()
|
||||
|
||||
@memcache(keyarg=1)
|
||||
def _get_pools(self, ids):
|
||||
pools = self.request(
|
||||
"{}/pools.json?search[id]={}".format(self.root, ids)).json()
|
||||
for pool in pools:
|
||||
pool["name"] = pool["name"].replace("_", " ")
|
||||
return pools
|
||||
|
||||
|
||||
BASE_PATTERN = E621Extractor.update({
|
||||
"e621": {
|
||||
|
Loading…
Reference in New Issue
Block a user