پشتیبانی پایگاه داده‌ فیلم

Hello i ve this problem since 3 days i try to figure it out i didint update anything it suddenly stopped working :(

this is appearing from console

inc/imdbapp/db%20movies%20api 404 (Not Found)

and this is imdb.php

<?php

class IMDb {    


    public function getMovieInfo($title, $getExtraInfo = true)
    {
        $imdbId = $this->getIMDbIdFromSearch(trim($title));
        if($imdbId === NULL){
            $arr = array();
            $arr['error'] = "No se encontro titulo en el resultado de busqueda!";
            return $arr;
        }
        return $this->getMovieInfoById($imdbId, $getExtraInfo);
    }


    public function getMovieInfoById($imdbId, $getExtraInfo = true)
    {
        $arr = array();
        $imdbUrl = "http://www.imdb.com/title/" . trim($imdbId) . "/";
        return $this->scrapeMovieInfo($imdbUrl, $getExtraInfo);
    }


    private function scrapeMovieInfo($imdbUrl, $getExtraInfo = true)
    {
        $arr = array();
        $html = $this->geturl("${imdbUrl}combined");
        $title_id = $this->match('/<link rel="canonical" href="http:\/\/www.imdb.com\/title\/(tt\d+)\/combined" \/>/ms', $html, 1);
        if(empty($title_id) || !preg_match("/tt\d+/i", $title_id)) {
            $arr['error'] = "No Title found on IMDb!";
            return $arr;
        }
        $arr['response']='1';
        $arr['imdbID']=$title_id;
        $arr['Title']=str_replace('"', '', trim($this->match('/<title>(IMDb \- )*(.*?) \(.*?<\/title>/ms', $html, 2)));
        $arr['imdbRating']=$this->match('/<b>(\d.\d)\/10<\/b>/ms', $html, 1);
        $arr['imdbVotes']=$this->match('/>([0-9,]*) votes</ms', $html, 1);
        $arr['Rated']=$this->match('/MPAA<\/a>:<\/h5><div class="info-content">Rated (G|PG|PG-13|PG-14|R|NC-17|X) /ms', $html, 1);
        $arr['Runtime']=trim($this->match('/Runtime:<\/h5><div class="info-content">.*?(\d+) min.*?<\/div>/ms', $html, 1));
        $arr['Year']=trim($this->match('/<title>.*?\(.*?(\d{4}).*?\).*?<\/title>/ms', $html, 1));
        $country =$this->match_all('/<a.*?>(.*?)<\/a>/ms', $this->match('/Country:(.*?)(<\/div>|>.?and )/ms', $html, 1), 1);
        $arr['Country'] = implode(", ",$country);
        return $arr;
    }

    private function getIMDbIdFromSearch($title, $engine = "google"){
        switch ($engine) {
            case "google":  $nextEngine = "bing";  break;
            case "bing":    $nextEngine = "ask";   break;
            case "ask":     $nextEngine = FALSE;   break;
            case FALSE:     return NULL;
            default:        return NULL;
        }
        $url = "http://www.${engine}.com/search?q=imdb+" . rawurlencode($title);
        $ids = $this->match_all('/<a.*?href="http:\/\/www.imdb.com\/title\/(tt\d+).*?".*?>.*?<\/a>/ms', $this->geturl($url), 1);
        if (!isset($ids[0]) || empty($ids[0])) 
            return $this->getIMDbIdFromSearch($title, $nextEngine); 
        else
            return $ids[0]; 
    }

    private function geturl($url){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
        $ip = rand(0,255).'.'.rand(0,255).'.'.rand(0,255).'.'.rand(0,255);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: $ip", "HTTP_X_FORWARDED_FOR: $ip"));
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/".rand(3,5).".".rand(0,3)." (Windows NT ".rand(3,5).".".rand(0,2)."; rv:2.0.1) Gecko/20100101 Firefox/".rand(3,5).".0.1");
        $html = curl_exec($ch);
        curl_close($ch);
        return $html;
    }
        private function match_all_key_value( $regex, $str, $keyIndex = 1, $valueIndex = 2 ){
        $arr = array();
        preg_match_all( $regex, $str, $matches, PREG_SET_ORDER );
        foreach( $matches as $m ){
            $arr[$m[$keyIndex]] = $m[$valueIndex];
        }
        return $arr;
    }

function match_all_key_value2($regex, $str, $keyIndex = 1, $valueIndex = 2){
    $arr = array();
        preg_match_all($regex, $str, $matches, PREG_SET_ORDER);
        foreach($matches as $m){
            //$arr[] = array('id'=> $m[$keyIndex], 'name'=> $m[$valueIndex]);
            $arr[] = $m[$valueIndex];
        }

        return $arr;
    }
    private function match_all( $regex, $str, $i = 0 ){
        if( preg_match_all( $regex, $str, $matches ) === false)
            return '';
        else
            return $matches[$i];
    }


    private function match( $regex, $str, $i = 0 ){
        if( preg_match( $regex, $str, $match) == 1 )
            return $match[$i];
        else
            return '';
    }


}

9 پاسخ (در صفحه 1 از 1)

Jump to last post

Hi there,

I'm not familiar with PHP. What's the problem? Are you getting an error from the API? I don't see anything to do with TMDb in that file, it looks like you're scraping IMDB.

i fixed it thank you very much it was an into theme dbmovies it was from very ridicilous thing

@hitrockman i got the same problem, please can you help me to fix that? i'm a beginner with PHP.

Listen why would they TMDB on Kodi media player You can authorize TMDB less with Trakt So we need help with TMDB so we streaming to TV show and older movies

Please please help me say Revoke TMDb session _id

@Gracieqq32 said:

Please please help me say Revoke TMDb session _id

@Gracieqq32 said:
Please please help me say Revoke TMDb session _id

I have the impression that your problem is completely different from the problem in this thread.
I suggest you create a new topic specific to your problem.

No don't want srap my TMDB I just forgot my AIP number please please give it to again sir

@Gracieqq32 said:

No don't want srap my TMDB I just forgot my AIP number please please give it to again sir

See here. https://www.themoviedb.org/settings/api

فیلم و نمایش تلویزیونی را نمی‌توانید پیدا کنید؟ به سیستم وارد شوید تا آن را ایجاد کنید.

Global

s تمرکز بر منوی جستجو
p منوی پروفایل باز شود
esc بستن پنجره باز
? پنجره میانبرهای صفحه‌کلید باز شود

در صفحات مدیا

b بازگشت به عقب (یا در صورت لزوم به منشا)
e برو به صفحه ویرایش

در صفحات فصل تلویزیونی

(فلش سمت راست) برو به فصل بعد
(پیکان سمت چپ) برو به نشست قبلی

در صفحات قسمت تلویزیونی

(فلش سمت راست) برو به قسمت بعد
(پیکان سمت چپ) برو به قسمت قبلی

در تمام صفحات تصویر

a پنجره افزودن تصویر باز شود

در تمام صفحات ویرایش

t انتخابگر ترجمه باز شود
ctrl+ s ثبت از

در صفحات بحث

n ایجاد بحث جدید
w تغییر وضعیت وضعیت تماشا
p تغییر وضعیت عمومی/خصوصی
c تغییر وضعیت بسته/باز
a گشایش صفحه فعالیت
r پاسخ به بحث
l برو به آخرین پاسخ
ctrl+ enter پیام خود را ثبت کنید
(فلش سمت راست) صفحه بعد
(پیکان سمت چپ) صفحه قبلی

تنظیمات

آیا می‌خواهید به این مورد امتیاز دهید یا به فهرست اضافه کنید؟

ورود