Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using id originally from unsplash.com to help finding photo source #16

Open
daviszerro opened this issue May 11, 2021 · 2 comments
Open

Comments

@daviszerro
Copy link

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.

@AlfredoSequeida
Copy link
Owner

AlfredoSequeida commented May 16, 2021

@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.

@daviszerro
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants