Use default values for "continuedl" and "nooverwrites" downloader parameters
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sat, 19 Sep 2009 22:11:11 +0000 (00:11 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:24:56 +0000 (11:24 +0100)
youtube-dl

index 047cc37f891d9b2378cf023f4a05b5306c677d4e..03609e22ca8d8cde4f1a92db1fbb0f81a3de57cb 100755 (executable)
@@ -327,7 +327,7 @@ class FileDownloader(object):
                        filename = self.params['outtmpl'] % template_dict
                except (ValueError, KeyError), err:
                        self.trouble('ERROR: invalid output template or system charset: %s' % str(err))
-               if self.params['nooverwrites'] and os.path.exists(filename):
+               if self.params.get('nooverwrites', False) and os.path.exists(filename):
                        self.to_stderr(u'WARNING: file exists: %s; skipping' % filename)
                        return
 
@@ -402,7 +402,7 @@ class FileDownloader(object):
                        resume_len = os.path.getsize(filename)
                else:
                        resume_len = 0
-               if self.params['continuedl'] and resume_len != 0:
+               if self.params.get('continuedl', False) and resume_len != 0:
                        self.report_resuming_byte(resume_len)
                        request.add_header('Range','bytes=%d-' % resume_len)