ArchiveBox/archivebox/builtin_plugins/ytdlp/install_ytdlp.yml
2024-09-17 00:48:47 -07:00

42 lines
1.1 KiB
YAML
Executable file

#!/usr/bin/env ansible-playbook
---
- name: "Install YT-DLP"
hosts: localhost
gather_facts: no
vars:
YTDLP_VERSION_MIN: '2024.8.6'
tasks:
- include_role:
name: setup_lib_pip
vars:
MIN_PYTHON_VERSION: '3.10.0'
MIN_PIP_VERSION: '22.0'
- name: "Install pip packages: {{install_pip}}"
ansible.builtin.pip:
name: 'yt-dlp'
state: "present"
virtualenv: '{{BINPROVIDERS.pip.virtualenv}}'
virtualenv_python: "{{BINPROVIDERS.pip.virtualenv_python}}"
virtualenv_site_packages: yes
- name: Load YTDLP binary
import_role:
name: load_binary
vars:
name: ytdlp
- name: Load ffmpeg binary
import_role:
name: load_binary
vars:
name: ffmpeg
version_cmd: 'ffmpeg -version'
- name: Check that installed YT-DLP matches expected version
assert:
that: BINARIES.ytdlp.version is version(YTDLP_VERSION_MIN, '>=')
quiet: true
- debug:
msg: "{{ {'BINARIES': BINARIES, 'BINPROVIDERS': BINPROVIDERS} }}"