Skip to main content

Cast All The Things allows you to send videos from many, many online sources to your Chromecast.

Project description

Cast All The Things

image

Cast All The Things allows you to send videos from many, many online sources (YouTube, Vimeo, and a few hundred others) to your Chromecast. It also allows you to cast local files or render websites.

Installation

You can run Cast All The Things with uv without installing:

uxv catt

You can install Cast All The Things with pipx:

pipx install catt

Or with pip, but that's not as good:

pip3 install catt

catt requires Python 3.11 or higher. For older Python versions, you can install catt version 0.12.x which supports Python 3.7+.

Usage

To use Cast All The Things, just specify a URL:

catt cast "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

catt supports any service that yt-dlp supports, which includes most online video hosting services.

catt can also cast local files (if they're in a format the Chromecast supports natively):

catt cast ./myvideo.mp4

You can also control your Chromecast through catt commands, for example with catt pause. Try running catt --help to see the full list of commands.

If you have subtitles and the name is similar to the name of the local file, catt will add them automatically. You can, of course, specify any other subtitle if you want. Although Chromecast only supports WEBVTT, TTML and Line 21 subtitles, catt conveniently converts SRTs to WEBVTT for you on the fly. Here is how to use it:

catt cast -s ./mysubtitle.srt /myvideo.mp4

catt can also tell your Chromecast to display any website:

catt cast_site https://en.wikipedia.org/wiki/Rickrolling

Please note that the Chromecast has a slow CPU but a reasonably recent version of Google Chrome. The display resolution is 1280x720.

If you want to pass yt-dlp options to catt through the [-y]{.title-ref} command-line flag, you need to use yt-dlp's internal option name, rather than its command-line name.

If you notice that catt stops working with video sites (YouTube, Vimeo, etc), just upgrade yt-dlp with [pip install -U yt-dlp]{.title-ref} and that will probably fix it. This is because sites keep changing and yt-dlp is updated very regularly to keep them all working.

You can also run catt in Docker, if you prefer:

docker run --net=host --rm -it python:3.7 /bin/bash -c "pip install catt; catt cast 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'"

Configuration file

CATT can utilize a config-file stored at ~/.config/catt/catt.cfg (%APPDATA%\catt\catt.cfg on Windows, ~/Library/Application Support/catt/catt.cfg on macOS).

The format is as following:

[options]
device = chromecast_one

[aliases]
one = chromecast_one
two = chromecast_two

In the [options] section, device denotes the default device that will be selected, when you have not selected a device via the cli.

You can write your choice of default device to catt.cfg by doing:

catt -d <name_of_chromecast> set_default

In the [aliases] section, you can specify aliases for the names of your chromecasts. You can then select a device just by doing:

catt -d <alias> <command>

You can write an alias name for a device to catt.cfg by doing:

catt -d <name_of_chromecast> set_alias <alias>

Firewall

For the casting of local files to work you need to allow in the port range 45000-47000 over tcp.

Contributing

If you want to contribute a feature to catt, please open an issue (or comment on an existing one) first, to make sure it's something that the maintainers are interested in. Afterwards, just clone the repository and hack away!

To run catt in development, you can use the following command:

python -m catt.cli --help

Before committing, please make sure you install pre-commit and install its hooks:

pip install pre-commit
pre-commit install

That's all, now you can commit and the hooks will run. Black (which is used to format the code) requires Python 3.6 to run, but please make the effort, as our CI will yell at you if the code is not formatted, and nobody wants that.

Thanks!

Info

  • Free software: BSD license

Features

  • Casts videos to Chromecast
  • From many, many online sources
  • Casts local files (videos, photos and music)
  • Casts any website to Chromecast

Thanks

Catt would not be possible without these great projects:

  • pychromecast - Library for Python 3 to communicate with the Google Chromecast
  • yt-dlp - Command-line program to download videos from YouTube.com and other video sites
  • casttube - YouTube Chromecast API

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

catt-0.13.1.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

catt-0.13.1-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file catt-0.13.1.tar.gz.

File metadata

  • Download URL: catt-0.13.1.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for catt-0.13.1.tar.gz
Algorithm Hash digest
SHA256 865081d3a9789f369fbdc9c13425d6889b093663fc9fbdf56d082ae71bd466f3
MD5 7dffb05fcb81cdf8409d4d29ff031a03
BLAKE2b-256 4d68e7e441ac52c680a10f2cc51fe69ab59b07799c36cfa66b5b749d9a7a9f88

See more details on using hashes here.

Provenance

The following attestation bundles were made for catt-0.13.1.tar.gz:

Publisher: publish-pypi.yml on skorokithakis/catt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file catt-0.13.1-py3-none-any.whl.

File metadata

  • Download URL: catt-0.13.1-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for catt-0.13.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e906421d9115ad1c5df2d3f5e86d38ffcd129565b48179bca2a2335f51a3dc18
MD5 f7c967e10f0a104a5eff691a7b965cbf
BLAKE2b-256 a136b7498a1d973d886fb2d16dc28a41c8ca7028a5177ec8e458c4ed75977f3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for catt-0.13.1-py3-none-any.whl:

Publisher: publish-pypi.yml on skorokithakis/catt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page