[job] improve URL 'scheme' extraction performance
This commit is contained in:
@@ -513,8 +513,7 @@ class DownloadJob(Job):
|
|||||||
|
|
||||||
def download(self, url):
|
def download(self, url):
|
||||||
"""Download 'url'"""
|
"""Download 'url'"""
|
||||||
scheme = url.partition(":")[0]
|
if downloader := self.get_downloader(url[:url.find(":")]):
|
||||||
if downloader := self.get_downloader(scheme):
|
|
||||||
try:
|
try:
|
||||||
return downloader.download(url, self.pathfmt)
|
return downloader.download(url, self.pathfmt)
|
||||||
except OSError as exc:
|
except OSError as exc:
|
||||||
|
|||||||
Reference in New Issue
Block a user