Skip to main content

ytcl

ytcl is a command-line frontend for ytdl-server.

Its syntax is based on youtube-dl/yt-dlp, and it shares many of the same arguments.

[TOC]

Installation

ytcl requires Python 3.7+.

If you're using an Arch-based distro, ytcl is available in the AUR.

Install from PyPI:

pip3 install ytcl

Install from source:

git clone 'https://gitlab.com/adralioh/ytcl.git'
pip3 install ./ytcl

If you want color output to work on Windows, you can also optionally install Colorama:

pip3 install 'ytcl[windows_color]'

Usage

First, you must set the $YTDL_SERVER env-var to the URL of the ytdl-server so that ytcl can connect to it:

export YTDL_SERVER=http://ytdl-server.example.com

Create a job

Download videos by creating a job:

ytcl create 'https://youtu.be/dQw4w9WgXcQ'

You can pass most arguments that youtube-dl accepts. Example:

ytcl create -f 'bestaudio/best' --extract-audio 'https://youtu.be/dQw4w9WgXcQ'

You can also start a job without waiting for it to finish:

ytcl -d create 'https://youtu.be/dQw4w9WgXcQ'

Run ytcl create --help for an exhaustive list of arguments.

Get the status of a job

You can check the status of a job using the job ID:

ytcl get 'b7cce5f7-9f7c-47ed-ae13-2acf7c32cc29'

The job ID is obtained from the output of the command where you create the job.

The above command will run until the job finishes. If you just want to get the complete current status of the job, you can change the output format:

ytcl -f all get 'b7cce5f7-9f7c-47ed-ae13-2acf7c32cc29'

JSON output is also supported:

ytcl -f json get 'b7cce5f7-9f7c-47ed-ae13-2acf7c32cc29'

Cancel a job

You can also cancel a running job:

ytcl cancel 'b7cce5f7-9f7c-47ed-ae13-2acf7c32cc29'

The above command will wait until the job is cancelled. You can also exit immediately without waiting:

ytcl -d cancel 'b7cce5f7-9f7c-47ed-ae13-2acf7c32cc29'

Basic authentication

If the ytdl-server uses basic authentication, you can provide the credentials via the $YTDL_SERVER_USERNAME and $YTDL_SERVER_PASSWORD env-vars:

export YTDL_SERVER_USERNAME=user
export YTDL_SERVER_PASSWORD=password

If only the username is provided, you will be prompted for the password interactively.

Exit codes

ytcl exits with the following exit codes when an error occurs:

Code Description
2 Invalid argument
10 Unspecified error
11 ytcl tried to use a ytdl_opt that is blacklisted by the ytdl-server when creating a job
12 ytcl tried to use a custom_opt that is blacklisted by the ytdl-server when creating a job
13 ytcl tried to cancel a job that has already completed
14 The job failed
15 ytcl received an error response from the ytdl-server
16 The URL of the ytdl-server wasn't provided. This can be set via the $YTDL_SERVER env-var

Release files for ytcl 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ytcl 1.1.0
File Size Uploaded
ytcl-1.1.0.tar.gz 42.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ytcl 1.1.0
File Interpreter ABI Platform
ytcl-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size:90.3 kB

Release files / ytcl-1.1.0.tar.gz

Download URL ytcl-1.1.0.tar.gz
Size 42.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cf10085c39855c7257f7c7e5d0e44fafc6edbd44eceeb0576e66f2aa7700653e
BLAKE2b-256 checksum
How to use checksums
31d5b9a6d6becf08103665c7160efc21730ea1ea07c79fd2437f6f51f9128f32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Release files / ytcl-1.1.0-py3-none-any.whl

Download URL ytcl-1.1.0-py3-none-any.whl
Size 47.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cf21cb03cc9c885fb1206944e32ef7bfece03527782acfa610da6a6746afb7a
BLAKE2b-256 checksum
How to use checksums
fe88e789b4b6700c601405ea80509b3ebe234821bdbc321c437d03adb353b9d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page