Skip to content

Commit

Permalink
Oooops, was saving all downloads to the same output file... Fixed now
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Gomez-Dans committed Sep 8, 2016
1 parent 958e637 commit c8bb50c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions get_modis.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ def get_modisfiles(username, password, platform, product, year, tile, proxy,
if not r.ok:
raise IOError("Can't start download... [%s]" % fname)
file_size = int(r.headers['content-length'])
fname = the_url.split("/")[-1]
LOG.info("Starting download on %s(%d bytes) ..." %
(os.path.join(out_dir, fname), file_size))
with open(os.path.join(out_dir, fname), 'wb') as fp:
Expand Down

0 comments on commit c8bb50c

Please sign in to comment.