xref: /catt/
Name Date Size

..27-Apr.-20224 KiB

.editorconfigH A D25-Feb.-2021292

.gitchangelog.rcH A D25-Feb.-20216.4 KiB

.github/H25-Feb.-20214 KiB

.gitignoreH A D02-Jul.-20221.4 KiB

.gitlab-ci.ymlH A D15-Jan.-2022851

.pre-commit-config.yamlH A D09-Apr.-2022754

AUTHORS.rstH A D25-Feb.-2021160

catt/H28-Jun.-20224 KiB

catt_receiver/H21-Apr.-20214 KiB

CHANGELOG.mdH A D02-Jul.-20229.6 KiB

CONTRIBUTING.mdH A D02-Jul.-20223.2 KiB

examples/H25-Feb.-20214 KiB

LICENSEH A D25-Feb.-20211.3 KiB

pyproject.tomlH A D24-Jun.-20221.2 KiB

README.mdH A D15-Jan.-20224.8 KiB

realcc_tests/H22-Jun.-20224 KiB

requirements_dev.txtH A D19-Dec.-2021130

setup.cfgH A D19-May-2021463

tests/H18-Dec.-20214 KiB

tox.iniH A D06-Aug.-2021293

README.md

1Cast All The Things
2===================
3
4[![image](https://img.shields.io/pypi/v/catt.svg)](https://pypi.python.org/pypi/catt)
5[![image](https://img.shields.io/travis/skorokithakis/catt.svg)](https://travis-ci.org/skorokithakis/catt)
6[![image](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/skorokithakis/catt)
7
8Cast All The Things allows you to send videos from many, many online
9sources (YouTube, Vimeo, and a few hundred others) to your Chromecast.
10It also allows you to cast local files or render websites.
11
12Installation
13------------
14
15You can install Cast All The Things with pipx:
16
17    pipx install catt
18
19Or with pip, but that's not as good:
20
21    pip3 install catt
22
23`catt` is only compatible with Python 3. If you need a Python
242-compatible version, please install `0.5.6`, the last py2-compatible
25release.
26
27Usage
28-----
29
30To use Cast All The Things, just specify a URL:
31
32    catt cast "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
33
34`catt` supports any service that yt-dlp supports, which includes most
35online video hosting services.
36
37`catt` can also cast local files (if they're in a format the Chromecast
38supports natively):
39
40    catt cast ./myvideo.mp4
41
42You can also control your Chromecast through `catt` commands, for
43example with `catt pause`. Try running `catt --help` to see the full
44list of commands.
45
46If you have subtitles and the name is similar to the name of the local
47file, `catt` will add them automatically. You can, of course, specify
48any other subtitle if you want. Although Chromecast only supports
49WEBVTT, TTML and Line 21 subtitles, `catt` conveniently converts SRTs to
50WEBVTT for you on the fly. Here is how to use it:
51
52    catt cast -s ./mysubtitle.srt /myvideo.mp4
53
54`catt` can also tell your Chromecast to display any website:
55
56    catt cast_site https://en.wikipedia.org/wiki/Rickrolling
57
58Please note that the Chromecast has a slow CPU but a reasonably recent
59version of Google Chrome. The display resolution is 1280x720.
60
61If you want to pass yt-dlp options to catt through the [-y]{.title-ref}
62command-line flag, you need to use yt-dlp's [internal option
63name](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/__init__.py#L620),
64rather than its command-line name.
65
66If you notice that catt stops working with video sites (YouTube, Vimeo,
67etc), just upgrade yt-dlp with [pip install -U yt-dlp]{.title-ref} and
68that will probably fix it. This is because sites keep changing and
69yt-dlp is updated very regularly to keep them all working.
70
71You can also run `catt` in Docker, if you prefer:
72
73    docker run --net=host --rm -it python:3.7 /bin/bash -c "pip install catt; catt cast 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'"
74
75### Configuration file
76
77CATT can utilize a config-file stored at `~/.config/catt/catt.cfg`
78(`%APPDATA%\catt\catt.cfg` on Windows).
79
80The format is as following:
81
82```ini
83[options]
84device = chromecast_one
85
86[aliases]
87one = chromecast_one
88two = chromecast_two
89```
90
91In the `[options]` section, `device` denotes the default device that
92will be selected, when you have not selected a device via the cli.
93
94You can write your choice of default device to `catt.cfg` by doing:
95
96    catt -d <name_of_chromecast> set_default
97
98In the `[aliases]` section, you can specify aliases for the names of
99your chromecasts. You can then select a device just by doing:
100
101    catt -d <alias> <command>
102
103You can write an alias name for a device to `catt.cfg` by doing:
104
105    catt -d <name_of_chromecast> set_alias <alias>
106
107Contributing
108------------
109
110If you want to contribute a feature to `catt`, please open an issue (or
111comment on an existing one) first, to make sure it's something that the
112maintainers are interested in. Afterwards, just clone the repository and
113hack away!
114
115To run `catt` in development, you can use the following command:
116
117    python -m catt.cli --help
118
119Before committing, please make sure you install `pre-commit` and install
120its hooks:
121
122    pip install pre-commit
123    pre-commit install
124
125That's all, now you can commit and the hooks will run. Black (which is
126used to format the code) requires Python 3.6 to run, but please make the
127effort, as our CI will yell at you if the code is not formatted, and
128nobody wants that.
129
130Thanks!
131
132Info
133----
134
135-   Free software: BSD license
136
137Features
138--------
139
140- Casts videos to Chromecast
141- From [many, many online
142  sources](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md)
143- Casts local files (videos, photos and music)
144- Casts any website to Chromecast
145
146Thanks
147------
148
149Catt would not be possible without these great projects:
150
151- [pychromecast](https://github.com/balloob/pychromecast) - Library
152  for Python 3 to communicate with the Google Chromecast
153- [yt-dlp](https://github.com/yt-dlp/yt-dlp) - Command-line program to
154  download videos from YouTube.com and other video sites
155- [casttube](https://github.com/ur1katz/casttube) - YouTube Chromecast
156  API
157