vitoo/radarr

PHP Radarr API 包装器

dev-master 2023-11-09 18:16 UTC

This package is auto-updated.

Last update: 2024-09-28 11:15:06 UTC


README

PHP 包装器 Radarr https://radarr.video/

以下是此包实现的 Radarr API 文档:https://radarr.video/docs/api/

安装

composer require vitoo/radarr:dev-master

示例用法

use digitalhigh\Radarr\Radarr;
public function addMovie()
{
    $radarr = new Radarr('http://127.0.0.1:8989', 'cf7544f71b6c4efcbb84b49011fc965c'); // URL and API Key
    
    return $radarr->postMovie([
        'tmdbId' => 121856,
        'title' => 'Assassin's Creed',
        'qualityProfileId' => 3, // HD-720p
        'rootFolderPath' => '/volume1/Plex/Movies'
    ]);
}

HTTP 验证

如果你的站点需要 HTTP 验证用户名和密码,你可以这样提供。请注意,如果你在未使用 SSL 的情况下使用 HTTP 验证,你将在互联网上无保护地发送用户名和密码。

$radarr = new Radarr('http://127.0.0.1:8989', 'cf7544f71b6c4efcbb84b49011fc965c', 'my-username', 'my-password');

输出

{
  "title": "Assassin's Creed",
  "sortTitle": "assassins creed",
  "sizeOnDisk": 0,
  "status": "released",
  "overview": "Lynch discovers he is a descendant of the secret Assassins society through unlocked genetic memories that allow him to relive the adventures of his ancestor, Aguilar, in 15th Century Spain. After gaining incredible knowledge and skills he’s poised to take on the oppressive Knights Templar in the present day.",
  "inCinemas": "2016-12-21T00:00:00Z",
  "images": [
    {
      "coverType": "poster",
      "url": "/radarr/MediaCover/1/poster.jpg?lastWrite=636200219330000000"
    },
    {
      "coverType": "banner",
      "url": "/radarr/MediaCover/1/banner.jpg?lastWrite=636200219340000000"
    }
  ],
  "website": "https://www.ubisoft.com/en-US/",
  "downloaded": false,
  "year": 2016,
  "hasFile": false,
  "youTubeTrailerId": "pgALJgMjXN4",
  "studio": "20th Century Fox",
  "path": "/path/to/Assassin's Creed (2016)",
  "profileId": 6,
  "monitored": true,
  "minimumAvailability": "preDb",
  "runtime": 115,
  "lastInfoSync": "2017-01-23T22:05:32.365337Z",
  "cleanTitle": "assassinscreed",
  "imdbId": "tt2094766",
  "tmdbId": 121856,
  "titleSlug": "assassins-creed-121856",
  "genres": [
    "Action",
    "Adventure",
    "Fantasy",
    "Science Fiction"
  ],
  "tags": [],
  "added": "2017-01-14T20:18:52.938244Z",
  "ratings": {
    "votes": 711,
    "value": 5.2
  },
  "alternativeTitles": [
    "Assassin's Creed: The IMAX Experience"
  ],
  "qualityProfileId": 6,
  "id": 1
}

有关可用方法的参考,请参阅 Radarr::class

注意:当使用键 => 值对发布数据时,键是区分大小写的。