Skip to content

Instantly share code, notes, and snippets.

@henrik
Created February 5, 2011 23:22
Show Gist options
  • Save henrik/812918 to your computer and use it in GitHub Desktop.
Save henrik/812918 to your computer and use it in GitHub Desktop.
I'M AFRAID THIS SCRIPT NO LONGER WORKS! MAYBE http://www.student.tugraz.at/kollmitzer/gap_howto.html OR https://github.com/EmelyanenkoK/GAPDownloader DOES. SEE COMMENTS. Google Art Project fullsize image downloader. Specify the page URL and the tiles are downloaded, stitched and trimmed.
# Google Art Project fullsize image downloader.
# By Henrik Nyh <http://henrik.nyh.se> 2011-02-05 under the MIT license.
# Requires Ruby and ImageMagick.
#
# NOTE:
# I'm afraid this script no longer works! See the Gist comments.
#
# Usage e.g.:
# ruby google_art_project.rb http://www.googleartproject.com/museums/tate/portrait-of-william-style-of-langley-174
#
# You can specify multiple URLs on the command line, separated by space.
# Or you can specify no URLs on the command line and instead list them at the end of this file, one on each line,
# with "__END__" before the list.
#
# On OS X, it sets "Downloaded from" metadata and reveals in Finder.
#
# Can reportedly run on Windows as well, with Ruby from http://www.ruby-lang.org/en/downloads/
# and ImageMagick from http://www.imagemagick.org/script/binary-releases.php#windows
# Note that you may need to edit the TEMP_DIRECTORY/OUTPUT_DIRECTORY below.
require "open-uri"
require "fileutils"
require "rbconfig"
module Kernel
def windows?
Config::CONFIG['host_os'].match(/mswin|windows|mingw/i)
end
end
class GAPDownloader
# Set this to "jpg" or "tif".
# jpg is a lot smaller but destructively compressed.
OUTPUT_EXTENSION = "jpg"
if windows?
# Case-sensitive. Use forward slashes, or double-escape backslashes.
TEMP_DIRECTORY = "C:/WINDOWS/Temp"
OUTPUT_DIRECTORY = TEMP_DIRECTORY
else
TEMP_DIRECTORY = "/tmp"
OUTPUT_DIRECTORY = "#{ENV['HOME']}/Downloads"
FileUtils.mkdir_p OUTPUT_DIRECTORY
end
# You can lower this if you get ridiculously high-res images otherwise.
MAX_ZOOM_ALLOWED = 10
class RuntimeError < StandardError; end
def initialize(url)
ensure_image_magick!
@url = url
verify_url!
end
def download
get_image_id
determine_zoom
get_tiles
stitch_tiles
trim
set_metadata
done
end
private
def ensure_image_magick!
if !windows? && `which montage`.empty?
error "You must have ImageMagick installed. Could not find 'montage' in your PATH."
end
end
def verify_url!
unless @url.to_s.match(%r{\Ahttp://www\.googleartproject\.com/})
error "Please specify a Google Art Project URL."
end
end
def get_image_id
@html = open(@url).read
# Reportedly the data-thumbnail can change in the middle of a long download session, but
# the encodedInfospotId will not. So if we key local files by the InfospotId, we can
# check for them if download fails and we start over. Also makes for more human names.
# If I run into it myself, I may adapt the code to auto-resolve a changed data-thumbnail.
@thumb_id = @html[/data-thumbnail="(.+?)"/, 1]
@perma_id = @html[/data-encodedInfospotId="(.+?)"/, 1]
unless @thumb_id && @perma_id
error "Couldn't find an image at this URL, sorry!"
end
end
def determine_zoom
0.upto(MAX_ZOOM_ALLOWED) do |zoom|
open(tile_url(0, 0, zoom))
@max_zoom = zoom
end
rescue OpenURI::HTTPError => e
raise unless e.message == "404 Not Found"
end
def get_tiles
@max_x = 999
@max_y = 999
0.upto(@max_y) do |y|
0.upto(@max_x) do |x|
url = tile_url(x, y, @max_zoom)
path = tile_path(x, y)
if File.exists?(path)
puts "Skipping #{url} (already downloaded)..."
next
end
begin
data = open(url) # Raises at 404.
puts "Getting #{url}..."
File.open(path, "wb") { |f| f.print data.read }
rescue OpenURI::HTTPError => e
raise unless e.message == "404 Not Found"
if y.zero?
# Found max x. Start on next row.
@max_x = x - 1
break
else
# Found max y. We have all tiles, so bail.
@max_y = y - 1
return
end
end
end
end
end
def stitch_tiles
# `montage` is ImageMagick.
# We first stitch together the tiles of each row, then stitch all rows.
# Stitching the full image all at once can get extremely inefficient for large images.
tiles_wide = @max_x + 1
tiles_high = @max_y + 1
puts "Stitching #{tiles_wide} x #{tiles_high} = #{tiles_wide*tiles_high} tiles..."
0.upto(@max_y) do |y|
tiles = (0..@max_x).map { |x| tile_path(x, y) }.join(' ')
`montage #{tiles} -geometry +0+0 -tile #{tiles_wide}x1 #{row_path(y)}`
end
tiles = (0..@max_y).map { |y| row_path(y) }.join(' ')
`montage #{tiles} -geometry +0+0 -tile 1x#{tiles_high} #{full_path}`
end
def trim
# Trim the black blocks that may appear on right and bottom.
# We first add a black border to ensure no other color is trimmed, as described on
# http://www.imagemagick.org/Usage/crop/#trim
`convert #{full_path} -bordercolor black -border 1x1 -trim #{full_path}`
end
def set_metadata
# 300 DPI instead of 72 DPI; more sane for printing.
`convert #{full_path} -density 300 #{full_path}`
if !windows? && !`which xattr`.empty?
# Set "Downloaded from" Finder metadata, like Safari does.
system('xattr', '-w', 'com.apple.metadata:kMDItemWhereFroms', @url, full_path)
end
end
def done
puts "Done: #{full_path}"
# Reveal in Finder if on OS X.
unless windows?
`which osascript && osascript -e 'tell app "Finder"' -e 'reveal POSIX file "#{full_path}"' -e 'activate' -e 'end'`
end
end
def error(message)
raise GAPDownloader::RuntimeError, "#{message} (#{@url})"
end
def tile_url(x, y, zoom)
# The subdomain can seemingly be anything from lh3 to lh6.
"http://lh5.ggpht.com/#{@thumb_id}=x#{x}-y#{y}-z#{zoom}"
end
def tile_path(x, y)
File.join(TEMP_DIRECTORY, "gap-#{@perma_id}-tile-#{x}-#{y}.jpg")
end
def row_path(y)
File.join(TEMP_DIRECTORY, "gap-#{@perma_id}-row-#{@max_zoom}-#{y}.#{OUTPUT_EXTENSION}")
end
def full_path
File.join(OUTPUT_DIRECTORY, "#{@perma_id}.#{OUTPUT_EXTENSION}")
end
end
if __FILE__ == $0
urls = ARGV.any? ? ARGV : (defined?(DATA) ? DATA.read.strip.split("\n") : [])
puts "Error: No URLs given!" if urls.empty?
urls.each do |url|
begin
GAPDownloader.new(url).download
rescue GAPDownloader::RuntimeError => e
puts "Error: #{e.message}"
end
end
end
@johnrau
Copy link

johnrau commented Jul 16, 2011

BillTheGoat, i don't understand. Please tell me more about uffizi. Thanks.

Henrik, but i see this link above
Exists: http://lh4.ggpht.com/lRLL2L2K767UgLi94FDOE7IRYj-tzfmdHjTb2PCE7AFT6iATF9uS8STnmy9GTw3i9Q5AuWg6XtQ=x0-y0-z0
is persist.
and if i change value at row 94: open(tile_url(0, 0, zoom)) from 0 -> 1 then script running but error at name tile.
Sorry if not properly, i am not a programmer.

@flolan
Copy link

flolan commented Jul 16, 2011 via email

@BillTheGoat
Copy link

@flolan - Thanks, I am hooked into a very small torrent now.

@johnrau - The Uffizi are Museums in Florence, Italy.

@monet60707
Copy link

Unfortunately all these "torrent" or "emule" images are small, nothing like "The bedroom" or "Starry Night" on Google Art Project. The quality that I got of these images is insane! I can print a wall mural with it and still it looks crisp and sharp. But I guess it depends on what you want to do with the images. If it's for computer screen wallpaper than it's fine, but definitely not suitable for high rez printing (well maybe for a post stamp size ;)
Flolan, did you get any decent sizes of these images from emule? Decent, I mean approx 5000px X 7000px?

@flolan
Copy link

flolan commented Jul 16, 2011 via email

@BillTheGoat
Copy link

I was definitely hoping to get at least 80 MP for a nice large sized print. However, it is true that only a handful of images are above about 20 MP. At this point, the torrent is basically dead, since there are no seeders, and I am downloading at 4kbs (8 mb of 3 gigs total). If anyone still has this torrent on their computer, it would be great if you could seed it.

My internet connection is on my weak computer, so I was waiting to download the high res that were bogging down my processor (Like Rembrant's The Prodigal Son). It would be great if someone could take the initiative to start another torrent with just the high res images to complete the other one. We could do our best to keep it going for a while (personally, my internet is intermittent).

PS - for absolute clarity, the current torrent is "google-art-public-domain.zip", with 928 images if I remember correctly.

@Parkjisun
Copy link

Hi BillTheGoat

Please, send for me url about torrent and Uffizi website. i researching.

Thanks

@Parkjisun
Copy link

Hi all, i see in file flash project add lines code:
// package hurlant
// package crypto
// package hash
// class HMAC
package com.hurlant.crypto.hash
{
import flash.utils.*;

public class HMAC extends Object
{
    public function HMAC(arg1:com.hurlant.crypto.hash.IHash, arg2:uint=0)
    {
        super();
        this.hash = arg1;
        this.bits = arg2;
        return;
    }

    public function getHashSize():uint
    {
        if (bits != 0) 
        {
            return bits / 8;
        }
        return hash.getHashSize();
    }

    public function dispose():void
    {
        hash = null;
        bits = 0;
        return;
    }

    public function compute(arg1:flash.utils.ByteArray, arg2:flash.utils.ByteArray):flash.utils.ByteArray
    {
        var loc1:*=null;
        var loc2:*=null;
        var loc3:*=null;
        var loc4:*=0;
        var loc5:*=null;
        var loc6:*=null;
        if (arg1.length > hash.getInputSize()) 
        {
            loc1 = hash.hash(arg1);
        }
        else 
        {
            loc1 = new flash.utils.ByteArray();
            loc1.writeBytes(arg1);
        }
        while (loc1.length < hash.getInputSize()) 
        {
            loc1[loc1.length] = 0;
        }
        loc2 = new flash.utils.ByteArray();
        loc3 = new flash.utils.ByteArray();
        loc4 = 0;
        while (loc4 < loc1.length) 
        {
            loc2[loc4] = loc1[loc4] ^ 54;
            loc3[loc4] = loc1[loc4] ^ 92;
            ++loc4;
        }
        loc2.position = loc1.length;
        loc2.writeBytes(arg2);
        loc5 = hash.hash(loc2);
        loc3.position = loc1.length;
        loc3.writeBytes(loc5);
        loc6 = hash.hash(loc3);
        if (bits > 0 && bits < 8 * loc6.length) 
        {
            loc6.length = bits / 8;
        }
        return loc6;
    }

    public function toString():String
    {
        return "hmac-" + (bits > 0 ? bits + "-" : "") + hash.toString();
    }

    internal var bits:uint;

    internal var hash:com.hurlant.crypto.hash.IHash;
}

}

// class IHash
package com.hurlant.crypto.hash
{
import flash.utils.*;

public interface IHash
{
    function toString():String;

    function getHashSize():uint;

    function getInputSize():uint;

    function hash(arg1:flash.utils.ByteArray):flash.utils.ByteArray;
}

}

// class SHA1
package com.hurlant.crypto.hash
{
public class SHA1 extends com.hurlant.crypto.hash.SHABase implements com.hurlant.crypto.hash.IHash
{
public function SHA1()
{
super();
return;
}

    internal function ft(arg1:uint, arg2:uint, arg3:uint, arg4:uint):uint
    {
        if (arg1 < 20) 
        {
            return arg2 & arg3 | !arg2 & arg4;
        }
        if (arg1 < 40) 
        {
            return arg2 ^ arg3 ^ arg4;
        }
        if (arg1 < 60) 
        {
            return arg2 & arg3 | arg2 & arg4 | arg3 & arg4;
        }
        return arg2 ^ arg3 ^ arg4;
    }

    internal function kt(arg1:uint):uint
    {
        return arg1 < 20 ? 1518500249 : arg1 < 40 ? 1859775393 : arg1 < 60 ? 2400959708 : 3395469782;
    }

    public override function toString():String
    {
        return "sha1";
    }

    public override function getHashSize():uint
    {
        return HASH_SIZE;
    }

    internal function rol(arg1:uint, arg2:uint):uint
    {
        return arg1 << arg2 | arg1 >>> 32 - arg2;
    }

    protected override function core(arg1:Array, arg2:uint):Array
    {
        var loc1:*=null;
        var loc2:*=0;
        var loc3:*=0;
        var loc4:*=0;
        var loc5:*=0;
        var loc6:*=0;
        var loc7:*=0;
        var loc8:*=0;
        var loc9:*=0;
        var loc10:*=0;
        var loc11:*=0;
        var loc12:*=0;
        var loc13:*=0;
        var loc14:*=0;
        arg1[arg2 >> 5] = arg1[arg2 >> 5] | 128 << 24 - arg2 % 32;
        arg1[(arg2 + 64 >> 9 << 4) + 15] = arg2;
        loc1 = [];
        loc2 = 1732584193;
        loc3 = 4023233417;
        loc4 = 2562383102;
        loc5 = 271733878;
        loc6 = 3285377520;
        loc7 = 0;
        while (loc7 < arg1.length) 
        {
            loc8 = loc2;
            loc9 = loc3;
            loc10 = loc4;
            loc11 = loc5;
            loc12 = loc6;
            loc13 = 0;
            while (loc13 < 80) 
            {
                if (loc13 < 16) 
                {
                    loc1[loc13] = arg1[loc7 + loc13] || 0;
                }
                else 
                {
                    loc1[loc13] = rol(loc1[loc13 - 3] ^ loc1[loc13 - 8] ^ loc1[loc13 - 14] ^ loc1[loc13 - 16], 1);
                }
                loc14 = rol(loc2, 5) + ft(loc13, loc3, loc4, loc5) + loc6 + loc1[loc13] + kt(loc13);
                loc6 = loc5;
                loc5 = loc4;
                loc4 = rol(loc3, 30);
                loc3 = loc2;
                loc2 = loc14;
                ++loc13;
            }
            loc2 = loc2 + loc8;
            loc3 = loc3 + loc9;
            loc4 = loc4 + loc10;
            loc5 = loc5 + loc11;
            loc6 = loc6 + loc12;
            loc7 = loc7 + 16;
        }
        return [loc2, loc3, loc4, loc5, loc6];
    }

    public static const HASH_SIZE:int=20;
}

}

// class SHABase
package com.hurlant.crypto.hash
{
import flash.utils.*;

public class SHABase extends Object implements com.hurlant.crypto.hash.IHash
{
    public function SHABase()
    {
        super();
        return;
    }

    public function getHashSize():uint
    {
        return 0;
    }

    public function toString():String
    {
        return "sha";
    }

    public function getInputSize():uint
    {
        return 64;
    }

    public function hash(arg1:flash.utils.ByteArray):flash.utils.ByteArray
    {
        var loc1:*=0;
        var loc2:*=null;
        var loc3:*=0;
        var loc4:*=null;
        var loc5:*=0;
        var loc6:*=null;
        var loc7:*=null;
        var loc8:*=0;
        loc1 = arg1.length;
        loc2 = arg1.endian;
        arg1.endian = flash.utils.Endian.BIG_ENDIAN;
        loc3 = loc1 * 8;
        while (arg1.length % 4 != 0) 
        {
            arg1[arg1.length] = 0;
        }
        arg1.position = 0;
        loc4 = [];
        loc5 = 0;
        while (loc5 < arg1.length) 
        {
            loc4.push(arg1.readUnsignedInt());
            loc5 = loc5 + 4;
        }
        loc6 = core(loc4, loc3);
        loc7 = new flash.utils.ByteArray();
        loc8 = getHashSize() / 4;
        loc5 = 0;
        while (loc5 < loc8) 
        {
            loc7.writeUnsignedInt(loc6[loc5]);
            ++loc5;
        }
        arg1.length = loc1;
        arg1.endian = loc2;
        return loc7;
    }

    protected function core(arg1:Array, arg2:uint):Array
    {
        return null;
    }
}

}

@BillTheGoat
Copy link

It is not future proof, but it should be a bit faster than the torrent and has images at high resolution:

http://commons.wikimedia.org/wiki/Category:Google_Art_Project

@monet60707
Copy link

Hi Parkjisun,

So what exactly your code does? How can I use it? Does it work on Google Art Project?

@bohwaz
Copy link

bohwaz commented Aug 18, 2011

Actually Google has now a hmac hash appended to the URL. This HMAC is generated like this:

data: "[perma_id]=x[x pos]-y[y pos]-z[zoom level]-t[timestamp from xml]"
hash: hash_hmac('sha1', secret_key, data)
hash: hash.base64Encode.replace(/-/, '_')
hash: hash.substr(0, 27)
url: image_url + "-t" + hash

Well that's the easy part. To create the secret key they use an embedded google PNG logo and compute some stuff from some of its pixel colors. I'm personnally too busy/tired to rewrite the AS3 code in PHP/Ruby, but here it is in case someone's interested:

This function generates two bytearrays which are used after:

        public static function initLogo(arg1:flash.utils.ByteArray, arg2:flash.utils.ByteArray):void
        {
            var loc2:*;
            loc2 = 0;
            var loc1:*;
            loc1 = new GoogleLogo(); // returns bitmapdata of embedded google logo
            var loc3:*;
            loc3 = 1;
            while (loc3 <= 6) 
            {
                loc2 = loc1.bitmapData.getPixel(0, loc3);
                arg1.writeByte(loc2 >> 16);
                if (loc3 != 6)
                {
                    arg1.writeByte(loc2 >> 8);
                    arg1.writeByte(loc2);
                }
                ++loc3;
            }
            loc3 = 6;
            while (loc3 <= 11) 
            {
                loc2 = loc1.bitmapData.getPixel(0, loc3);
                if (loc3 != 6)
                {
                    arg2.writeByte(loc2 >> 16);
                }
                arg2.writeByte(loc2 >> 8);
                if (loc3 != 11)
                {
                    arg2.writeByte(loc2);
                }
                ++loc3;
            }
            return;
        }

This function takes the two byte arrays and make the secret key:

        public function getLogChannel(arg1:flash.utils.ByteArray):void
        {
            var loc1:*;
            loc1 = 8;
            while (loc1 < 16) 
            {
                arg1[(loc1 - 8)] = this.logChannelA[loc1] * 47 ^ this.logChannelB[loc1];
                ++loc1;
            }
            return;
        }

The Google logo is here: http://i.kd2.org/i/34/6j9OHv5lP.google-logo.png

Actually I tried to rewrite this in PHP but I failed, I don't really use AS3, so ByteArray is a bit new for me, but maybe I'm missing some stuff.

@Flapomat
Copy link

hello,

i am new to osx and the terminal. anyway i installed ruby, imagemagick and xcode. i still got an error message using this script:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:277:in open_http': 403 Forbidden (OpenURI::HTTPError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:616:inbuffer_open'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:164:in open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:162:incatch'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:162:in open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:132:inopen_uri'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:518:in open' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:30:inopen'
from google_art_project.rb:94:in determine_zoom' from google_art_project.rb:93:inupto'
from google_art_project.rb:93:in determine_zoom' from google_art_project.rb:57:indownload'
from google_art_project.rb:206
from google_art_project.rb:204:in `each'
from google_art_project.rb:204

Can anyone help me please?

Thanks in advance

@henrik
Copy link
Author

henrik commented Sep 24, 2011

@Flapomat I'm afraid this script doesn't work any more due to changes on Google's side.

@Flapomat
Copy link

What a pity. Do you know any other possibility to get the pictures in high res?

@ionas
Copy link

ionas commented Jan 15, 2012

Can sadly confirm, also got HTTP 403:

user@MACHINE: /Applications/GoogleArtProject.RB/gist812918-0f80614973e377e34f3355130b6b8ae678b418b8 $ ruby google_art_project.rb http://www.googleartproject.com/museums/tate/portrait-of-william-style-of-langley-174
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:277:in open_http': 403 Forbidden (OpenURI::HTTPError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:616:inbuffer_open'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:164:in open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:162:incatch'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:162:in open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:132:inopen_uri'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:518:in open' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:30:inopen'
from google_art_project.rb:94:in determine_zoom' from google_art_project.rb:93:inupto'
from google_art_project.rb:93:in determine_zoom' from google_art_project.rb:57:indownload'
from google_art_project.rb:206
from google_art_project.rb:204:in `each'
from google_art_project.rb:204

@ycyn
Copy link

ycyn commented Mar 3, 2012

hello, anyone can give some pictures who have downloaded from google project. i will be more thanks.and i really need it . many thanks

@ycyn
Copy link

ycyn commented Mar 3, 2012

need help !!!

@jalq
Copy link

jalq commented Apr 11, 2012

Hello, im running a Windows 7 64bit on Intel Core 2 Duo 4GB Ram Memory.
After installing Ruby and ImageMagick I run the command prompt and keep getting:
"Error: Could't find an image at this URL, sorry!"

Do you think you can help me over this?

Best Regards,
Paulo.

@bohwaz
Copy link

bohwaz commented Apr 13, 2012

GAP website has changed again, and is now fully in JS.

@DAPARICIO1
Copy link

NOWADAYS THIS SCRIPT DOES NOT WORK FOR ME. WHAT IS THE REASON?
I AM IN WINDOWS XP AND HERE IS THE ERROR MESSAGE: COULDN`T FIND AND IMAGE AT THIS URL SORRY

@henrik
Copy link
Author

henrik commented Oct 13, 2012

Again, this script no longer works. Emelyanenko Kirill mailed me about a script that is supposed to work, though: https://github.com/EmelyanenkoK/GAPDownloader Haven't tried it myself.

@rhoulay
Copy link

rhoulay commented Oct 17, 2012

Hi henrik,

I try your code on Mac Lion and I get error urllib2.HTTPError: HTTP Error 403: Forbidden:
'''felixmatoMacBook-Pro:EmelyanenkoK-GAPDownloader-41f7003 felix$ python extractionGoogleArtProject_Unix.py
(http://www.googleartproject.com/collection/moma-the-museum-of-modern-art/artwork/the-starry-night-vincent-van-gogh/320268/)
BZ/7D6G3mWJ+JNvVDnZV/jcxS+E=
(http://lh6.ggpht.com/JFp6OJr9g8KABxRwCpABRdfc0Od2SQsguNwtn0qhvOkxkeFYZhQGrg=x0-y0-z4-tBZ_7D6G3mWJ_JNvVDnZV_jcxS_E)
Traceback (most recent call last):
File "extractionGoogleArtProject_Unix.py", line 290, in
telechargerOeuvre(i[0], i[1], i[2])
File "extractionGoogleArtProject_Unix.py", line 255, in telechargerOeuvre
telechargerTableau(urlImage, normaliserNomFichier(nomFichierImage), zoom)
File "extractionGoogleArtProject_Unix.py", line 215, in telechargerTableau
telechargerTousFragments(urlImage, xMax, yMax, zoom)
File "extractionGoogleArtProject_Unix.py", line 138, in telechargerTousFragments
telechargerFragment(urlImage, cheminFragment, x, y, zoom)
File "extractionGoogleArtProject_Unix.py", line 122, in telechargerFragment
contenuFragment = getContenuUrl(urlFragment, refererGoogleArtProject)
File "extractionGoogleArtProject_Unix.py", line 32, in getContenuUrl
return urllib2.urlopen(requete).read()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
return self._call_chain(_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden

@rhoulay
Copy link

rhoulay commented Oct 17, 2012

Hi henrik,

I try your code on Mac Lion and get error (urllib2.HTTPError: HTTP Error 403: Forbidden).

Detail:
felixmatoMacBook-Pro:EmelyanenkoK-GAPDownloader-41f7003 felix$ python extractionGoogleArtProject_Unix.py
(http://www.googleartproject.com/collection/moma-the-museum-of-modern-art/artwork/the-starry-night-vincent-van-gogh/320268/)
BZ/7D6G3mWJ+JNvVDnZV/jcxS+E=
(http://lh6.ggpht.com/JFp6OJr9g8KABxRwCpABRdfc0Od2SQsguNwtn0qhvOkxkeFYZhQGrg=x0-y0-z4-tBZ_7D6G3mWJ_JNvVDnZV_jcxS_E)
Traceback (most recent call last):
File "extractionGoogleArtProject_Unix.py", line 290, in
telechargerOeuvre(i[0], i[1], i[2])
File "extractionGoogleArtProject_Unix.py", line 255, in telechargerOeuvre
telechargerTableau(urlImage, normaliserNomFichier(nomFichierImage), zoom)
File "extractionGoogleArtProject_Unix.py", line 215, in telechargerTableau
telechargerTousFragments(urlImage, xMax, yMax, zoom)
File "extractionGoogleArtProject_Unix.py", line 138, in telechargerTousFragments
telechargerFragment(urlImage, cheminFragment, x, y, zoom)
File "extractionGoogleArtProject_Unix.py", line 122, in telechargerFragment
contenuFragment = getContenuUrl(urlFragment, refererGoogleArtProject)
File "extractionGoogleArtProject_Unix.py", line 32, in getContenuUrl
return urllib2.urlopen(requete).read()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
return self._call_chain(_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden

@rhoulay
Copy link

rhoulay commented Oct 17, 2012

Hi henrik, I try your new code on Mac Lion and get urllib2.HTTPError: HTTP Error 403: Forbidden.

@henrik
Copy link
Author

henrik commented Oct 26, 2013

@addginpu
Copy link

or try gigafineart.heroku.com

@asanakoy
Copy link

asanakoy commented Apr 7, 2017

gigafineart.heroku.com works, but does anybody know how they do it?

@perklet
Copy link

perklet commented Nov 17, 2018

@alanscandrett
Copy link

I am currently getting black canvases when downloading, and have seen comments of others getting the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment