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

Pick-up Download Images at Request Time Out #11

Open
ap266 opened this issue Jun 12, 2020 · 1 comment
Open

Pick-up Download Images at Request Time Out #11

ap266 opened this issue Jun 12, 2020 · 1 comment

Comments

@ap266
Copy link

ap266 commented Jun 12, 2020

Purpose

Hello, I'm using the api to download ~16k Google Street View photos and around photo 4500 the request timed out. How can I continue downloading from where the request timed out without having to reload the params, from the timed out point, onto the results again.

Example

params is ab 16k

results = google_streetview.api.results(params)
results.links[4176:].download_links('balt_streetview_downloads')

I want to pick up downloading photos from number 4176. The above doesn't work because results.links is a list and .download_links works on the results. object only.

Notes

@rrwen
Copy link
Owner

rrwen commented Jul 28, 2020

@ap266 Thanks for describing the problem! I should develop a retry and fault-tolerant method for download_links.

🔧 In the meantime, you could save the links with save_links and use requests and shutil to download and retry them from a particular line if they fail:

  1. Read the saved links from file line by line
  2. Make reference to current line
  3. If download fails:
    • Try the current line again until all lines have been read

❗ This package uses the requests and shutil libraries as well, and you are welcome to use the function at 📃 Line 74 to 79 in helpers.py!

@rrwen rrwen removed the question label May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants