{"id":13828640,"url":"https://github.com/tboothman/imdbphp","last_synced_at":"2025-05-14T10:12:17.973Z","repository":{"id":20978729,"uuid":"24267794","full_name":"tboothman/imdbphp","owner":"tboothman","description":"PHP library for retrieving film and tv information from IMDb","archived":false,"fork":false,"pushed_at":"2025-03-02T18:10:41.000Z","size":3503,"stargazers_count":255,"open_issues_count":29,"forks_count":84,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-03T02:06:12.672Z","etag":null,"topics":["film","imdb","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tboothman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-20T16:25:11.000Z","updated_at":"2025-03-02T18:06:00.000Z","dependencies_parsed_at":"2024-06-18T13:38:21.366Z","dependency_job_id":"2514d991-9ae6-44dc-833f-f63877e11cb3","html_url":"https://github.com/tboothman/imdbphp","commit_stats":{"total_commits":1326,"total_committers":26,"mean_commits":51.0,"dds":0.548265460030166,"last_synced_commit":"7d4b65fe18693d791dace6a8eb88d18fdc5bbbff"},"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboothman%2Fimdbphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboothman%2Fimdbphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboothman%2Fimdbphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tboothman%2Fimdbphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tboothman","download_url":"https://codeload.github.com/tboothman/imdbphp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154968,"owners_count":21056541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["film","imdb","php"],"created_at":"2024-08-04T09:02:56.490Z","updated_at":"2025-04-10T03:44:27.340Z","avatar_url":"https://github.com/tboothman.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"imdbphp\n=======\n\nPHP library for retrieving film and TV information from IMDb.\nRetrieve most of the information you can see on IMDb including films, TV series, TV episodes, people.\nSearch for titles on IMDb, including filtering by type (film, tv series, etc).\nDownload film posters and actor images.\n\n\nQuick Start\n===========\n\n* Include [imdbphp/imdbphp](https://packagist.org/packages/imdbphp/imdbphp) using [composer](https://www.getcomposer.org), clone this repo or download the latest [release zip](https://github.com/tboothman/imdbphp/releases).\n* Find a film you want the metadata for e.g. Lost in translation http://www.imdb.com/title/tt0335266/\n* If you're not using composer or an autoloader include `bootstrap.php`.\n* Get some data\n```php\n$title = new \\Imdb\\Title(335266);\n$rating = $title-\u003erating();\n$plotOutline = $title-\u003eplotoutline();\n\n# Find out about the director\n$person = new \\Imdb\\Person($title-\u003edirector()[0]['imdb']);\n$name = $person-\u003ename();\n$photo = $person-\u003ephoto();\n```\n\nInstallation\n============\n\nThis library scrapes imdb.com so changes their site can cause parts of this library to fail. You will probably need to update a few times a year. Keep this in mind when choosing how to install/configure.\n\nGet the files with one of:\n* [Composer](https://www.getcomposer.org) (recommended). Include the [imdbphp/imdbphp](https://packagist.org/packages/imdbphp/imdbphp) package.\n* Git clone. Checkout the latest release tag.\n* [Zip/Tar download](https://github.com/tboothman/imdbphp/releases)\n\n### Requirements\n* PHP \u003e= 5.6\n* PHP cURL extension\n\n\nConfiguration\n=============\n\nimdbphp needs no configuration by default but can cache imdb lookups, store images and change languages if configured.\n\nConfiguration is done by the `\\Imdb\\Config` class in `src/Imdb/Config.php` which has detailed explanations of all the config options available.\nYou can alter the config by creating the object, modifying its properties then passing it to the constructor for imdb.\n```php\n$config = new \\Imdb\\Config();\n$config-\u003elanguage = 'de-DE,de,en';\n$imdb = new \\Imdb\\Title(335266, $config);\n$imdb-\u003etitle(); // Lost in Translation - Zwischen den Welten\n$imdb-\u003eorig_title(); // Lost in Translation\n```\n\nIf you're using a git clone you might prefer to configure IMDbPHP by putting an ini file in the `conf` folder. `900_localconf.sample` has some sample settings.\n\nThe cache folder is `./cache` by default. Requests from imdb will be cached there for a week (by default) to speed up future requests.\n\nAdvanced Configuration\n======================\nReplacing the default cache (disk cache)\n------------------------\nYou can replace the caching mechanism that ImdbPHP uses to any [PSR-16 (simple cache)](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md) cache\nby passing one into the constructor of any ImdbPHP class.\n\nThe only piece of imdbphp config that will be used with your cache is the TTL which is set by `\\Imdb\\Config::$cache_expire` and defaults to 1 week.\n```php\n$cache = new \\Cache\\Adapter\\PHPArray\\ArrayCachePool();\n// Search results will be cached\n$search = new \\Imdb\\TitleSearch(null /* config */, null /* logger */, $cache);\n$firstResultTitle = $search-\u003esearch('The Matrix')[0];\n// $firstResultTitle, an \\Imdb\\Title will also be using $cache for caching any page requests it does\n```\n\n```php\n$cache = new \\Cache\\Adapter\\PHPArray\\ArrayCachePool();\n$title = new \\Imdb\\Title(335266, null /* config */, null /* logger */, $cache);\n```\n\nReplacing the default logger (which echos coloured html, and is disabled by default)\n------------------------------------------------------------------------------------\nThe logger will mostly tell you about http requests that failed at error level, each http request at info and some stuff like cache hits at debug.\n\n```php\n$logger = new \\Monolog\\Logger('name');\n$title = new \\Imdb\\Title(335266, null /* config */, $logger);\n```\n\nSearching for a film\n====================\n\n```php\n// include \"bootstrap.php\"; // Load the class in if you're not using an autoloader\n$search = new \\Imdb\\TitleSearch(); // Optional $config parameter\n$results = $search-\u003esearch('The Matrix', array(\\Imdb\\TitleSearch::MOVIE)); // Optional second parameter restricts types returned\n\n// $results is an array of Title objects\n// The objects will have title, year and movietype available\n// immediately, but any other data will have to be fetched from IMDb\nforeach ($results as $result) { /* @var $result \\Imdb\\Title */\n    echo $result-\u003etitle() . ' ( ' . $result-\u003eyear() . ')';\n}\n```\n\nSearching for a person\n======================\n```php\n// include \"bootstrap.php\"; // Load the class in if you're not using an autoloader\n$search = new \\Imdb\\PersonSearch(); // Optional $config parameter\n$results = $search-\u003esearch('Forest Whitaker');\n\n// $results is an array of Person objects\n// The objects will have name and imdbid available, everything else must be fetched from IMDb\nforeach ($results as $result) { /* @var $result \\Imdb\\Person */\n    echo $result-\u003ename();\n}\n```\n\nDemo site\n=========\nThe demo site gives you a quick way to make sure everything's working, some sample code and lets you easily see some of the available data.\n\nFrom the demo folder in the root of this repository start up php's inbuilt webserver and browse to [http://localhost:8000]()\n\n`php -S localhost:8000`\n\n\nGotchas / Help\n==============\nSSL certificate problem: unable to get local issuer certificate\n---------------------------------------------------------------\n### Windows\nThe cURL library either hasn't come bundled with the root SSL certificates or they're out of date. You'll need to set them up:\n1. [Download cacert.pem](https://curl.haxx.se/docs/caextract.html)  \n2. Store it somewhere in your computer.  \n`C:\\php\\extras\\ssl\\cacert.pem`  \n3. Open your php.ini and add the following under `[curl]`  \n`curl.cainfo = \"C:\\php\\extras\\ssl\\cacert.pem\"`  \n4. Restart your webserver.  \n### Linux\ncURL uses the certificate authority file that's part of linux by default, which must be out of date. \nLook for instructions for your OS to update the CA file or update your distro.\n\nConfigure languages\n---------------------------------------------------------------\nSometimes IMDb gets unsure that the specified language are correct, if you only specify your unique language and territory code (de-DE). In the example below, you can find that we have chosen to include `de-DE (German, Germany)`, `de (German)` and `en (English)`. If IMDb can’t find anything matching German, Germany, you will get German results instead or English if there are no German translation.\n```php\n$config = new \\Imdb\\Config();\n$config-\u003elanguage = 'de-DE,de,en';\n$imdb = new \\Imdb\\Title(335266, $config);\n$imdb-\u003etitle(); // Lost in Translation - Zwischen den Welten\n$imdb-\u003eorig_title(); // Lost in Translation\n```\nPlease use The Unicode Consortium [Langugage-Territory Information](http://www.unicode.org/cldr/charts/latest/supplemental/language_territory_information.html) database for finding your unique language and territory code.\n\n| Langauge | Code | Territory   | Code |\n| -------- | ---- | ----------- | ---- |\n| German   | de   | Germany {O} | DE   |\n\nAfter you have found your unique language and territory code you will need to combine them. Start with language code (de), add a separator (-) and at last your territory code (DE); `de-DE`. Now include your language code (de); `de-DE,de`. And the last step add English (en); `de-DE,de,en`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftboothman%2Fimdbphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftboothman%2Fimdbphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftboothman%2Fimdbphp/lists"}