imdb engine not fetching production country

  • qwerty759

    qwerty759 - 2010-09-25

    today i noticed that the imdb engine doesn't fetch production country anymore.
    i don't know how long this is going on.

    Maybe ucanmexwise can look in to this too?
    I know i post a lot in the help forum lately, but in the mean time i will try to find a solution to this problem as well

  • qwerty759

    qwerty759 - 2010-09-25


    Maybe this will help sort this out. i found it at the videodb imdb search engine:

    // Countries
        preg_match('/<h5>Country:<\/h5>(.+?)<\/div>/si', $resp, $ary);
        preg_match_all('/<A HREF="\/Sections\/Countries\/.+?\/">(.+?)<\/A>/si', $ary, $ary, PREG_PATTERN_ORDER);
        $data  = trim(join(', ', $ary));

    it's the same as their latest svn version so maybe it is helpful

  • qwerty759

    qwerty759 - 2010-09-25

    i found another code at in their imdb search engine

      /** Get country of production
       * @method country
       * @return array country (array of string)
       * @see IMDB page / (TitlePage)
      public function country() {
       if (empty($this->countries)) {
        if ($this->page == "") $this->openpage ("Title");
        $this->countries = array();
        if (preg_match_all("/\/Sections\/Countries\/\w+\/\"\&gt;\s*(.*?)<\/a/m",$this->page,$matches))
          for ($i=0;$i<count($matches);++$i) $this->countries = $matches;
       return $this->countries;

    i also found there code for the also known as title. because sometimes the aka doesn't work at all and sometimes only one title most of the time the top or bottom one.

      /** Get movies alternative names
       * @method alsoknow
       * @return array aka array of array; searching
       *         on will add "lang" (2-char language code) to the array
       *         for localized names, "country" may hold multiple countries separated
       *         by commas
       * @see IMDB page / (TitlePage)
       * @version Due to changes on the IMDB sites, neither the languages nor the year
       *          seems to be available anymore - so those array properties will always
       *          be empty, and kept for compatibility only (for a while, at least).
      public function alsoknow() {
       if (empty($this->akas)) {
        if ($this->page == "") $this->openpage ("Title");
        $ak_s = strpos ($this->page, "Also Known As:</h5>");
        if ($ak_s>0) $ak_s += 45;
        if ($ak_s == 0) $ak_s = strpos ($this->page, "Alternativ:");
        if ($ak_s == 0) return array();
        $alsoknow_end = strpos ($this->page, "</div>", $ak_s);
        $alsoknow_all = substr($this->page, $ak_s, $alsoknow_end - $ak_s);
        $aka_arr = explode("<br>",str_replace("\n","",$alsoknow_all));
        foreach ($aka_arr as $aka) {
          $aka = trim($aka);
          if (strpos('class="tn15more"',$aka)>0) break; // end of list
          if (empty($aka)) continue;
          if ( strpos($aka,'tn15more')!==FALSE ) break;
          $title = $match;
          $countries = explode( ', ', $match );
          foreach( $countries as $country ){
            $comment = '';
            if ( preg_match('!(.*?)\s*(<em>.*</em>)!ims',$country,$match2) ) {
                $country = $match2;
                $comment = implode( ', ', $matches );
            $this->akas = array(
       return $this->akas;

  • ucanmexwise

    ucanmexwise - 2010-09-26

    I've updated the archives "" and "" at

  • qwerty759

    qwerty759 - 2010-09-26

    Many thanks for the updated installer!
    You even include all the latest issuses from the help forum! Great!
    And best of all the production country works again! thanks again.

    was the code that i found helpful or not? i just try to help find solutions, and if someone else already found the answer, we don't have to invent it ourselves i think


Log in to post a comment.