diff --git a/gallery_dl/extractor/3dbooru.py b/gallery_dl/extractor/3dbooru.py index 9d378641..77d71f1a 100644 --- a/gallery_dl/extractor/3dbooru.py +++ b/gallery_dl/extractor/3dbooru.py @@ -58,7 +58,7 @@ class ThreedeebooruPopularExtractor(ThreedeebooruExtractor, pattern = [r"(?:https?://)?(?:www\.)?behoimi\.org/post/popular_" r"(by_(?:day|week|month)|recent)(?:\?([^#]*))?"] test = [("http://behoimi.org/post/popular_by_month?month=2&year=2013", { - "url": "dfe779d6e6336bd8f67078483bc14b2af1a5aee8", + "url": "e5a75f8fa6cbe96109bceca25af3745a25102f3f", "count": 20, })] diff --git a/gallery_dl/extractor/booru.py b/gallery_dl/extractor/booru.py index 3bea3ac9..a7a28dec 100644 --- a/gallery_dl/extractor/booru.py +++ b/gallery_dl/extractor/booru.py @@ -13,6 +13,7 @@ from .. import text import xml.etree.ElementTree as ET import urllib.parse import datetime +import operator class BooruExtractor(SharedConfigExtractor): @@ -81,10 +82,15 @@ class BooruExtractor(SharedConfigExtractor): class JSONBooruExtractor(BooruExtractor): """Base class for JSON based API responses""" + sort = False + def items_impl(self): self.update_page(reset=True) while True: images = self.request(self.api_url, params=self.params).json() + if self.sort: + images.sort(key=operator.itemgetter("score", "id"), + reverse=True) yield from images if len(images) < self.params["limit"]: return @@ -151,6 +157,7 @@ class BooruPopularExtractor(BooruExtractor): def __init__(self, match): BooruExtractor.__init__(self) + self.sort = True self.scale = match.group(1) self.params.update(text.parse_query(match.group(2))) diff --git a/gallery_dl/extractor/imgur.py b/gallery_dl/extractor/imgur.py index e36a6ff4..cab4e599 100644 --- a/gallery_dl/extractor/imgur.py +++ b/gallery_dl/extractor/imgur.py @@ -95,11 +95,11 @@ class ImgurAlbumExtractor(ImgurExtractor): test = [ ("https://imgur.com/a/TcBmP", { "url": "ce3552f550a5b5316bd9c7ae02e21e39f30c0563", - "keyword": "e2eaae0e62d3c5d76df9c870140d1ef466bbec59", + "keyword": "4fb9d3089810ce5d230f2706b3b37edf529061bf", }), ("https://imgur.com/gallery/eD9CT", { # large album "url": "4ee94de31ff26be416271bc0b1ea27b9349c9937", - "keyword": "c73a4a7e0fb2c3f00b30f9798327c34a8fbf1aac", + "keyword": "577f15a6320b7717bd9fd04e7fde56f9519e3def", }), ("https://imgur.com/a/TcBmQ", { "exception": exception.NotFoundError,