Giter VIP home page Giter VIP logo

imdbphp's Issues

TV Series cast() not correctly parsed

The html character

 

is added to the 'role' index.

example from 'Homeland':

0 => 
    array (size=5)
      'imdb' => string '0000132' (length=7)
      'name' => string 'Claire Danes' (length=12)
      'role' => string ' Carrie Mathison
                  (48 episodes, 2011-2014)' (length=64)
      'thumb' => string 'http://ia.media-imdb.com/images/M/MV5BMTMyMzQ1Mjk3M15BMl5BanBnXkFtZTcwNzk3ODMxNw@@._V1_SY44_CR1,0,32,44_AL_.jpg' (length=111)
      'photo' => string 'http://ia.media-imdb.com/images/M/MV5BMTMyMzQ1Mjk3M15BMl5BanBnXkFtZTcwNzk3ODMxNw@@._V1_SY44_CR1,0,32,44_AL_.jpg' (length=111)
  1 => 
    array (size=5)
      'imdb' => string '0001597' (length=7)
      'name' => string 'Mandy Patinkin' (length=14)
      'role' => string ' Saul Berenson
                  (48 episodes, 2011-2014)' (length=62)
      'thumb' => string 'http://ia.media-imdb.com/images/M/MV5BMjAzNjU1NTE3NF5BMl5BanBnXkFtZTcwNjIyMzcyNw@@._V1_SY44_CR0,0,32,44_AL_.jpg' (length=111)
      'photo' => string 'http://ia.media-imdb.com/images/M/MV5BMjAzNjU1NTE3NF5BMl5BanBnXkFtZTcwNjIyMzcyNw@@._V1_SY44_CR0,0,32,44_AL_.jpg' (length=111)

Default config throws exception when used

Default config should work so it's very easy to get started.

