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

Archive contains very few images #6

Closed
luigibrosse opened this issue Sep 10, 2019 · 7 comments
Closed

Archive contains very few images #6

luigibrosse opened this issue Sep 10, 2019 · 7 comments

Comments

@luigibrosse
Copy link

I was wondering if there is a hard limit from your software on how many pictures are saved in the archive. Currently I have 75 pictures. Is that what is available on Microsoft server, or is it what you can download? Do you know if Microsoft sometimes refresh pictures, so my archive will eventually grow?

@ORelio
Copy link
Owner

ORelio commented Sep 11, 2019

Well, there is a limit, but not on the amount of images you can download. The API currently returns one random image. You cannot specifically request for a different image so as you request random images, it becomes more and more likely that images returned by the API are already in the archive. SpotlightDL does not know when to stop, so there is a hard limit of 50 consecutive unsuccessful API calls (images already archived) that will cause the download operation to stop. However, you can launch download again at a later time to discover more images as I suppose that they are periodically renewed. Since I created this app, my Archive folder progressively grew to around 1000 images at the moment.

@luigibrosse
Copy link
Author

luigibrosse commented Sep 11, 2019

Thanks a lot for your explanation. I dug into your code and I realized that there was this 50 hard limit. However, having launched maybe 50 times the script in the last few days, I have managed to get only one extra image. This seems very low to me, especially considering the amount of pictures you mentioned or for that matter if you go to https://spotlight.it-notes.ru, the website has roughly 1200 pictures as well. So this means that the Spotlight service has probably a lot in stock.
Even if we admit that they are rotating them periodically and / or not having all of them available, I still believe that I should get more in my archive. I tried also to connect to the endpoint directly (via webbrowser) and I am able to get many more pictures that way (that are not in my archive). For me, this is a mystery.

PS: by the way, I am not sure that discussing this in an issue in github is the right place. I wouldn't mind doing it via mail / chat (and we could do it in French as well).

@ORelio
Copy link
Owner

ORelio commented Sep 12, 2019

Indeed, 75 is unusually low. Just launched the download script 5 times and got respectively 303, 260, 342, 340 and 321 images, for a total of 369 unique images when counting all 5 attempts.

As per https://github.com/ORelio/Spotlight-Downloader#spotlight-api some parameters are set depending on your computer. SpotlightDL will set locale, current screen res (or fake huge res if asked to), language and country depending on what is set on your computer, so if you use the link in the Readme which has a different locale, language, date and/or country, images returned by the API may be different.

For discussing in French you may drop me your email by posting a comment on this blog post.

@luigibrosse
Copy link
Author

I think you were spot on. On the API link you sent, everything is set as en_US. However, my computer was set on se_SW, and as a consequence, I was getting very little hits. Once the region changed, I now have an archive with more than 400+ pics. However, I need to revert to my original region. Which means that if I use the update-archive-and-lockscreen script, my archive will not increase. Would you consider exposing the locale in your API, so that it would be possible to give that as a potential parameter to SpotlightDownloader?

PS: Apologies for not contributing a PR, but I can "understand" c# but I cannot write it.

ORelio added a commit that referenced this issue Sep 14, 2019
E.g --locale en-US will fetch en-US images instead
of images for the locale currently set on the computer.

See issue #6
@ORelio
Copy link
Owner

ORelio commented Sep 14, 2019

Implemented --locale as per release 1.4.1.

@ORelio ORelio changed the title Hard limit to number of files in archive? Archive contains very few images Sep 14, 2019
@luigibrosse
Copy link
Author

Will test and let you know.

@luigibrosse
Copy link
Author

Thanks. Looks good on my end. Can be closed.

PS: great job with your documentation / FAQ.

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