# trakt-watch
A small CLI to mark items watched on trakt. This lets you:
- Mark movies/episodes as watched (by searching, providing the URL, or choosing a recent TV show to mark the next episode as watched)
- Rate movies/episodes
- Remove recently watched items from your history
- Query your recent history
This uses [traktexport](https://github.com/purarue/traktexport) internally to authenticate, so follow the steps [here](https://github.com/purarue/traktexport#auth) to login/setup your credentials.
## Installation
Requires `python3.11+`
To install with pip, run:
```
pip install trakt-watch
```
## Usage
You can set the `TRAKT_USERNAME` environment variable so you don't have to pass it every time.
```
Usage: trakt-watch [OPTIONS] COMMAND [ARGS]...
Options:
-u, --username TEXT Trakt username [env var: TRAKT_USERNAME; required]
-h, --help Show this message and exit.
Commands:
progress mark next episode in progress
rate rate movie/tv show/episode
recent show recent history
unwatch remove recent watched item
watch mark movie/episode as watched
```
To watch entries, you can provide a URL, or search for a movie/TV show/episode. By default, will use now as the watched time:
```
Usage: trakt-watch watch [OPTIONS]
Mark an entry on trakt.tv as watched
Options:
--url URL URL to watch
-a, --at DATE Watched at time (date like string, or 'released')
-r, --rating INTEGER RANGE Rating [1<=x<=10]
-l, --letterboxd open corresponding letterboxd.com entry in your browser
-h, --help Show this message and exit.
```
Query recent history:
```
$ trakt-watch recent
2023-10-21 22:24:59 Stuff Made Here S2023E1 - I sent robot forgeries to a handwriting expert
2023-10-21 22:18:10 Possession
2023-10-21 19:33:15 Stuff Made Here S2023E2 - I made 6 absurd pencil sharpeners
2023-10-20 14:30:00 Killers of the Flower Moon
2023-10-18 23:49:06 RWBY S9E10 - Of Solitude and Self
2023-10-18 17:28:11 RWBY S9E9 - A Tale Involving a Tree
2023-10-17 18:32:29 RWBY S9E8 - Tea Amidst Terrible Trouble
2023-10-17 17:51:30 RWBY S9E7 - The Perils of Paper Houses
2023-10-15 22:39:51 The Wicker Man
2023-10-15 18:54:01 How to Blow Up a Pipeline
```
Set a movie as watched/rate it:
```
$ trakt-watch watch --at '10m ago' --url https://trakt.tv/movies/possession-1981
Added count:
Movies: 1
Set rating? [Y/n]:
Rating: 9
Added count:
Movies: 1
Recent history:
1: 2023-10-31 11:35:28 Possession
```
Search for an TV show and provide a season/episode number:
```
$ trakt-watch watch
[M]ovie
[S]how
[E]pisode name
Ep[I]sode - Show w/ Season/Episode num
[U]rl
[A]ll
What type of media do you want to search for?
Search for show: barry
Results:
1: Show: 'Barry (2018)' | shows/122709
2: Show: 'Carrie and Barry (2004)' | shows/9085
3: Show: 'Red Barry (1938)' | shows/128828
4: Show: 'Barry Hilton (1999)' | shows/110779
5: Show: 'Carrie & Barrie (2004)' | shows/128392
6: Show: 'Barry Tales (2013)' | shows/100038
7: Show: 'Todd Barry (2012)' | shows/105417
8: Show: 'Barry Manilow Specials (1977)' | shows/67327
9: Show: 'Barry Welsh is Coming (1996)' | shows/13243
10: Show: 'Britains Greatest Machines With Chris Barrie (2009)' | shows/49775
11: Show: 'Deception With Keith Barry (2010)' | shows/63137
'Pick result - enter 1-11, or q to quit [1]':
Season: 1
Episode: 8
```
The `progress` command works similarly to `watch`, but it presents you with a list of recently watched episodes, querying trakt for the 'next episode' like on the progress page on the trakt website.
### letterboxd
The `letterboxd` command can be used to search for a trakt entry, and then open the corresponding letterboxd URL using the TMDB ID. This is useful since letterboxd doesn't have an API, so we can use trakt's as a stand-in. I put this shell function in my shell startup:
```bash
lb () {
trakt-watch letterboxd --action open "$@"
}
```
### Tests
```bash
git clone 'https://github.com/purarue/trakt-watch'
cd ./trakt_watch
pip install '.[testing]'
pytest
flake8 ./trakt_watch
mypy ./trakt_watch
```
Raw data
{
"_id": null,
"home_page": "https://github.com/purarue/trakt-watch",
"name": "trakt-watch",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": null,
"author": "purarue",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/54/14/ac170a2e7aa5c7a33802dcc9281df1c016ab02483ce1a83be8dc846456c3/trakt_watch-0.1.2.tar.gz",
"platform": null,
"description": "# trakt-watch\n\nA small CLI to mark items watched on trakt. This lets you:\n\n- Mark movies/episodes as watched (by searching, providing the URL, or choosing a recent TV show to mark the next episode as watched)\n- Rate movies/episodes\n- Remove recently watched items from your history\n- Query your recent history\n\nThis uses [traktexport](https://github.com/purarue/traktexport) internally to authenticate, so follow the steps [here](https://github.com/purarue/traktexport#auth) to login/setup your credentials.\n\n## Installation\n\nRequires `python3.11+`\n\nTo install with pip, run:\n\n```\npip install trakt-watch\n```\n\n## Usage\n\nYou can set the `TRAKT_USERNAME` environment variable so you don't have to pass it every time.\n\n```\nUsage: trakt-watch [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n -u, --username TEXT Trakt username [env var: TRAKT_USERNAME; required]\n -h, --help Show this message and exit.\n\nCommands:\n progress mark next episode in progress\n rate rate movie/tv show/episode\n recent show recent history\n unwatch remove recent watched item\n watch mark movie/episode as watched\n```\n\nTo watch entries, you can provide a URL, or search for a movie/TV show/episode. By default, will use now as the watched time:\n\n```\nUsage: trakt-watch watch [OPTIONS]\n\n Mark an entry on trakt.tv as watched\n\nOptions:\n --url URL URL to watch\n -a, --at DATE Watched at time (date like string, or 'released')\n -r, --rating INTEGER RANGE Rating [1<=x<=10]\n -l, --letterboxd open corresponding letterboxd.com entry in your browser\n -h, --help Show this message and exit.\n```\n\nQuery recent history:\n\n```\n$ trakt-watch recent\n2023-10-21 22:24:59 Stuff Made Here S2023E1 - I sent robot forgeries to a handwriting expert\n2023-10-21 22:18:10 Possession\n2023-10-21 19:33:15 Stuff Made Here S2023E2 - I made 6 absurd pencil sharpeners\n2023-10-20 14:30:00 Killers of the Flower Moon\n2023-10-18 23:49:06 RWBY S9E10 - Of Solitude and Self\n2023-10-18 17:28:11 RWBY S9E9 - A Tale Involving a Tree\n2023-10-17 18:32:29 RWBY S9E8 - Tea Amidst Terrible Trouble\n2023-10-17 17:51:30 RWBY S9E7 - The Perils of Paper Houses\n2023-10-15 22:39:51 The Wicker Man\n2023-10-15 18:54:01 How to Blow Up a Pipeline\n```\n\nSet a movie as watched/rate it:\n\n```\n$ trakt-watch watch --at '10m ago' --url https://trakt.tv/movies/possession-1981\nAdded count:\nMovies: 1\n\nSet rating? [Y/n]:\nRating: 9\nAdded count:\nMovies: 1\n\nRecent history:\n1: 2023-10-31 11:35:28 Possession\n```\n\nSearch for an TV show and provide a season/episode number:\n\n```\n$ trakt-watch watch\n[M]ovie\n[S]how\n[E]pisode name\nEp[I]sode - Show w/ Season/Episode num\n[U]rl\n[A]ll\nWhat type of media do you want to search for?\nSearch for show: barry\nResults:\n1: Show:\t'Barry (2018)' | shows/122709\n2: Show:\t'Carrie and Barry (2004)' | shows/9085\n3: Show:\t'Red Barry (1938)' | shows/128828\n4: Show:\t'Barry Hilton (1999)' | shows/110779\n5: Show:\t'Carrie & Barrie (2004)' | shows/128392\n6: Show:\t'Barry Tales (2013)' | shows/100038\n7: Show:\t'Todd Barry (2012)' | shows/105417\n8: Show:\t'Barry Manilow Specials (1977)' | shows/67327\n9: Show:\t'Barry Welsh is Coming (1996)' | shows/13243\n10: Show:\t'Britains Greatest Machines With Chris Barrie (2009)' | shows/49775\n11: Show:\t'Deception With Keith Barry (2010)' | shows/63137\n'Pick result - enter 1-11, or q to quit [1]':\nSeason: 1\nEpisode: 8\n```\n\nThe `progress` command works similarly to `watch`, but it presents you with a list of recently watched episodes, querying trakt for the 'next episode' like on the progress page on the trakt website.\n\n### letterboxd\n\nThe `letterboxd` command can be used to search for a trakt entry, and then open the corresponding letterboxd URL using the TMDB ID. This is useful since letterboxd doesn't have an API, so we can use trakt's as a stand-in. I put this shell function in my shell startup:\n\n```bash\nlb () {\n trakt-watch letterboxd --action open \"$@\"\n}\n```\n\n### Tests\n\n```bash\ngit clone 'https://github.com/purarue/trakt-watch'\ncd ./trakt_watch\npip install '.[testing]'\npytest\nflake8 ./trakt_watch\nmypy ./trakt_watch\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "a small CLI to mark items watched on trakt",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/purarue/trakt-watch"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "33536e0ff426d6f678b7d6ec2767c1fbca820471be78b013d8fdc2e50a117334",
"md5": "a1d98be3407dc1dae06cd29e299f276c",
"sha256": "ac7a6e17edd0711a371298d732d13da5ccf13618e15833d281ef80046540e7a9"
},
"downloads": -1,
"filename": "trakt_watch-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a1d98be3407dc1dae06cd29e299f276c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 12698,
"upload_time": "2024-12-28T08:59:59",
"upload_time_iso_8601": "2024-12-28T08:59:59.672482Z",
"url": "https://files.pythonhosted.org/packages/33/53/6e0ff426d6f678b7d6ec2767c1fbca820471be78b013d8fdc2e50a117334/trakt_watch-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5414ac170a2e7aa5c7a33802dcc9281df1c016ab02483ce1a83be8dc846456c3",
"md5": "d030b5d0329586b880bd3e40fc43a024",
"sha256": "18c5b1d4cdfae9992a1ffc01163d5d918bbd6be8dc920a6cd81f0cd04e5fc391"
},
"downloads": -1,
"filename": "trakt_watch-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "d030b5d0329586b880bd3e40fc43a024",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 13640,
"upload_time": "2024-12-28T09:00:01",
"upload_time_iso_8601": "2024-12-28T09:00:01.855020Z",
"url": "https://files.pythonhosted.org/packages/54/14/ac170a2e7aa5c7a33802dcc9281df1c016ab02483ce1a83be8dc846456c3/trakt_watch-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-28 09:00:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "purarue",
"github_project": "trakt-watch",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "trakt-watch"
}