File size: 715 Bytes
ec313eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import itertools
import shutil

from facefusion import metadata
from facefusion.types import Commands


def run(commands : Commands) -> Commands:
	user_agent = metadata.get('name') + '/' + metadata.get('version')

	return [ shutil.which('curl'), '--user-agent', user_agent, '--insecure', '--location', '--silent' ] + commands


def chain(*commands : Commands) -> Commands:
	return list(itertools.chain(*commands))


def head(url : str) -> Commands:
	return [ '-I', url ]


def download(url : str, download_file_path : str) -> Commands:
	return [ '--create-dirs', '--continue-at', '-', '--output', download_file_path, url ]


def set_timeout(timeout : int) -> Commands:
	return [ '--connect-timeout', str(timeout) ]