Using id originally from unsplash.com to help finding photo source
daviszerro opened this issue · 2 comments
Now venus will download photos to OS temp path using filename such like venus_7ztb88uy.jpg
, which 7ztb88uy
is not the original id from unsplash.com url, for example: https://unsplash.com/photos/z5jH3tdupIo
. This makes it hard to find out the photo's source.
I think it will be convenient to implementing this feature.
Regards.
@daviszerro Hey! Thank you for the suggestion, this could be a good addition, however, currently, the way venus pulls images is using https://source.unsplash.com/
, and the URLs returned by that request look like this:
https://images.unsplash.com/photo-1602452605960-c46e781e1ecf?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=1080&ixlib=rb-1.2.1&q=80&w=1920
As far as I can tell, there is no image identifier there, which can point back to the original image source like the URL example you gave.
https://unsplash.com/photos/1602452605960
https://unsplash.com/photos/c46e781e1ecf
https://unsplash.com/photos/1602452605960-c46e781e1ecf
The above links, for example, don't point to anything regarding the original image source.
I also took a quick look at the HTML and network requests, and there does not seem to be any more information that could help there. So in order to get that feature to work, it would require changing the way images are fetched. I'm open to hearing any suggestions.
I took a look at the browser plugin tabliss I used, which also has feature to fetch photos from Unsplash and has a refer link, they get the refer link like this
. It's not hard to read thanks for their code quailty.
Then I found the unsplash API they used, originally written here, do will return JSON info like this:
"links": {
"self": "https://api.unsplash.com/photos/Dwu85P9SOIk",
"html": "https://unsplash.com/photos/Dwu85P9SOIk",
"download": "https://unsplash.com/photos/Dwu85P9SOIk/download"
"download_location": "https://api.unsplash.com/photos/Dwu85P9SOIk/download"
},
I guess this is what we looking for?