kyronit3 / sonarr
PHP Sonarr API 包装器
1.0.6.1
2017-06-30 01:25 UTC
Requires
- guzzlehttp/guzzle: ^6.1
This package is not auto-updated.
Last update: 2024-09-20 22:23:46 UTC
README
PHP Sonarr 包装器 https://sonarr.tv
以下是本包实现的 Sonarr API 文档:https://github.com/Sonarr/Sonarr/wiki/API
安装
composer require kryptonit3/sonarr
示例用法
use Kryptonit3\Sonarr\Sonarr;
public function addSeries() { $sonarr = new Sonarr('http://127.0.0.1:8989', 'cf7544f71b6c4efcbb84b49011fc965c'); // URL and API Key return $sonarr->postSeries([ 'tvdbId' => 73739, 'title' => 'Lost', 'qualityProfileId' => 3, // HD-720p 'rootFolderPath' => '/volume1/Plex/Shows' ]); }
HTTP 认证
如果你的站点需要 HTTP 认证的用户名和密码,你可以这样提供。请注意,如果你在没有 SSL 的情况下使用 HTTP 认证,你将在互联网上无保护地发送你的用户名和密码。
$sonarr = new Sonarr('http://127.0.0.1:8989', 'cf7544f71b6c4efcbb84b49011fc965c', 'my-username', 'my-password');
输出
{ "title": "Lost", "alternateTitles": [ ], "sortTitle": "lost", "seasonCount": 0, "totalEpisodeCount": 0, "episodeCount": 0, "episodeFileCount": 0, "sizeOnDisk": 0, "status": "continuing", "images": [ ], "seasons": [ ], "year": 0, "path": "\/volume1\/Plex\/Shows\/Lost", "profileId": 3, "seasonFolder": true, "monitored": true, "useSceneNumbering": false, "runtime": 0, "tvdbId": 73739, "tvRageId": 0, "tvMazeId": 0, "seriesType": "standard", "cleanTitle": "lost", "genres": [ ], "tags": [ ], "added": "2016-02-06T18:11:26.475637Z", "addOptions": { "searchForMissingEpisodes": false, "ignoreEpisodesWithFiles": true, "ignoreEpisodesWithoutFiles": true }, "qualityProfileId": 3, "id": 90 }
对于可用方法,请参考以下包含的 Sonarr::class
注意:当使用键 => 值对发送数据时,键是大小写敏感的。