IMDB changes

Started by stoner, October 16, 2015, 11:19:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

FooKaS

Like the look of that Stoner.:)
DA TAXMAN

stoner

#1
Wasnt sure where to post this, so I picked here.

As some might be aware I should be getting a bit of free time to jump back into coding again.

One thing I would like to change a bit is the IMDB code on default code.   I have changed it quite alot on my own site to better fit my needs.   One thing I never got to work was the cast section though, so that is removed.   Anyway, personally I think the way I have the memcache being stored is much better, this is due to being able to pull only the bits you need.

Mine = mulity array
Default = cached full output.

One thing I would like todo is update the default code to mine, with maybe a few tweaks here and there (also needs looking over for any stupid little errors I have made)

How would you guys feel about this?  Would you mind losing the cast sections if I cant get it working on it again?

This is a couple of screens of how mine looks right now.



EDIT:
another little bit of code I use on takeupload.php is this.

//Last attempt at trying to find the IMDB link for this torrent.  Lets see if we can find it with a search on IMDB using the torrent name
if (empty($url))
{
class IMDBSearch1 {

        public static function _movieRedirect($movie, $year) {
                $movieName = str_replace(' ', '+', $movie);

                $page = @file_get_contents('http://www.imdb.com/find?s=all&q='.$movieName.' ('.$year.')');
                if(@preg_match('~<p style="margin:0 0 0.5em 0;"><b>Media from .*?href="/title\/(.*?)".*?</p>~s', $page, $matches)) {                       
                        header('Location: http://www.imdb.com/title/'.$matches[1].'');
                        exit();         
                }
                else if(@preg_match('~<td class="result_text">.*?href="/title\/(.*?)".*?</td>~s', $page, $matches)) {




$plorp = substr(strrchr($matches[1],'/'), 1);

$matches[1] = substr($matches[1], 0, - strlen($plorp));
                        return "http://www.imdb.com/title/$matches[1]";
                        exit();
                }
                else {
                        return false;
                        exit();
                }
        }
}

//Try and the get name, find the name upto the year (2014) and split it into an array Name and Year.  Lets avoid some stuff extra more 1080 and above values
preg_match("/(.*).((!720p|!1080p|!480p|!580p)|[1-2][0-9][0-9][0-9])/", "$fname", $movie_info, null, 0);


$url = IMDBSearch1::_movieRedirect("$movie_info[1]", "$movie_info[2]");

}


Basically this is to try and find the IMDB url link.   First the field on the upload form is used if isset.  Then it looks in the description for one (Code not shown here but is all default code)  If nothing is found then the code I posted above kicks in.

Basically this strips the torrent name down to movie name and the year (I would say 99% of torrents are named correctly for this to work)
Once it has them two strings it runs a search on IMDB for the movie.   I would say this code works 90% of the in getting the right info.


I do have other little changes in place which I will look to port over to with some modifications.   I have a poster upload section in the torrent edit page.  This lets staff or the torrent owner upload a poster to our server which will overwrite the poster that was taken by the IMDB code on upload.   As we did noticed that when IMDB had no movie poster it was getting another image from the page.

Anyway, all little improvements in my eyes