summaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2020-01-21 01:08:43 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2020-01-21 01:08:43 -0500
commit4366125d2580982abb57bc65a26fc1fb8ef2a5df (patch)
tree743a26348e360c8b7f5eb89d4f704b015e902e68 /gallery_dl/downloader
parentbc435e826dbe37969d9cbe280f58810d054932cc (diff)
New upstream version 1.12.3upstream/1.12.3
Diffstat (limited to 'gallery_dl/downloader')
-rw-r--r--gallery_dl/downloader/common.py7
-rw-r--r--gallery_dl/downloader/http.py10
2 files changed, 8 insertions, 9 deletions
diff --git a/gallery_dl/downloader/common.py b/gallery_dl/downloader/common.py
index 596c956..eca1284 100644
--- a/gallery_dl/downloader/common.py
+++ b/gallery_dl/downloader/common.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2014-2019 Mike Fährmann
+# Copyright 2014-2020 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -20,10 +20,13 @@ class DownloaderBase():
def __init__(self, extractor, output):
self.session = extractor.session
self.out = output
- self.log = logging.getLogger("downloader." + self.scheme)
self.part = self.config("part", True)
self.partdir = self.config("part-directory")
+ self.log = logging.getLogger("downloader." + self.scheme)
+ self.log.job = extractor.log.job
+ self.log.extractor = extractor
+
if self.partdir:
self.partdir = util.expand_path(self.partdir)
os.makedirs(self.partdir, exist_ok=True)
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py
index fab96ba..9cd2aa6 100644
--- a/gallery_dl/downloader/http.py
+++ b/gallery_dl/downloader/http.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2014-2019 Mike Fährmann
+# Copyright 2014-2020 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -8,12 +8,11 @@
"""Downloader module for http:// and https:// URLs"""
-import os
import time
import mimetypes
from requests.exceptions import RequestException, ConnectionError, Timeout
from .common import DownloaderBase
-from .. import text
+from .. import text, util
from ssl import SSLError
try:
@@ -57,10 +56,7 @@ class HttpDownloader(DownloaderBase):
finally:
# remove file from incomplete downloads
if self.downloading and not self.part:
- try:
- os.unlink(pathfmt.temppath)
- except (OSError, AttributeError):
- pass
+ util.remove_file(pathfmt.temppath)
def _download_impl(self, url, pathfmt):
response = None