tboothman / imdbphp

PHP library for retrieving film and tv information from IMDb
253 stars 84 forks source link

New Amsterdam serie #167

Closed guardiaopt closed 5 years ago

guardiaopt commented 5 years ago

In the New Amsterdam only lists 17 episodes instead of 22 I'm using PHP Version: 7.0.33-0+deb9u1 My code:

$imdbid="7817340"; $config = new \Imdb\Config(); $config->language = 'en-US,en'; $movie = new \Imdb\Title($imdbid, $config); $seasons = $movie->episodes(); print_r($seasons);

guardiaopt commented 5 years ago

I think this problem is caused because episodes> 17 have 8 digits

guardiaopt commented 5 years ago

To fix this I have changed the following: Open Title.php

Find: public function episodes()

edit line: . '.+?\shref="/title/tt(?\d{7})/.+?"\s+title="(?.+?)"\s+itemprop="name"'</p> <p>to . '.+?\shref="/title/tt(?<imdbid>\d{7,8})/.+?"\s+title="(?<title>.+?)"\s+itemprop="name"'</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/tboothman"><img src="https://avatars.githubusercontent.com/u/1813336?v=4" />tboothman</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>This has been fixed already, but not released, sorry. #163</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>