Disable caching by default? (will people use caching then? will people notice their caching which maybe used to work now doesn't?)
Add a cache folder to the repo? (will probably cause a notice when using composer install/update as the folder has changed ... but they should change their config anyway)

imdb_trailers is broken

Throws all sorts of errors .. doesn't produce a single useable URL

PHP Notice:  Undefined index: fmt_url_map in C:\Users\Tom\code\imdbphp\imdb_trailers.class.php on li
ne 149

Notice: Undefined index: fmt_url_map in C:\Users\Tom\code\imdbphp\imdb_trailers.class.php on line 14
9
PHP Notice:  Undefined variable: fmt in C:\Users\Tom\code\imdbphp\imdb_trailers.class.php on line 15
1

Notice: Undefined variable: fmt in C:\Users\Tom\code\imdbphp\imdb_trailers.class.php on line 151
PHP Notice:  Undefined index: Location in C:\Users\Tom\code\imdbphp\imdb_trailers.class.php on line
153

Notice: Undefined index: Location in C:\Users\Tom\code\imdbphp\imdb_trailers.class.php on line 153
PHP Notice:  Undefined offset: 0 in C:\Users\Tom\code\imdbphp\imdb_trailers.class.php on line 156

PHP error if no cast

Minor issue, but if a movie has no cast available, the script throws up an error.

Warning: Invalid argument supplied for foreach() in imdb.class.php on line 1185

Title movie in english (2) re-open

re-open this topic
something does not work in the "person" script
(I set the configuration as in the screenshot)
When download the filmography film does not all titles are in English
some films are in Russian language
I wish them all with the original title in English
precise that I live in russia

ss screen capture 069
ss screen capture 070
ss screen capture 071
ss screen capture 072
ss screen capture 073

Title movie english

how to configure this code to save the titles in English
I live in Russia, and these tiles are saved in "Russian language"
thank you

` /**

  • IMDB server to use.

  • choices are www.imdb.&lt;lang> with <lang> being one of

  • de|es|fr|it|pt, uk.imdb.com, and akas.imdb.com - the localized ones are

  • only qualified to find the movies IMDB ID (with the imdbsearch class;

  • akas.imdb.com will be the best place to search as it has all AKAs) -- but

  • parsing (with the imdb class) for most of the details will fail for

  • most of the details.

  • @var string imdbsite
    */
    public $imdbsite = "akas.imdb.com";

    /**

  • Tell IMDB which is the preferred language.

  • Any valid language code can be used here (e.g. en-US, de, pt-BR).

  • If this option is specified, the Accept-Language header with this value

  • will be included in the requests.

  • @var string
    */
    public $language = "en-US";`

Request: method Alternate Versions

My apologies if this is not the right way to ask

Is it possible to get a method for Alternate Versions?
It seems to be not in the class afaik

Thanks in advance
Ed

YUM install imdbphp without Apache

Hi.
My server runs on Centos 7 with NGiNX & PHP-FPM
I tried installing imdbphp2 via the IzzySoft repo but I noticed that I was also getting httpd & httpd-tools installed.

Is there a way to use the repository to install and keep updated imdbphp without having to install httpd & httpd-tools?

Thanks!

Top250 not working

Hi there

I'm trying to get the top250 but i think imdb changed it's site again because it's not working.

On their site it now list as Top Rated Movies #number if the movie is listed on the top250 list
I'm not very good at php preg_match but i think i'm in the right direction with this?

@preg_match('!<a href="[^"]*/chart/top\?(.*?)><strong> Top Rated Movies #(\d+)\s*</strong></a>!si'

But it doesn't work at all

I used this movie as example: http://www.imdb.com/title/tt0066921/
The source code of the imdb title page (This is the full <div> where the info is listed) looks like this:

<div class="article highlighted" id="titleAwardsRanks">
          <strong>
<a href="/chart/top?ref_=tt_awd"
> Top Rated Movies #80
</a>          </strong>
          |

    <span itemprop="awards">
      <b>
        Nominated for
        4
        Oscars.
      </b>
    </span>
    <span itemprop="awards">
        Another
      8 wins &amp; 17 nominations.
    </span>
    <span class="see-more inline">
<a href="/title/tt0066921/awards?ref_=tt_awd"
class="btn-full" >See more awards</a>&nbsp;&raquo;    </span>
      </div>

I need some help to get this fixed
Thanks
Ed

ps I comment this in a earlier issue but later realized that it was closed..

The poster and images variables are empty

The poster and images variables are empty.
I think it is irrelevant with the cache although i have cache dir correctly as said in documentation

print_r ($movie);
echo $movie->photo_localurl().$movie->title().$movie->photo().$movie->thumbphoto();exit;

the following variables returned empty
movie->photo_localurl().$movie->title().$movie->photo().$movie->thumbphoto();

Please advise

Error if cache folder is not created

If the cache folder is not in the directory, the application crashed.
therefore, i've added this little piece of code to the project where i'm using your great work.

/*
 * Check if the cache folder exists in the imdbphp api.
 * if it doesn't - then create it!
 */
if (!file_exists('../includes/api/imdbphp/cache'))
{
    mkdir('../includes/api/imdbphp/cache', 0777, true);
}

Anyway, Thanks for sharing this!

Error on searching for a person: redirecting to inexistent file imdb.php?mid=0361748

How to recreate the bug:

  1. main interface, search name: Brad pitt, type: name;
  2. press search button;
  3. you get a page like this one:
    http://www.luigiusai.it/moviedatabase/search.php?name=Brad+pitt&searchtype=nm&engine=imdb&mid=
  4. on the "Person Details", press the "Bastardi senza gloria" link, which is similar to this one:
    http://www.luigiusai.it/moviedatabase/imdb.php?mid=0361748

This is the error: the file imdb.php does not exist.

Best regards to all
Luigi, Verona

no photo available!

version 3.2.0 gets no image/photo out of imdb (eg. /demo/movie.php?mid=0212985). is this a problem of configuration? or a bug?

New iMDB layout is back!!!

The new iMDB layout is back and this time it seems to have replaced the old one..!!
Some info such as the poster url and the number of voters cannot be parsed correctly.

Additional info in roles

I noticed this in the changelog:

Fix cast() parsing of role. The role field no longer contains anything other than the name of the role played

So, am I reading it right in that this is intentional, or is this an unfixed bug? I really think that this is pretty important information...

Error for wrong iMDB id

I have several mistyped iMDB ids in my DB. When these ids are used with imdbPHP I get the an error saying
Imdb\Exception\Http: Uncaught exception 'Imdb\Exception\Http' with message 'Failed to retrieve url [http://akas.imdb.com/title/tt1223602/]. Status code [404]' in /'path_to_imdbPHP'/src/Imdb/Pages.php

This error breaks my script. It would be very useful if there was a small check function in imdbPHP which could be used to verify that the iMDB id we are using corresponds to an valid page. Is this something you would consider incorporating?

Photo regex requires increased pcre.backtrack_limit

The photo() 's weren't working on my system. When I increased:

ini_set('pcre.backtrack_limit',1000000);

They would work. The default is 100000 and the imdb page must be longer than that.

The ".*" in the thumbphoto regex was the cause.

Changing to ".*?" (non greedy) worked.

imdb.class.php:

protected function thumbphoto() {
    $this->getPage("Title");
    # preg_match('!id="img_primary">.*?<img [^>]+src="(.+?)".*<td id="overview-top"!ims',$this->page["Title"],$match);
    preg_match('!id="img_primary">.*?<img [^>]+src="(.+?)".*?<td id="overview-top"!ims',$this->page["Title"],$match);
    if (empty($match[1])) return FALSE;
    $this->main_thumb = $match[1];
    if ( preg_match('|(.*\._V1).*|iUs',$match[1],$mo) ) {
      $this->main_photo = $mo[1];
      return true;
    }
    else return FALSE;
  }

Add ability to replace cache

  1. I have checked out briefly PSR-6 cache interfaces and they seem over-complicated. Can we have our simple interface instead? Something like that:
interface CacheInterface
{
    public function get($key);

    public function set($key, $value);
}
  1. Can we use dependency injection container both for cache and logger?
    Right now we have method setLogger, maybe we can have similar method setCache as well?
    The only drawback in this case is that we have to code the following steps: a) set log for MdbBase (i.e. Title), b) set log for cache c) set cache for Title.
    When using dependency injection container we have to set dependency only once, and we can have, for example, 2 additional config variables: cachetype and logtype which are class names for cache and logger

