]> gitweb.fluxo.info Git - grab-queue.git/commitdiff
Ensure download folder exists before writing to the log
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 8 Jul 2019 17:08:27 +0000 (14:08 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 8 Jul 2019 17:08:27 +0000 (14:08 -0300)
grab-queue

index cbaf1417df5c5fe80ac3901108c731eab752ea87..d9959a9291231ae1fba69a1f0f86381643d30288 100755 (executable)
@@ -75,11 +75,11 @@ class DownloadMultiple:
                 folder  = os.path.dirname(local_filename)
                 log_sep = ''
 
+            self.ensuredir(folder)
+
             with open(log_sep + 'grab-queue.log', "a") as log:
                 log.write('Downloading ' + url + '...')
 
-            self.ensuredir(local_filename)
-
             # Set opts
             # Other opts: -q --show-progress -O
             downloader_bin = self.downloader.split(' ')[0]