[Sugar-devel] Problems downloading PG titles without a web browser

Daniel Narvaez dwnarvaez at gmail.com
Sun Feb 10 13:47:56 EST 2013


I don't know what you are using to download, but they seem to be
blocking some user agents

This fails

wget http://www.gutenberg.org/dirs/1/1/119/119.zip

This works

wget --user-agent="blah" http://www.gutenberg.org/dirs/1/1/119/119.zip

So assuming you are able to set the user agent in your code, you could
just make one up.

On 10 February 2013 18:46, James Simmons <nicestep at gmail.com> wrote:
> I had created an Activity for the One Laptop Per Child project which
> downloads and reads the Plain Text version of PG titles.  I use the offline
> catalogue and some Python code to list available titles in the catalogue
> that match a search string.  For instance the child might enter "Twain" and
> get a list of all the books by and about Twain.  Then the child can download
> the book using the same program.
>
> This has been working well for years but lately it has stopped working.
> When I try to debug it I see it trying to download this URL for instance:
>
> http://www.gutenberg.org/dirs/1/1/119/119.zip
>
> Put this URL in any web browser and it will download "A Tramp Abroad" by
> Mark Twain.  However, try and download the same URL using my Python code and
> you get this:
>
> Forbidden
>
> You don't have permission to access /dirs/1/1/119/119.zip on this server.
>
> ________________________________
> Apache Server at www.gutenberg.org Port 80
>
> My Activity is a much more convenient way of downloading books than a web
> browser. For one thing, it gives the downloaded file a more intelligent name
> than 119.zip.  I would like for it to work again as it did before.
> Suggestions?
>
> James Simmons
>
>
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



-- 
Daniel Narvaez


More information about the Sugar-devel mailing list