mirror of
https://github.com/facefusion/facefusion.git
synced 2026-05-28 08:32:26 +02:00
8a9e08f3a2
* Protype for ffmpeg builder * Protype for ffmpeg builder * Add curl builder * Fix typing import * Adjust commands indent * Protype for ffmpeg builder part2 * Protype for ffmpeg builder part3 * Protype for ffmpeg builder part3 * Add chain() helper to the builders * Protype for ffmpeg builder part4 * Protype for ffmpeg builder part5 * Protoype for ffmpeg builder part5 * Protoype for ffmpeg builder part6 * Allow dynamic audio size * Fix testing * Protoype for ffmpeg builder part7 * Fix and polish ffmpeg builder * Hardcode the log level for ffmpeg * More ffmpeg rework * Prototype for ffmpeg builder part8 * Prototype for ffmpeg builder part9 * Fix CI * Fix Styles * Add lazy testing, User Agent for CURL * More testing * More testing
28 lines
716 B
Python
28 lines
716 B
Python
import itertools
|
|
import shutil
|
|
|
|
from facefusion import metadata
|
|
from facefusion.typing 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) ]
|