import: resume download

Download to .part file first and rename at the very end,
so if we lose connection we could resume download.
Note: not all servers support 'Range' header, so this
feature is not going to work everywhere.

This feature is activated by -c/--continue cmdline option.

Fixes #108

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2017-08-14 01:16:28 +03:00
parent 04bb836fe0
commit ebeb32a8ac
2 changed files with 36 additions and 4 deletions
+6
View File
@@ -223,6 +223,12 @@ def parse_args(argv=None):
type=int,
default=cpu_count(),
help='Number of jobs to run simultaneously.')
import_parser.add_argument('-c',
'--continue',
dest='cont',
action='store_true',
default=False,
help='Resume downloading file from url')
import_parser.set_defaults(func=CmdImportFile)
# Lock