From a81cd7884bb6868ba54de1364a8f33c858f353d5 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Fri, 3 Oct 2025 09:29:52 +0800 Subject: [PATCH] [wikimedia] update documentation and test for 'image-revisions' --- docs/configuration.rst | 3 +++ test/results/wikipedia.py | 12 ++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index b46b0f90..dd836273 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -6560,6 +6560,9 @@ Description The dafault value of 1 only returns the latest revision. The value must be between 1 and 500. +Note + The API sometimes returns image revisions on article pages even when this option is + set to 1. However, setting it to a higher value may reduce the number of API requests. extractor.wikimedia.limit diff --git a/test/results/wikipedia.py b/test/results/wikipedia.py index 90e40a21..3059e5fd 100644 --- a/test/results/wikipedia.py +++ b/test/results/wikipedia.py @@ -45,16 +45,12 @@ __tests__ = ( }, { - "#url" : "https://tl.wikipedia.org/wiki/Sitosol", - "#comment" : "revisions of an image in an article", + "#url" : "https://en.wikipedia.org/wiki/Title", + "#comment" : "force download revisions of images in an article", "#category": ("wikimedia", "wikipedia", "article"), "#class" : wikimedia.WikimediaArticleExtractor, - "#options" : {"image-revisions": 10}, - "#count" : 2, - "#pattern" : ( - r"https://upload.wikimedia.org/wikipedia/commons/2/2e/Crowded_cytosol.png", - r"https://upload.wikimedia.org/wikipedia/commons/archive/2/2e/20080911161129%21Crowded_cytosol.png", - ), + "#options" : {"image-revisions": 5}, + "#count" : "> 8", }, {