I want to get images of Discogs releases. Can I do it without Discogs API? They don't have links to the images in their db dumps.
The Discogs API v2. 0 is a RESTful interface to Discogs data. You can access JSON-formatted information about Database objects such as Artists, Releases, and Labels. Your application can also manage User Collections and Wantlists, create Marketplace Listings, and more.
Navigate to your account settings. Under Profile settings, use the Upload Photo button to upload your own image to your profile. Use an avatar that is at least 150px wide and less than 1MB. Click "Save Settings" to save the changes.
You cannot send attachments via Discogs... Just ask the enquirer to send you their email address so that you can email them over. Most people who contact me for images supply their email address on the initial message, but others occasionally need a nudge.
To do this without the API, you would have to load a web page and extract the image from the html source code. You can find the relevant page by loading https://www.discogs.com/release/xxxx
where xxxx
is the release number. Since html is just a text file, you can now extract the jpeg URL.
I don't know what your programming language is, but I'm sure it can handle String functions, like indexOf
and subString
. You could extract the html's OG:Image
content for picture.
So taking an example: https://www.discogs.com/release/8140515
.indexOf("og:image\" content=\");
save as startPos
to some integer..indexOf(".jpg", startPos + 19);
into a endPos
.Now extract a subString from html text img_URL = myHtmlStr.substring(startPos+19, endPos);
You should end up with a string reading like this below (extracted URL):
https://img.discogs.com/_zHBK73yJ5oON197YTDXM7JoBjA=/fit-in/600x600/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-8140515-1460073064-5890.jpeg.jpg
The process can be shortened to finding the startPos index of https://img.
, then find first occurrence of .jpg
when searching from after that startPos index. Extract within that length range. This is because the image URL is only mentioned in the html source at https://img.
Compare page at : https://www.discogs.com/release/8140515 with extracted URL image below.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With