From: Ian Jackson Date: Wed, 9 Sep 2020 22:35:58 +0000 (+0100) Subject: media-scraper: wip X-Git-Tag: otter-0.2.0~956 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6ab80239372798e51742392533b35ed5e92a02af;p=otter.git media-scraper: wip Signed-off-by: Ian Jackson --- diff --git a/library/wikimedia.toml b/library/wikimedia.toml index 98fa65dd..af29d138 100644 --- a/library/wikimedia.toml +++ b/library/wikimedia.toml @@ -12,11 +12,11 @@ category = "chess" files = """ blt45 a white bishop -adt45 a black knight +#adt45 a black knight """ [chess.scraper] method = "wikimedia" licences = [ "Cc-by-sa-3.0", "GFDL|migration=relicense" ] -url_prefix = "https://commons.wikimedia.org/wiki/File:Chess " -url_suffix = ".svg" +url_prefix = "https://commons.wikimedia.org/wiki/File:Chess_" +url_suffix = ".svg?action=raw" diff --git a/media-scraper b/media-scraper index 8967e806..65a82fda 100755 --- a/media-scraper +++ b/media-scraper @@ -1,6 +1,5 @@ #!/usr/bin/perl -w use strict; -use autodie; use POSIX; use TOML::Parser; @@ -14,7 +13,7 @@ our $max_rate = 2; # per second open DEBUG, ">&STDERR" or die $!; sub run_curl { - my (@curl) = (qw(curl), @_); + my (@curl) = (qw(curl -Ssf -L --proto-redir -all), @_); our $last_curl; $last_curl //= 0.; my $now = Time::HiRes::time;