makevoid / opensea-images-downloader

<outdated> Script to download all the images from an opensea collection using the OpenSea API
44 stars 18 forks source link

Only accept json output #5

Open cyrildiagne opened 2 years ago

cyrildiagne commented 2 years ago

Here: https://github.com/makevoid/opensea-images-downloader/blob/4746ccca322dc5a7a09658fae525fe2135608a4d/downloader.rb#L12

I had to specify the output requested otherwise the opensea API would return the Django HTML version:

res = Excon.get url, :headers => { "Accept" => "application/json" }

Example: https://api.opensea.io/api/v1/assets?order_direction=asc&limit=50&collection=clonex&offset=0

makevoid commented 2 years ago

hi, thanks for reporting the bug, interesting

it makes sense, I will add the accept header! thank you!