I can work on that points and make a pull request soon

Rewrite using xpath

Any thoughts on updating the script to use xpath which is a much more robust way of parsing HTML. I have some of the functionality already written before discovering this library using xpath and it is much easier to maintain. Any interest in this?

Slashes in role

Good job fixing #12 - much appreciated.

However, this does introduce one new bug (or it was a recent bug that I missed). Some roles have slashes in them to separate multiple characters that an actor played in that movie, but any role that has a slash in it gets truncated.

Example, see: http://www.imdb.com/title/tt0462538/fullcredits

role = Marge Simpson / Selma / Patty
gets truncated to
role = Marge Simpson /

Recommendations year last entry not found

If i want the recommendations of the movie 1408 http://www.imdb.com/title/tt0450385/
Then the last entry (the movie Mirrors) has no year because of a small change in that titel.

All titles are like this: Name (year) but the last one looks like this: Mirrors I (2008)

Source code looks like this:

<div class="rec_details">
         <div class="rec-info">

           <div class="rec-jaw-upper">  

     <div class="rec-title">
       <a href="/title/tt0790686/?ref_=tt_rec_tt"><b>Mirrors</b></a>
        <span>I</span>
            <span class="nobr">(2008)</span>
   </div> 

Thanks
Ed

Remove html entities from results

While most people will use this data and dump it into a web document ... the library should be agnostic to that. It should turn any html entities into their utf8 equivalent.
Pretty sure that IMDb is entirely utf8 now... need to make sure though.

Method quotes returns nothing

This method is broken due to site changes i guess

