All of us have probably experienced the horrors beyond human comprehension that come with a classic Youtube session, so what do you say if, by taking this nigh infinite potential of the platform, while getting rid of all the fluff, we use it in the way it’s always been intended – running the entire thing from your terminal, no fancy useless UI, no fancy useless features and even no fancy useless graphics.
By combining the powers of the official Youtube API, the ever-dependable Python and the ingenuity (ahem) of yours truly, I try to get the entirety of the Youtube experience running in a terminal, in such a way that no matter the environment, you'll get to experience the platform in its most adequate form.
To setup the execution environment:
cd path/to/root
python -m venv env
pip install -r requirements.txt
To be able to use the Google Auth side of things, you need to create and download your client secret config file.
https://www.googleapis.com/auth/youtube.force-ssl
.client_secret.json
.Usage:
usage: main.py [-h] [--scaling-factor SCALING_FACTOR] [--char-ratio CHAR_RATIO] [--max-width MAX_WIDTH]
[--video-url VIDEO_URL] [--subtitles] [--subtitles-lang SUBTITLES_LANG] [--colors] [--high-accuracy]
[--invert-colors]
optional arguments:
-h, --help show this help message and exit
--scaling-factor SCALING_FACTOR, -f SCALING_FACTOR
Scaling factor relative to the CLI dimensions.
--char-ratio CHAR_RATIO, -r CHAR_RATIO
CLI characters aspect ratio.
--max-width MAX_WIDTH, -w MAX_WIDTH
Max video frame width in chars. Aspect ratio is fixed so it determines entire video size.
Negative means uncapped, default behavior.
--video-url VIDEO_URL, -u VIDEO_URL
URL for a video to be played directly on start.
--subtitles, -s Flag that signals to enable video subtitles. If no matches are found, it attempts to load
auto-generated captions.
--subtitles-lang SUBTITLES_LANG, -l SUBTITLES_LANG
The preferred language for the subtitles.
--colors, -c Use colors when rendering. *Warning: Performance-heavy.
--high-accuracy, -a High accuracy rendering. Will use Unicode characters instead of base ASCII for rendering
images.
--invert-colors, -i If flag is present, colors will be inverted. To be used if background is lighter than
characters.
Keyboard mappings:
*Notes: