このガイドでは、プレックスウォッチをインストールして構成する方法を説明します。プレックスウォッチは、プレックスメディアサーバーからの「再生中」および「視聴済み」コンテンツと「最近追加された」(…など)を通知してログに記録します
機能
- ユーザーが動画の視聴を開始したときに通知する
- ユーザーが動画の視聴を停止したときに通知する
- ユーザーが動画の視聴を一時停止したときに通知する
- ユーザーが動画の視聴を再開したときに通知する
- 最近PMSサーバーに追加されたコンテンツについて通知する
- メール、うろつき、プッシュオーバー、うなり声、ツイッター、ボックスカー、プッシュブレット、GNTP、ログファイルで通知します
- プロバイダーごとおよび通知タイプごと(開始、停止、一時停止、再開、最近追加)の通知を有効/無効にします
- SQLite DB(状態と履歴用)に支えられています
- CLIを使用して、視聴された動画、視聴されている動画、ユーザーごとに視聴された時間の統計を照会します
- ユーザーごとの出力を制限するか、ユーザーを除外します
Perlの要件
- LWP ::UserAgent
- XML ::Simple
- DBI
- 時間::期間;
- Time ::ParseDate;
- JSON
インストール
plexWatch.plとconfig.pl-distを/opt/ plexWatch /
にダウンロードします。- WGET
sudo wget -P /opt/plexWatch/ https://raw.github.com/ljunkie/plexWatch/master/plexWatch.pl
sudo wget -P /opt/plexWatch/ https://raw.github.com/ljunkie/plexWatch/master/config.pl-dist
- CURL
sudo mkdir -p /opt/plexWatch/
sudo curl https://raw.github.com/ljunkie/plexWatch/master/plexWatch.pl -o /opt/plexWatch/plexWatch.pl
sudo curl https://raw.github.com/ljunkie/plexWatch/master/config.pl-dist -o /opt/plexWatch/config.pl-dist
次に、ファイルの権限を変更しましょう
sudo chmod 777 /opt/plexWatch && sudo chmod 755 /opt/plexWatch/plexWatch.pl
sudo cp /opt/plexWatch/config.pl-dist /opt/plexWatch/config.pl
PlexWatch構成ファイルを編集しましょう
sudo nano /opt/plexWatch/config.pl
$server = 'localhost'; ## IP of PMS - or localhost $port = 32400; ## port of PMS $notify_started = 1; ## notify when a stream is started (first play) $notify_stopped = 1; ## notify when a stream is stopped
$notify = {... * to enable a provider, i.e. file, prowl, pushover set 'enabled' => 1, under selected provider * Prowl : 'apikey' required * Pushover : 'token' and 'user' required * Growl : 'script' required :: GrowlNotify from http://growl.info/downloads (GNTP replaces this) * twitter : 'consumer_key', 'consumer_secret', 'access_token', 'access_token_secret' required * boxcar : 'email' required * pushover : 'apikey' and 'device' required * GNTP : 'server', 'port' required. 'password' optional. You must allow network notifications on the Growl Server
それでは、perl要件のいくつかをインストールしましょう
sudo apt-get install libwww-perl libxml-simple-perl libtime-duration-perl libtime-modules-perl libdbd-sqlite3-perl perl-doc libjson-perl
実行 スクリプトを手動で実行して機能することを確認します:/opt/plexWatch/plexWatch.pl
- 動画を開始
-
/opt/plexWatch/plexWatch.pl
- 動画を停止
-
/opt/plexWatch/plexWatch.pl
毎分スクリプトを実行するようにcrontabを設定します
sudo nano /etc/crontab
追加しましょう
* * * * * YOUR_USERNAME /opt/plexWatch/plexWatch.pl
これでセットアップが完了し、準備が整いました。通知を追加しましょう
サポートされているプッシュ通知
- メール
- https://pushover.net
- https://prowlapp.com
- http://growl.info/(GrowlNotify @ http://growl.info/downloads#generaldownloads経由)
- https://twitter.com/(https://dev.twitter.com/appsで新しいアプリを作成します)
- https://boxcar.io/&boxcar V2
- https://pushbullet.com
- SNARL / GROWL:GNTP通知がサポートされています。 GNTPを使用するものはすべてすべき 仕事
- 外部スクリプト:ホームオートメーション、ダウンロードクライアントの一時停止など(基本的なプラグイン)
Twitterの設定
- 新しいアプリを作成する@https://dev.twitter.com/apps
- [新しいアプリの作成]をクリックします
- 名前:アプリの一意の名前
- 説明:何かを記入してください…
- ウェブサイト:有効なウェブサイトが必要です。
- (読んで)条件に同意する
- 「Twitterアプリケーションの作成」をクリックします
- [詳細]タブの[アプリの権限を変更]をクリックします
- 読み取りと書き込みに変更
- 設定の更新
- [APIキー]タブをクリックします
- [アクセストークンを作成する]をクリックします
- [OAuthのテスト]ボタンをクリックして、config.plに必要なAPIキーを表示します
- config.plを編集します
- config.plでTwitterの通知を有効にする
- 必要なキー、シークレット、トークンを入力してください