itceleb / sonarr
PHP Sonarr API 包装器
1.0.6.1
2017-06-30 01:25 UTC
Requires
- guzzlehttp/guzzle: ^6.1
This package is auto-updated.
Last update: 2024-09-09 02:11:59 UTC
README
PHP Sonarr 包装器 https://sonarr.tv
以下是此包实现的 Sonarr API 文档:https://github.com/Sonarr/Sonarr/wiki/API
安装
composer require itceleb/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
注意:当使用键 => 值对发送数据时,键是区分大小写的。