Synchronize viewing status and ratings through Plex + Trakt, easily record your watching history

Friends who like to watch movies, follow dramas, and follow variety shows must have the habit of making records. Among Plex users, there are probably many people who use Douban. It is very convenient to use Douban to mark movies, write movie reviews, short comments, and participate in online discussions. However, Douban’s support for TV dramas is relatively weak. Many dramas have incomplete information about individual episodes, and there are only three viewing statuses: want to watch, watching, and watched. It doesn't have much effect, and it is impossible to record the viewing status of a single episode. Although there are short reviews for a single episode, it is relatively unpopular.

TeeVee

When watching dramas, there is actually a function that everyone needs very much, which is to record the progress of watching. I discovered an App a long time ago, which can be said to be my assistant for watching dramas. It is called TeeVee. Its main function is to monitor TV dramas or TV programs, the information of each episode will be displayed on it, and you can mark the viewing status of each episode, and all the episodes you are currently watching will be displayed on the overview page, which can be sorted by the latest broadcast time, Which dramas have not been finished yet, when will the next episode be updated, whether this drama is over or there will be a next season, and other information can be viewed intuitively on the above, and it will also count your historical viewing data, you You can even add the broadcast schedule to the calendars of your mobile phone and computer, so that you can see at a glance what dramas are updated every day.

I learned about Trakt when I came into contact with this app, because the data source of TeeVee is Trakt. If you connect your Trakt account in TeeVee, then the marks made in TeeVee will be synchronized to Trakt in real time.

Tract

So what is Trakt ? You can probably understand it as an upgraded version of the American version of Douban Movies. Its core function is to track TV dramas, TV shows and movies. You can search for information about movies and TV dramas on it. There is a complete information display and you can rate the content. , mark viewing status, post comments, create playlists and share episodes, view or like, comment on other people’s evaluations of film and television dramas, and view public information such as other users’ viewing records, collections, and evaluations through the user’s personal homepage. You can add friends and so on.

It sounds similar to Douban, but Trakt has many functions that Douban does not have. For example, the support for TV dramas and TV shows is better than Douban.

First of all, you can see a lot of the latest news of the tracked episodes on your personal homepage and dynamic page, including which episodes are updated, when the latest episode will be broadcast, historical playback record analysis, recent viewing records and historical rating information etc.

Secondly, Trakt’s TV dramas and TV shows have a complete page hierarchy display. There is a page for the whole drama, a page for a single season in the lower level, and a page for a single episode in the lower level. Each level contains complete graphic information. Between levels It is also more convenient to switch, and the content of each level can be evaluated separately, that is to say, you can not only comment on a single episode, but also score a single episode, and mark, bookmark, and add a single episode The details of the film list and other operations are in place.

In addition, on other supported players or platforms, by accessing Trakt accounts or plug-ins, the viewing status can be automatically synchronized after playback, that is, automatic marking, and the marked content will also have its own type label, so that no matter which platform you watch For a movie, all platforms will mark the movie as watched, and even the ratings can be synchronized across platforms.

And Trakt has a viewing progress function, which can display the tracked TV series or TV program information according to different requirements according to the viewing status and data. Here you can also see the status of each drama, such as the viewing progress of the next episode. Time, whether there will be a next season of a drama, whether the suspended drama has been canceled or ended, etc. Some dramas that have been broadcast and stopped are no longer afraid of losing track of where to see them.

Finally, most of Trakt's content can be directly found on the page to watch channels, and you can directly jump to the streaming media platform for playback.

Trakt also has a calendar function, you can check which programs are being broadcast every day of the week, you can check the broadcast status of the dramas you track, you can check the current hot and popular film and television drama information, and so on.

However, because it is a foreign platform, the support for domestic content is slightly weaker. The information of domestic film and television dramas may be incomplete or not updated in time. The interface does not support Chinese, and all of them are American users. This is why I did not use it much before s reason.

之前一直是直接使用 TeeVee 追剧的,因为我看的剧还是美剧和英剧居多,所以用 TeeVee 很方便,对 Trakt 的需求不大,但是需要手动标记,现在用了 Plex,发现有一款插件可以同步 Plex 和 Trakt 的观看状态和评分,并且留存在 Trakt 上,就是在 Plex 看完影片或剧集后通过同步会自动在 Trakt 上把相应内容标记为已观看,如果在 Plex 上进行了评分也可以同步过去,就不需要手动标记了,非常方便,而且如此还可以做到 Plex、Trakt 和 TeeVee 的三方同步,如果你同时还在使用支持 Trakt 的其他播放器或服务平台,那么所有平台的播放记录都可以通过 Trakt 进行同步,喜欢看美剧和英剧的朋友可以试一试。

Plex Trakt Sync

Trakt 有一个官方的 Plex 同步插件,但是要 Trakt VIP 才能使用,同时还需要 Plex Pass,我们也可以使用第三方插件 PlexTraktSync,这个插件对 Trakt 和 Plex 账户都没有要求,可以免费使用,只是这个插件做不到实时同步,需要通过运行同步脚本进行同步,但是这个脚本可以设置为后台定时自动运行,其实也不需要人工干预,就可以自动同步。

下面就来讲解一下如何设置吧(还是以 macOS 为例)。

准备工作

1.1. 请下载安装最新版本的 Python

1.2. 请通过终端命令「/bin/bash -c "$(curl -fsSLhttps://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"」安装 Homebrew。

1.3. 请通过终端命令「brew install pipx」安装 pipx 并运行「pipx ensurepath」命令。

安装

