1
0
Fork 0

[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
commit 8c53322cda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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]