Export cover pictures

KeskusteluRecommend Site Improvements

Liity LibraryThingin jäseneksi, niin voit kirjoittaa viestin.

Export cover pictures

Muokkaaja: lokakuu 23, 2009, 8:26 am

I can't find a way to export the cover pictures connected to my books (in such a way that they remain related to my boods, of course, maybe by means of some item number or something, or by the "Summary" field, maybe?). Exporting LT data is not exactly flexible (it's more like "Dump the whole lot and do everything in Excel"), so I'm a bit afraid that I'll be getting a few "Nah, impossible" replies, but who knows... And if it's impossible, it shouldn't be :-)

lokakuu 26, 2009, 5:07 pm

You can do it but only very crudely via a script that makes it look like it is you browsing through all your books one by one. It might even be against the Terms of Service. Several of us have asked Tim to upgrade the export formats to include stuff like that, but so far we've had absolutely zero luck.

lokakuu 26, 2009, 5:25 pm

I could be wrong (I usually am), but I think one problem with this is that many of the cover images don't actually reside on the LT servers, but rather are at Amazon. Exporting those images may not be possible, and exporting only some of the images would be a) confusing, and b) unhelpful.

lokakuu 26, 2009, 6:01 pm

I don't think the export should include the images, just a webaddress for them and maybe an indication of whether you had uploaded the image yourself. If that would break the rules of Amazon, the export could just have "Provided by Amazon" for those books. Lots of people avoid Amazon cover pictures because they may change if Amazon adds a new edition with the same ISBN but another cover.

lokakuu 26, 2009, 6:18 pm

Some while ago I started keeping a copy of any cover I uploaded; unfortuntately, not from the beginning. So I have at least a partial set.

lokakuu 27, 2009, 1:45 am

I took another look at the Danish copyright law (they don't have a fair use clause) and decided not to bother with scanning covers.

lokakuu 27, 2009, 1:54 am

So, there are LOTS of ways for users to grab a bunch of covers and put them on their machine. But we aren't going to facilitate that, except for "our" cover images. I'm sure giving users a bulk-download option for Amazon covers would run afoul of something of other in their TOS.

lokakuu 27, 2009, 4:45 am

>>7 timspalding: Thanks for your replies, guys, and also Tim, of course. But how does one "grab a BUNCH of covers"??? I haven't been able to go beyond my browser's grabbing facilities, which is limited to grabbing just 1 image. Instead of saying there are LOTS of ways to grab covers, I would say that there is None (except for the cumbersome way of saving one after the other through your browser). Or did I miss something? Adding the location of the picture to the export output would be very nice indeed!

marraskuu 24, 2020, 8:27 pm

>7 timspalding: Thanks! Tim, I know you said that you won't facilitate that, so I won't ask you to. I will, however, ask the community at large: can tell me how to "grab a bunch of covers" (or at least, point me in the direction of where to find the answer)?

I know I'm pretty much yelling into the ether here, but I'm hoping that someone will be able to help.

Muokkaaja: marraskuu 25, 2020, 2:26 am

>9 pphs: Trying to yell back. I.e. how I'd do it.

(Some of the following will probably look like Chinese to you. Consider it a "direction of where to find the answer", i.e. you can google the "Chinese")

Export your library data as TSV. (Can be done by a script, but that's probably overkill, so just use LT's normal interface, i.e. go to More, then Export/Import, then Export as TSV and after a few minutes you'll have something ready to be imported into Excel.)
This contains the "Work id" and "Book id" for each of your books.

You can then construct a textfile with links like this:



Open this file in a browser and for each link click on the looking class on the cover image (to get a larger version) and right click to save the image on your computer.

The image is located somewhere like this:

so your files will have names like 9be3401f1f38cf359694d357667444341587343_v5.jpg.
You might like to change the name to something like 186953601.jpg but that's up to you.
(This image is 390 x 635. The original size was 664 x 1082.)

So far I've assumed that you are somewhat familiar with Excel but not much more than that.

If you can program, the above process can be automated. It's harder to get the larger versions of the cover images (because there is not a direct link to it on the Book Details page). So I'll explain the easier task of getting the small images

# First we get the html text of the page
wget https://www.librarything.com/work/668134/details/186953601 -O /tmp/111
# somewhere inside this we can find links to the images on the page
# we go for the image link that has an alternative text describing the image
grep jpg /tmp/111 | sed -e 's/="/\n/g' | grep jpg | grep 'alt$' | cut -f1 -d \"

#This produces this link:

So let us download that and save it using Book Id as the name:

wget https://pics.cdn.librarything.com/picsizes/ec/92/ec92e2bafabea2859694d3576674330... -O 186953601.jpg

(This image is 180 x 293. The original size was 664 x 1082.)

So to sum it up:
If you can program a bit and use the programs "wget" and "grep" you can grab a bunch of cover images.

I _think_ that answered your question. If not, please ask again.

(And I've scanned most of my covers by now, so I have a better image called maigretogkvindenderforsvandt.jpg on my computer.)

toukokuu 30, 5:04 am

>10 bnielsen: Thanks for the detailed instructions.

I'm struggling to get this to work in Google sheets as it doesn't have function wget. I concatenate the first part of the https://www.librarything.com/work/668134/details/186953601, but getting the links is another story...
Any ideas?

toukokuu 30, 6:56 am

Nope. I don't have any experience with Google sheets. Sorry!

toukokuu 30, 10:18 am

Isn't wget a Linux command to just retrieve the page content as a csv file? There should be a way to do something comparable with your browser.

toukokuu 30, 10:24 am

timeforrevolution (#11):

wget has nothing to do with spreadsheets, it's a command line function. Should work on Linux or a Mac; if you're on windows you'd need to see whether there's an equivalent.

Muokkaaja: toukokuu 30, 10:40 am

>3 Foretopman: Some images are stored on Amazon. If you upload your own here, they're on LT itself though. I highly advise people to do so, if only because Amazon may change it to another edition anytime they want.

And snatching the image address from Amazon is enough to do an upload to LT.

toukokuu 30, 10:45 am

Obviously that doesn't solve the problem of them getting to be a part of your export though, as was the original question.