请在终端窗口输入「pipx install PlexTraktSync」按回车。(其他平台的安装可以参考官方说明

绑定账号

2.1. 注册一个 Trakt 账号并登录。

2.2. 将鼠标移至页面右上角个人头像处,找到「Settings」点击打开页面,点击页面上方的「Your API Apps」,点击「NEW APPLICATION」。

2.3. 在「Name」处输入「Plex」,在「Redirect uri」处输入「urn:ietf:wg:oauth:2.0:oob」,点击「SAVE APP」,就会跳转下面这个页面(我在设置的时候上传了 Plex 的 LOGO 图片,所以有图标,不上传就没有,这个不影响使用)。

2.4. 打开终端,输入「plextraktsync login」按回车,根据提示输入 Plex 用户名和密码,通过上下键选择你的 Plex Media Server(根据 IP 选择)按回车。

2.5. 接下来可能会有几个报错,不用管,稍等片刻会出现「Connection to xxx established successfully!」的提示,然后选择一个你要进行同步的账户按回车(这里选择的就是默认同步账户)。

2.6. 接着请根据提示输入「client id」和「client secret」,就是把「03」这个页面的 id 复制粘贴过来。

2.7. 然后终端里会显示一个验证码,请打开终端显示的网站进行授权验证。

2.8. 接下来终端会显示「You are now logged into Trakt. Your Trakt credentials have been added in .env and .pytrakt.json files. Done!」,这样你的 Plex 和 Trakt 账号就绑定成功了。

设置

在同步之前我们最好先去设置一下同步选项,macOS 用户可以在「/Users/xxx/Library/Application Support/PlexTraktSync/config.yml 」这个位置找到配置文件,其他用户可以在这里查看配置文件存储位置说明。

找到「config.yml」文件后右击选择使用文本编辑打开,找到下图部分,可以对「从 Plex 同步到 Trakt」和「从 Trakt 同步到 Plex」分别进行设置。

首先建议把「collection」设置为「false」,就是不同步 collection,因为这个选项会把 Plex 库内的所有文件都添加到 Trakt 的 collection 中。

如果之前没有使用过 Trakt 可以参考我的设置,仅双向同步「ratings」和「watched status」,就是只同步评分和观看状态,这样在 Plex 看过的影片(标记为已观看的,观看后自动标记为已观看的)在同步后都会自动在 Trakt 上标记为已观看,如果在 Plex 打分了也会同步到 Trakt,Plex 是 5 分制同步到的 Trakt 上会换算成 10 分制。同时如果在 Trakt 上标记和评分了影片,如果这部电影或剧集也在你的资料库内,Trakt 上的观看状态和评分也会同步到 Plex 上,双向同步。

如果你同时还在使用 TeeVee,那么这三个平台都是可以同步的,因为 TeeVee 和 Trakt 是实时同步,所以 Plex 同步到 Trakt 上的内容也会同步到 TeeVee 上,反之亦然。

如果有特殊需求也可以根据需要设置单向同步或其他同步方式,随时可以进行修改,修改会在下一次同步中生效。

手动同步

现在我们就可以进行同步了,在终端窗口输入「plextraktsync sync」按回车就会开始同步了,同步成功的前提是文件名称包含规范信息,比如电影要包含片名和上映年份,电视剧要包含季数和集数,而且要是「SxxExx」的格式,否则会因为检测不到正确的集数而匹配失败,不过 Plex 能刮削成功的一般问题都不大。

第一次同步时间可能会稍长,如果库比较大会比较久,之后的同步会快一点,终端通过命令同步是手动方式,通过「plextraktsync sync --help」命令可以调出同步可选项参数,可以根据提示指定同步某个资料库或具体的剧集等等,「plextraktsync sync」是同步默认服务器的所有内容,在后面加上不同的指令就可以同步指定内容。

自动同步

除了手动的方式我们也可以设置自动同步,比如每小时同步一次、每三个小时同步一次、每天同步一次等等,间隔时长可以自定义,同步进程将在后台自动运行,我们只要把「plextraktsync」设置为系统的定时任务即可,这样就可以定时在后台自动同步所有资料库。

3.1. 请将输入法切换至英文,在终端窗口输入「crontab -e」按回车,按「i」进入编辑状态。

3.2. 请输入「* */3 * * * /Users/xxx/.local/pipx/venvs/plextraktsync/bin/plextraktsync > /dev/null 2>&1」,然后按「esc」返回键退出编辑状态。(命令中间是 plextraktsync 可执行文件的存储路径,请参考我的路径找到 plextraktsync 文件,并输入你的 plextraktsync 文件路径,使用 pipx 安装的应该和我的位置一样,使用其他方式安装的需要自己查找 plextraktsync 文件)

3.3. 请输入「:wq」保存并退出编辑器,此时会弹出「“终端.app”想要管理您的电脑」窗口,选择「好」,然后关闭终端。

这样我们就设置了一个「每 3 小时进行一次同步」的定时任务。命令最前面的「* * * * *」是用来设定时间的,分别代表「分、时、日、月、周」,比如每 5 分钟一次是「*/5 * * * *」,每 1 小时一次是「* */1 * * *」,「/」就是「每」的意思,可以根据自己的需要自定义间隔时间,自动同步是固定时间运行的,手动同步可以随时运行,二者不冲突。

如果想修改间隔时间,只要重复执行「3.1.-3.3.」即可,会自动打开之前的设置,直接进行修改即可,注意要保持格式正确。

现在开始你在 Plex 看过的影片就会自动同步到 Trakt 上啦。

Guess you like

Origin blog.csdn.net/u010567698/article/details/129659738