CLI toolbox with YouTube Music downloading and Telegram uploading tools.
Project description
toolsx
toolsx packages a small CLI toolbox with a few ready-to-use commands:
ytm-dl- download a single YouTube Music song or a full playlist as tagged MP3 files.tg-uploader- upload a file to Telegram with a bot session.subtitle-extract- extract video subtitles or auto-captions as UTF-8 JSON, SRT, or text.toolsx- list the installed tools and dispatch to a tool by name.
Install
pip install tools_extra
The package is published as tools_extra, but the installed CLI commands stay toolsx, ytm-dl, and tg-uploader.
From the repo:
python -m pip install .
Commands
Running toolsx prints the available tools:
toolsx
You can also dispatch through the umbrella command:
toolsx ytm-dl --help
toolsx tg-uploader --help
toolsx subtitle-extract --help
Direct commands stay available too:
ytm-dl --help
tg-uploader --help
subtitle-extract --help
subtitle-extract
subtitle-extract uses yt-dlp metadata to inspect available subtitles, lets you choose a language when needed, and writes UTF-8 output as json, srt, or txt.
Examples:
subtitle-extract --url "https://www.youtube.com/watch?v=VIDEO_ID"
subtitle-extract --id VIDEO_ID --lang en --type srt
subtitle-extract --url "https://www.youtube.com/watch?v=VIDEO_ID" --lang ar --type txt --output ./captions.txt
subtitle-extract --url "https://www.youtube.com/watch?v=VIDEO_ID" --cookies-file ./cookies.txt --debug
subtitle-extract --url "https://www.youtube.com/watch?v=VIDEO_ID" --browser chrome --browser-profile Default
subtitle-extract --url "https://www.youtube.com/watch?v=VIDEO_ID" --js-runtime bun --js-runtime-path /opt/homebrew/bin/bun
--langskips the interactive language picker.--typedefaults tojson.--outputdefaults to<video-id>.<type>.--cookies-fileand--browsersupport videos that need authenticated subtitle access.--js-runtimedefaults tobun; use--js-runtime-pathto point yt-dlp at a specific runtime binary.- If
--langis omitted, the tool shows available languages and prompts you to choose one.
ytm-dl
Public song or playlist
No browser.json file is required for public URLs or IDs.
ytm-dl --url "https://music.youtube.com/playlist?list=PL..."
ytm-dl --url "https://music.youtube.com/watch?v=VIDEO_ID"
ytm-dl --id VIDEO_ID
Private playlists or library access
For private playlists, liked songs, or library selection, create browser.json first with the ytmusicapi browser auth guide:
Then run:
ytm-dl --auth-file browser.json --library-index 1
Useful flags
ytm-dl \
--url "https://music.youtube.com/playlist?list=PL..." \
--output-dir ./exports \
--yes-all \
--songs-limit 25 \
--lyrics-metadata \
--zip \
--zip-max-size 2000000000
--cookies-fileuses acookies.txtfile instead of browser cookie extraction.--browserand--browser-profileuse cookies directly from a browser when needed.--js-runtimedefaults tobun;--js-runtime-pathlets yt-dlp use an explicit runtime binary path.--yes-allskips the first-song confirmation and downloads the whole playlist immediately.--output-dirsets the base export directory; by default files go to./[Album-Name].--songs-limitdefaults to all songs when omitted.--lyrics-metadatafetches lyrics with timestamps and saves them into MP3 metadata.--keep-original-audioskips MP3 conversion/tagging and keeps the downloaded source audio extension.--mp3-bitratecontrols MP3 conversion bitrate when MP3 conversion is enabled.--debugenables verbose logs for lyrics, thumbnails, metadata, and full yt-dlp output.--zip-max-sizesplits archives into.partNN.zipfiles once the source bytes per archive reach the limit.
If required input is missing in interactive mode, ytm-dl asks for it.
tg-uploader
tg-uploader accepts values from CLI args first, then environment variables, then prompts.
Supported environment variables:
TOOLSX_TG_API_ID,TG_API_ID,TELEGRAM_API_IDTOOLSX_TG_API_HASH,TG_API_HASH,TELEGRAM_API_HASHTOOLSX_TG_BOT_TOKEN,TG_BOT_TOKEN,TELEGRAM_BOT_TOKENTOOLSX_TG_CHAT_ID,TG_CHAT_ID,TELEGRAM_CHAT_ID
Example:
export TOOLSX_TG_API_ID=12345
export TOOLSX_TG_API_HASH=your_api_hash
export TOOLSX_TG_BOT_TOKEN=123:token
export TOOLSX_TG_CHAT_ID=-1001234567890
tg-uploader --file ./archive.zip --caption "Nightly build"
Debug mode:
tg-uploader --file ./archive.zip --debug
Local development
git clone https://github.com/z44d/toolsx
cd toolsx
python -m pip install -e .
Adding more tools
- Add the new module under
src/. - Register it in
src/toolsx/registry.pysotoolsxlists it. - Add one console script entry under
[project.scripts]inpyproject.toml.
Release workflow
The GitHub workflow at .github/workflows/publish.yml builds and publishes to PyPI on version tags like v0.1.0.
Before using it, configure PyPI trusted publishing for the repository or provide the required PyPI credentials in GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tools_extra-0.1.1.tar.gz.
File metadata
- Download URL: tools_extra-0.1.1.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9154fec3ef57ac7aa850d91e5d1f9e2093e4372caa75af4fc6686fc37ca23882
|
|
| MD5 |
29d816b52eb68e7df0e68a8131ac88fe
|
|
| BLAKE2b-256 |
4deddb9b21126dde07ee19f007bb3ccfb1d11b161f4a315d5dbad597872313d6
|
Provenance
The following attestation bundles were made for tools_extra-0.1.1.tar.gz:
Publisher:
publish.yml on z44d/toolsx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tools_extra-0.1.1.tar.gz -
Subject digest:
9154fec3ef57ac7aa850d91e5d1f9e2093e4372caa75af4fc6686fc37ca23882 - Sigstore transparency entry: 1191527417
- Sigstore integration time:
-
Permalink:
z44d/toolsx@5edc8472e2e73975487f6b7cc57644b95831a870 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/z44d
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5edc8472e2e73975487f6b7cc57644b95831a870 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tools_extra-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tools_extra-0.1.1-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
879f29e1bc1a694fa9ae28a454f01a6fc7442900564a574b2082e78ee72a8da4
|
|
| MD5 |
b061270895c64dd13f0d2c287bb7048c
|
|
| BLAKE2b-256 |
b297b4d9a159cb89797db770f59431c6f42684c6960a1c4ced44768e9a2c197e
|
Provenance
The following attestation bundles were made for tools_extra-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on z44d/toolsx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tools_extra-0.1.1-py3-none-any.whl -
Subject digest:
879f29e1bc1a694fa9ae28a454f01a6fc7442900564a574b2082e78ee72a8da4 - Sigstore transparency entry: 1191527418
- Sigstore integration time:
-
Permalink:
z44d/toolsx@5edc8472e2e73975487f6b7cc57644b95831a870 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/z44d
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5edc8472e2e73975487f6b7cc57644b95831a870 -
Trigger Event:
push
-
Statement type: