cinnamon-cli 0.2.19__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. cinnamon_cli-0.2.19/LICENSE +38 -0
  2. cinnamon_cli-0.2.19/PKG-INFO +166 -0
  3. cinnamon_cli-0.2.19/README.md +139 -0
  4. cinnamon_cli-0.2.19/cinnamon/__init__.py +1 -0
  5. cinnamon_cli-0.2.19/cinnamon/anilist.py +33 -0
  6. cinnamon_cli-0.2.19/cinnamon/cli.py +1822 -0
  7. cinnamon_cli-0.2.19/cinnamon/config.py +121 -0
  8. cinnamon_cli-0.2.19/cinnamon/downloads.py +83 -0
  9. cinnamon_cli-0.2.19/cinnamon/errors.py +145 -0
  10. cinnamon_cli-0.2.19/cinnamon/history.py +66 -0
  11. cinnamon_cli-0.2.19/cinnamon/player.py +550 -0
  12. cinnamon_cli-0.2.19/cinnamon/scrapers/__init__.py +97 -0
  13. cinnamon_cli-0.2.19/cinnamon/scrapers/anime.py +196 -0
  14. cinnamon_cli-0.2.19/cinnamon/scrapers/base.py +34 -0
  15. cinnamon_cli-0.2.19/cinnamon/scrapers/torrentio.py +123 -0
  16. cinnamon_cli-0.2.19/cinnamon/scrapers/vidsrc.py +131 -0
  17. cinnamon_cli-0.2.19/cinnamon/scrapers/webstream.py +282 -0
  18. cinnamon_cli-0.2.19/cinnamon/tmdb.py +83 -0
  19. cinnamon_cli-0.2.19/cinnamon/tui.py +543 -0
  20. cinnamon_cli-0.2.19/cinnamon_cli.egg-info/PKG-INFO +166 -0
  21. cinnamon_cli-0.2.19/cinnamon_cli.egg-info/SOURCES.txt +32 -0
  22. cinnamon_cli-0.2.19/cinnamon_cli.egg-info/dependency_links.txt +1 -0
  23. cinnamon_cli-0.2.19/cinnamon_cli.egg-info/entry_points.txt +2 -0
  24. cinnamon_cli-0.2.19/cinnamon_cli.egg-info/requires.txt +8 -0
  25. cinnamon_cli-0.2.19/cinnamon_cli.egg-info/top_level.txt +1 -0
  26. cinnamon_cli-0.2.19/pyproject.toml +45 -0
  27. cinnamon_cli-0.2.19/setup.cfg +4 -0
  28. cinnamon_cli-0.2.19/tests/test_directstream.py +97 -0
  29. cinnamon_cli-0.2.19/tests/test_directstream2.py +77 -0
  30. cinnamon_cli-0.2.19/tests/test_directstream3.py +56 -0
  31. cinnamon_cli-0.2.19/tests/test_directstream4.py +67 -0
  32. cinnamon_cli-0.2.19/tests/test_directstream5.py +102 -0
  33. cinnamon_cli-0.2.19/tests/test_directstream6.py +78 -0
  34. cinnamon_cli-0.2.19/tests/test_ui_smoke.py +274 -0
@@ -0,0 +1,38 @@
1
+ Creative Commons Attribution-NonCommercial 4.0 International
2
+ (CC BY-NC 4.0)
3
+
4
+ https://creativecommons.org/licenses/by-nc/4.0/
5
+
6
+ You are free to:
7
+
8
+ - Share — copy and redistribute the material in any medium or format
9
+ - Adapt — remix, transform, and build upon the material
10
+
11
+ for any purpose, as long as you comply with the license terms below.
12
+
13
+ Under the following terms:
14
+
15
+ - Attribution — You must give appropriate credit, provide a link to the
16
+ license, and indicate if changes were made. You may do so in any reasonable
17
+ manner, but not in any way that suggests the licensor endorses you or your use.
18
+
19
+ - NonCommercial — You may NOT use the material for commercial purposes.
20
+ This software is free and open for everyone to use, modify, and share,
21
+ but it may not be sold, monetized, or used as part of a commercial product
22
+ or service without the express permission of the copyright holder.
23
+
24
+ No additional restrictions — You may not apply legal terms or technological
25
+ measures that legally restrict others from doing anything the license permits.
26
+
27
+ Disclaimer of Warranty
28
+
29
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
+ SOFTWARE.
36
+
37
+ For the full legal text of CC BY-NC 4.0, see:
38
+ https://creativecommons.org/licenses/by-nc/4.0/legalcode
@@ -0,0 +1,166 @@
1
+ Metadata-Version: 2.4
2
+ Name: cinnamon-cli
3
+ Version: 0.2.19
4
+ Summary: CLI to search TV shows, movies & anime via TMDB/AniList, scrape m3u8 links, and play in VLC/mpv
5
+ Author: pizza-droid
6
+ License: CC BY-NC 4.0
7
+ Project-URL: Homepage, https://github.com/pizza-droid/cinnamon
8
+ Project-URL: Repository, https://github.com/pizza-droid/cinnamon
9
+ Project-URL: Issues, https://github.com/pizza-droid/cinnamon/issues
10
+ Keywords: tv,movies,anime,streaming,mpv,vlc,tmdb,anilist,cli
11
+ Classifier: Environment :: Console
12
+ Classifier: License :: Other/Proprietary License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Utilities
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: click>=8
20
+ Requires-Dist: requests>=2
21
+ Requires-Dist: rich>=13
22
+ Requires-Dist: questionary>=2
23
+ Requires-Dist: pycryptodome>=3
24
+ Provides-Extra: scrapers
25
+ Requires-Dist: playwright>=1.60; extra == "scrapers"
26
+ Dynamic: license-file
27
+
28
+ # cinnamon
29
+
30
+ > Watch TV shows, movies, and anime from your terminal. Search, pick a title, and it plays in mpv or VLC.
31
+
32
+ [![Version](https://img.shields.io/badge/version-0.2.19-blue)](#)
33
+ [![Python](https://img.shields.io/badge/python-%3E%3D3.10-blue)](#)
34
+ [![License](https://img.shields.io/badge/license-CC%20BY--NC%204.0-green)](#)
35
+ [![Platform](https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux%20%7C%20termux-lightgrey)](#)
36
+
37
+ ## Quick start
38
+
39
+ You'll need **Python 3.10+** and either [mpv](https://mpv.io) or [VLC](https://videolan.org).
40
+
41
+ ### Install
42
+
43
+ ```bash
44
+ pip install https://github.com/pizza-droid/cinnamon/archive/refs/tags/v0.2.19.tar.gz
45
+ cinnamon setup
46
+ ```
47
+
48
+ The setup wizard asks for a TMDB API key ([free account](https://www.themoviedb.org/signup)), your preferred player, and a color theme.
49
+
50
+ ### Get a player
51
+ > Please note that MacOS version has not been tested since we dont have access to a mac
52
+
53
+ | Platform | mpv | VLC |
54
+ |---|---|---|
55
+ | **Windows** | `scoop install mpv` or download from [mpv.io](https://mpv.io) | [videolan.org](https://videolan.org) |
56
+ | **macOS** | `brew install mpv` | `brew install --cask vlc` |
57
+ | **Linux** | `apt install mpv` (Debian/Ubuntu) | `apt install vlc` |
58
+ | **Termux** | `pkg install mpv` | `pkg install vlc` |
59
+
60
+ ### Watch a show or movie
61
+
62
+ ```bash
63
+ cinnamon search "Breaking Bad"
64
+ ```
65
+
66
+ Pick a title, pick an episode (for TV) or just play (for movies), and it plays. Anime is detected automatically:
67
+
68
+ ```bash
69
+ cinnamon search "Chainsaw Man"
70
+ ```
71
+
72
+ Movies work the same way — search returns both TV and movies, and you pick:
73
+
74
+ ```bash
75
+ cinnamon search "Inception"
76
+ cinnamon watch --type movie --query "Inception"
77
+ ```
78
+
79
+ ### Download episodes
80
+
81
+ Needs [yt-dlp](https://github.com/yt-dlp/yt-dlp):
82
+
83
+ | Platform | Command |
84
+ |---|---|
85
+ | Windows | `scoop install yt-dlp` |
86
+ | macOS | `brew install yt-dlp` |
87
+ | Linux | `pip install yt-dlp` |
88
+ | Termux | `pkg install yt-dlp` |
89
+
90
+ ```bash
91
+ cinnamon search "Breaking Bad" -d -e 1-5
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Commands
97
+
98
+ | If you run this… | …this happens |
99
+ |---|---|
100
+ | `cinnamon anime <query>` | Search anime via AniList (no API key needed) |
101
+ | `cinnamon search <query>` | Find a show, pick an episode, watch it |
102
+ | `cinnamon watch --id 123 -s 2 -e 5` | Go straight to S2E5 without menus |
103
+ | `cinnamon play-url <url>` | Play any m3u8/mp4 link |
104
+ | `cinnamon resume` | Continue an interrupted download |
105
+ | `cinnamon history` | Show watch history and resume from the next unwatched episode |
106
+ | `cinnamon history --clear` | Clear all watch history |
107
+ | `cinnamon scrapers` | See available streaming sources |
108
+ | `cinnamon install <name>` | Add an optional scraper (vidsrc, torrentio) |
109
+ | `cinnamon update` | Check for and install the latest version |
110
+ | `cinnamon config show` | View your settings |
111
+
112
+ ### Common flags
113
+
114
+ | Flag | What it does |
115
+ |---|---|
116
+ | `-s <N>` | Season number |
117
+ | `-e <N>` or `-e <start-end>` | Episode or range (e.g. `-e 1-10`) |
118
+ | `-d` | Download instead of streaming |
119
+ | `--scraper <name>` | Force a specific scraper |
120
+ | `--player mpv` or `--player vlc` | Choose player |
121
+ | `-q 720p` | Pick quality (480p, 720p, 1080p, best, worst) |
122
+ | `--info-only` | Just print the stream URL |
123
+
124
+ ---
125
+
126
+ ## Scrapers (streaming sources)
127
+
128
+ **Built-in (work out of the box):**
129
+
130
+ | Name | For |
131
+ |---|---|
132
+ | `webstream` | TV shows & movies from vixsrc.to and vidlink.pro (HLS) |
133
+ | `anime` | Anime from allanime.day via mp4upload |
134
+
135
+ **Optional (install with `cinnamon install <name>`):**
136
+
137
+ | Name | Needs |
138
+ |---|---|
139
+ | `vidsrc` | `pip install "cinnamon[scrapers]"` then `playwright install chromium` |
140
+ | `torrentio` | `npm install` (torrent playback) |
141
+
142
+ ```bash
143
+ cinnamon install torrentio
144
+ cinnamon config default-scraper torrentio
145
+ ```
146
+
147
+ ---
148
+
149
+ ## Configuration
150
+
151
+ Settings are stored in `~/.config/cinnamon/config.json` (Linux/macOS/Termux) or `%APPDATA%/cinnamon/config.json` (Windows). Change them anytime:
152
+
153
+ ```bash
154
+ cinnamon config default-player mpv
155
+ cinnamon config default-scraper webstream
156
+ cinnamon config set-api-key YOUR_KEY
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Notes
162
+
163
+ This project is mostly vibe coded and our lazy ass didnt even write more than 300 lines.
164
+ feel free to give us feedback so we can improve this project and make it as good as possible.
165
+
166
+ inspired by [ani-cli](https://github.com/pystardust/ani-cli)
@@ -0,0 +1,139 @@
1
+ # cinnamon
2
+
3
+ > Watch TV shows, movies, and anime from your terminal. Search, pick a title, and it plays in mpv or VLC.
4
+
5
+ [![Version](https://img.shields.io/badge/version-0.2.19-blue)](#)
6
+ [![Python](https://img.shields.io/badge/python-%3E%3D3.10-blue)](#)
7
+ [![License](https://img.shields.io/badge/license-CC%20BY--NC%204.0-green)](#)
8
+ [![Platform](https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux%20%7C%20termux-lightgrey)](#)
9
+
10
+ ## Quick start
11
+
12
+ You'll need **Python 3.10+** and either [mpv](https://mpv.io) or [VLC](https://videolan.org).
13
+
14
+ ### Install
15
+
16
+ ```bash
17
+ pip install https://github.com/pizza-droid/cinnamon/archive/refs/tags/v0.2.19.tar.gz
18
+ cinnamon setup
19
+ ```
20
+
21
+ The setup wizard asks for a TMDB API key ([free account](https://www.themoviedb.org/signup)), your preferred player, and a color theme.
22
+
23
+ ### Get a player
24
+ > Please note that MacOS version has not been tested since we dont have access to a mac
25
+
26
+ | Platform | mpv | VLC |
27
+ |---|---|---|
28
+ | **Windows** | `scoop install mpv` or download from [mpv.io](https://mpv.io) | [videolan.org](https://videolan.org) |
29
+ | **macOS** | `brew install mpv` | `brew install --cask vlc` |
30
+ | **Linux** | `apt install mpv` (Debian/Ubuntu) | `apt install vlc` |
31
+ | **Termux** | `pkg install mpv` | `pkg install vlc` |
32
+
33
+ ### Watch a show or movie
34
+
35
+ ```bash
36
+ cinnamon search "Breaking Bad"
37
+ ```
38
+
39
+ Pick a title, pick an episode (for TV) or just play (for movies), and it plays. Anime is detected automatically:
40
+
41
+ ```bash
42
+ cinnamon search "Chainsaw Man"
43
+ ```
44
+
45
+ Movies work the same way — search returns both TV and movies, and you pick:
46
+
47
+ ```bash
48
+ cinnamon search "Inception"
49
+ cinnamon watch --type movie --query "Inception"
50
+ ```
51
+
52
+ ### Download episodes
53
+
54
+ Needs [yt-dlp](https://github.com/yt-dlp/yt-dlp):
55
+
56
+ | Platform | Command |
57
+ |---|---|
58
+ | Windows | `scoop install yt-dlp` |
59
+ | macOS | `brew install yt-dlp` |
60
+ | Linux | `pip install yt-dlp` |
61
+ | Termux | `pkg install yt-dlp` |
62
+
63
+ ```bash
64
+ cinnamon search "Breaking Bad" -d -e 1-5
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Commands
70
+
71
+ | If you run this… | …this happens |
72
+ |---|---|
73
+ | `cinnamon anime <query>` | Search anime via AniList (no API key needed) |
74
+ | `cinnamon search <query>` | Find a show, pick an episode, watch it |
75
+ | `cinnamon watch --id 123 -s 2 -e 5` | Go straight to S2E5 without menus |
76
+ | `cinnamon play-url <url>` | Play any m3u8/mp4 link |
77
+ | `cinnamon resume` | Continue an interrupted download |
78
+ | `cinnamon history` | Show watch history and resume from the next unwatched episode |
79
+ | `cinnamon history --clear` | Clear all watch history |
80
+ | `cinnamon scrapers` | See available streaming sources |
81
+ | `cinnamon install <name>` | Add an optional scraper (vidsrc, torrentio) |
82
+ | `cinnamon update` | Check for and install the latest version |
83
+ | `cinnamon config show` | View your settings |
84
+
85
+ ### Common flags
86
+
87
+ | Flag | What it does |
88
+ |---|---|
89
+ | `-s <N>` | Season number |
90
+ | `-e <N>` or `-e <start-end>` | Episode or range (e.g. `-e 1-10`) |
91
+ | `-d` | Download instead of streaming |
92
+ | `--scraper <name>` | Force a specific scraper |
93
+ | `--player mpv` or `--player vlc` | Choose player |
94
+ | `-q 720p` | Pick quality (480p, 720p, 1080p, best, worst) |
95
+ | `--info-only` | Just print the stream URL |
96
+
97
+ ---
98
+
99
+ ## Scrapers (streaming sources)
100
+
101
+ **Built-in (work out of the box):**
102
+
103
+ | Name | For |
104
+ |---|---|
105
+ | `webstream` | TV shows & movies from vixsrc.to and vidlink.pro (HLS) |
106
+ | `anime` | Anime from allanime.day via mp4upload |
107
+
108
+ **Optional (install with `cinnamon install <name>`):**
109
+
110
+ | Name | Needs |
111
+ |---|---|
112
+ | `vidsrc` | `pip install "cinnamon[scrapers]"` then `playwright install chromium` |
113
+ | `torrentio` | `npm install` (torrent playback) |
114
+
115
+ ```bash
116
+ cinnamon install torrentio
117
+ cinnamon config default-scraper torrentio
118
+ ```
119
+
120
+ ---
121
+
122
+ ## Configuration
123
+
124
+ Settings are stored in `~/.config/cinnamon/config.json` (Linux/macOS/Termux) or `%APPDATA%/cinnamon/config.json` (Windows). Change them anytime:
125
+
126
+ ```bash
127
+ cinnamon config default-player mpv
128
+ cinnamon config default-scraper webstream
129
+ cinnamon config set-api-key YOUR_KEY
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Notes
135
+
136
+ This project is mostly vibe coded and our lazy ass didnt even write more than 300 lines.
137
+ feel free to give us feedback so we can improve this project and make it as good as possible.
138
+
139
+ inspired by [ani-cli](https://github.com/pystardust/ani-cli)
@@ -0,0 +1 @@
1
+ __version__ = "0.2.19"
@@ -0,0 +1,33 @@
1
+ import requests
2
+
3
+ API = "https://graphql.anilist.co"
4
+ UA = "cinnamon/0.1.0"
5
+
6
+ _SEARCH_QUERY = """
7
+ query ($search: String, $page: Int) {
8
+ Page(page: $page, perPage: 20) {
9
+ media(search: $search, type: ANIME) {
10
+ id
11
+ idMal
12
+ title { romaji english native }
13
+ episodes
14
+ status
15
+ format
16
+ startDate { year }
17
+ genres
18
+ }
19
+ }
20
+ }
21
+ """
22
+
23
+
24
+ def search_anime(query):
25
+ resp = requests.post(
26
+ API,
27
+ json={"query": _SEARCH_QUERY, "variables": {"search": query, "page": 1}},
28
+ timeout=15,
29
+ headers={"User-Agent": UA, "Content-Type": "application/json", "Accept": "application/json"},
30
+ )
31
+ resp.raise_for_status()
32
+ data = resp.json()
33
+ return data.get("data", {}).get("Page", {}).get("media", [])