@@ -685,7 +685,8 @@ def _HEADER_data_size(self, files):
685
685
return data_sizes , totalsize .to (u .GB )
686
686
687
687
def download_files (self , files , savedir = None , cache = True ,
688
- continuation = True , skip_unauthorized = True ,):
688
+ continuation = True , skip_unauthorized = True ,
689
+ verify_only = False ):
689
690
"""
690
691
Given a list of file URLs, download them
691
692
@@ -706,6 +707,10 @@ def download_files(self, files, savedir=None, cache=True,
706
707
If you receive "unauthorized" responses for some of the download
707
708
requests, skip over them. If this is False, an exception will be
708
709
raised.
710
+ verify_only : bool
711
+ Option to go through the process of checking the files to see if
712
+ they're the right size, but not actually download them. This
713
+ option may be useful if a previous download run failed partway.
709
714
"""
710
715
711
716
if self .USERNAME :
@@ -744,14 +749,15 @@ def download_files(self, files, savedir=None, cache=True,
744
749
filename )
745
750
746
751
try :
747
- self ._download_file (file_link ,
748
- filename ,
749
- timeout = self .TIMEOUT ,
750
- auth = auth ,
751
- cache = cache ,
752
- method = 'GET' ,
753
- head_safe = False ,
754
- continuation = continuation )
752
+ if not verify_only :
753
+ self ._download_file (file_link ,
754
+ filename ,
755
+ timeout = self .TIMEOUT ,
756
+ auth = auth ,
757
+ cache = cache ,
758
+ method = 'GET' ,
759
+ head_safe = False ,
760
+ continuation = continuation )
755
761
756
762
downloaded_files .append (filename )
757
763
except requests .HTTPError as ex :
0 commit comments