[downloader/aria2c] Native progress for aria2c via RPC (#3724)

Authored by: Lesmiscore, pukkandan

Closes #2038
This commit is contained in:
Lesmiscore
2023-01-02 02:16:25 +09:00
committed by GitHub
parent 193fb150b7
commit 8c53322cda
4 changed files with 119 additions and 8 deletions

View File

@@ -5243,6 +5243,15 @@ def random_birthday(year_field, month_field, day_field):
}
def find_available_port(interface=''):
try:
with socket.socket() as sock:
sock.bind((interface, 0))
return sock.getsockname()[1]
except OSError:
return None
# Templates for internet shortcut files, which are plain text files.
DOT_URL_LINK_TEMPLATE = '''\
[InternetShortcut]