[downloader/aria2c] Native progress for aria2c via RPC (#3724)
Authored by: Lesmiscore, pukkandan Closes #2038
This commit is contained in:
parent
193fb150b7
commit
8c53322cda
4 changed files with 119 additions and 8 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue