mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-07-27 22:04:15 +09:00
feat: change value name
This commit is contained in:
parent
6175fa7066
commit
8845e952ae
@ -58,7 +58,7 @@ class FileDownloader(object):
|
||||
_TEST_FILE_SIZE = 10241
|
||||
params = None
|
||||
|
||||
def __init__(self, ydl, params):
|
||||
def __init__(self, ydl, params: dict):
|
||||
"""Create a FileDownloader object with the given options."""
|
||||
self.ydl = ydl
|
||||
self._progress_hooks = []
|
||||
|
@ -216,8 +216,8 @@ class Aria2pFD(ExternalFD):
|
||||
'''
|
||||
AVAILABLE_OPT = 'show'
|
||||
|
||||
def _call_downloader(self, tmpfilename, info_dict):
|
||||
try:
|
||||
def _call_downloader(self, tmpfilename: str, info_dict: dict):
|
||||
try:
|
||||
aria2 = aria2p.API(
|
||||
aria2p.Client(
|
||||
host="http://localhost",
|
||||
@ -238,20 +238,15 @@ class Aria2pFD(ExternalFD):
|
||||
options["min-split-size"] = "1M"
|
||||
options["max-connection-per-server"] = 4
|
||||
options["auto-file-renaming"] = "false"
|
||||
dn = os.path.dirname(tmpfilename)
|
||||
if dn:
|
||||
options["dir"] = dn
|
||||
download_dir = os.path.dirname(tmpfilename)
|
||||
if download_dir:
|
||||
options["dir"] = download_dir
|
||||
else:
|
||||
options["dir"] = os.path.abspath('.')
|
||||
options["out"] = os.path.basename(tmpfilename)
|
||||
options["header"] = []
|
||||
for key, val in info_dict['http_headers'].items():
|
||||
options["header"].append(f"{key}: {val}")
|
||||
# cmd += self._option('--interface', 'source_address')
|
||||
# cmd += self._option('--all-proxy', 'proxy')
|
||||
# cmd += self._bool_option('--check-certificate', 'nocheckcertificate', 'false', 'true', '=')
|
||||
# cmd += self._bool_option('--remote-time', 'updatetime', 'true', 'false', '=')
|
||||
# cmd += ["call", "adduri", "-J", "[[\"{}\"], {}]".format(info_dict['url'], str(options)).replace("'", '"')]
|
||||
download = aria2.add_uris([info_dict['url']], options)
|
||||
while download.status == "active":
|
||||
download = aria2.get_download(download.gid)
|
||||
|
Loading…
x
Reference in New Issue
Block a user