page source looks like this:

<div id="qt0396883" class="quote soda sodavote odd" ><div class="sodatext">
<p>
<a href="/name/nm0000131/?ref_=tt_trv_qu"
><span class="character">Mike Enslin</span></a>:
[<span class="fine">Olin gives Enslin the room key</span>]
Most hotels have switched to magnetics. An actual key. That's a nice touch, it's antiquey. </p>

the preg_match like this

preg_match_all('!class="quote soda (odd|even)"\s*><p>\s*(.*?)\s*</p>\s*<div class=!ims',str_replace("\n"," ",$this->page["Quotes"]),$matches)

I tried to fix it myself but my skills with preg_match are slim.
obviously the class name is wrong but that is as far as i get

Thanks
Ed

v3.0.0 inconsistencies

The Makefile hasn't been updated to reflect the huge structural changes implemented with v3.0.0, hence:

  • .deb/.rpm builds are impossible for the release tag, hence
  • the Prod demo (reflecting the latest release) will not be up-to-date

Additional issues due to the restructuring:

  • the Dev demo (reflecting the current master branch) will be is broken
  • applications using IMDBPHP won't be able to easily use the new version (no compatibility layer; for examples how those could look like, see e.g. MarkdownExtra: we could have corresponding files in the "old locations" taking care for that, such as imdb.class.php having a pseudo imdb class extending the real one), which especially affects those currently unmaintained (as e.g. phpVideoPro), where such a "compatibility layer" had easily fixed it.

Sorry, @tboothman โ€“ but that's why I said we should communicate when you're done with restructuring, but before you merge that into master ๐Ÿ˜ท

Undefined constant errors

When setting a custom configuration undefined constant errors are thrown.

require './vendor/autoload.php';
$config = new \mdb_config();

Gives Notice: Use of undefined constant NO_ACCESS - assumed 'NO_ACCESS'

Limit array

Hello how can I limit in a search for the movie or series
the number of directors and actors
, $ Imdb-> director (), $ imdb-> cast ()
pq returns a very large list of names

Error when following 301 redirects

The function call in getWebPage() in mdb_base.class.php#130 is using $target retrieved from the HTTP header field location. But the location does not contain the full URL, only "/title/tt#######/". Below is the header for http://www.imdb.com/title/tt2768262/

301 Moved Permanently
content-length:0
vary:User-Agent
server:Server
location:/title/tt2386868/
date:Thu, 09 Oct 2014 20:06:09 GMT
x-frame-options:SAMEORIGIN
p3p:policyref="http://i.imdb.com/images/p3p.xml",CP="CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC "

movies_actor() returns all types of titles (not just movies)

It would be awesome if we could have movies_actor() just for actual movies, and tvshows_actor() for instance for tvshows. Alternatively, a title_actor() method that would include a field indicating the type of the title (Movie, TvShow or TvEpisode).

I believe this is feasible, since by just looking at a person page (e.g. http://www.imdb.com/name/nm0933988/) we can deduce the type of each title that person had a role in. My point is that is does not seem to require further page request to each title entry in the Person filmography..

Could it possible for you to consider implementing this?

Series Writing Credits

Since a few weeks ago, the writing() method does not work anymore with TV series and returns an empty string: for those, IMDb updated the string to parse from "Writing Credits" to "Series Writing Credits".

Thanks!

People - death locations

I couldn't find out an exact reason why, but occasionally, death location would not be returned properly. For an example, see:

http://akas.imdb.com/name/nm0662730/bio

His death location shows up as expected on the page, but the script will not return it.

Fix... imdb_person.class.php, line 417-418, replace with:

        if (!preg_match('|/search/name\?death_place=.*?"\s*>(.*?)<|ims',$match[1],$dloc))
          preg_match('|/search/name\?death_place=.*?"\s*>(.*?)<|ims',$match[1],$dloc);

line 420, replace:

"place"=>@trim(strip_tags($dloc[3]))

with:

"place"=>@trim(strip_tags($dloc[1]))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.