trailer.php

cant get the imdb trailer wath is wrong whit my script code

<?PHP if (isset($_GET['play'])==false){ ?> PLAY
TRAILER
<?PHP } else { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $_GET['url']); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); $output = str_replace('"/images/js/app/video/mediaplayer.swf"', '"http://www.imdb.com/images/js/app/video/mediaplayer.swf"', $output); echo $output; curl_close($ch); } ?>

What are you asking help with? Do you mean you want to recode the IMDB site to pull out their trailers?
Did you get written permission to do so? Most of their trailers are not on their site, but are on the movie’s
site.

Or, do you mean you want to scrape out their URL’s that point at a movie elsewhere?

Not really clear on what you are asking help with… More info please!

must see if I can explain it,
I’m about to make a program for my PC that downloads imdb info to my films,
I build from this script http://web3o.blogspot.dk/2010/10/php-imdb-scraper-for-new-imdb-template.html, but the get the error det say "there is not some trailer for this movie "to all movies
sorry my bad angel
http://i.imgur.com/BDk4JVj.png

No problem with your English. I was looking at your problem and found more info for you.

First, IMDB allows everyone to embed their videos into your site if you wish to. Therefore, this is legal and
not a problem.

Next, on their first page of any movie, you get all of the general information about the movie you select.
On that page is NOT any trailers in a viewable format. Therefore, to scrap out these trailers, you need to
use more than one step. I looked at the template PHP code that you are using to acquire the data. It does
not seem to show the trailers as direct links. I will have to run some scraping tests to see if I can come up
with a working version for you.

Basically, you have to alter the current code to locate the trailer info. On IMDB, when you select a trailer,
it takes you to a secondary page. I entered “Godfather” to test with. Then, selected TRAILERS. This sent
me to this page: “http://www.imdb.com//video/imdb/vi1348706585/?ref_=tt_ov_vi”… As you see, there is
no indication in the URL that it is from the Godfather or that it is a trailer except it is inside a “video” folder.
So, you would have to scrap this address from the original page and then re-scrape this new page to locate
the trailer’s code. On this page, the one I just showed you, it has an “EMBED” button next to the video.
This will show you code that you can use for placing this video trailer into your own page. Here is the code
for this “Godfather” trailer:
[php]

[/php] As you see, it is the code that you need to place on your site where you want to show the video. It places the video in place into an "iFrame". I selected the 640-pixel option. To test this, you can place this into your test page and see if the Godfather trailer works. It should. I tried it on my server and it shows up...

So, you would need to first, alter your code to locate the trailer link. Next, scrape that new page for the real
trailer “EMBED” code and that is the code you need to keep to display into your own page where you want
it to display.

Do you understand all of this. I hope so. Let us know if you get it working or if you need further help.
Good luck with your code!

this is my code in my info.php page

<?PHP if (isset($_GET['tab'])){ if (stristr($_GET['tab'],'trailers')){ echo '
'; } } else { echo '
'; } i tryd to past you code insted and i chance the id nummber whit my $movieArray['title_id'] but it dont work

Well, Hyggelig75, in your first code you posted, you set up a SWF player, in other words a FLASH player.
But, to use that, you would need to OWN the video you are playing. Legally you can not play trailers unless
you get permission or own the video. Also, you can NOT directly embed a video on your server unless you
have the video. The “EMBED” code that I gave you is from the IMDB site. It allows you to display their
video trailers on your site inside of an iFrame. It does not allow you to use your own video player. Well, as
far as I know.

So, you would need to grab their EMBED code and then, just display it inside your code. You can save the
EMBED code into a database or just display it when needed. Either way would work. Changing the id num
should work if you have a valid one. The one I used in the EMBED example was vi1348706585 . So, I will
guess that your code inside of your array is not accurate. You should debug the data inside of that first.
Therefore, try adding in a display of the value and stopping the page at that point to see if it fits. So, just
before you display the iframe display it like this:
[php]
die(“current movie ID=***” . $movieArray[“trailer”] . “***”);
[/php]
I added in the stars so you can see if added spaces are in the value. Spaces will cause it to fail. It should
show a number similar to “vi1348706585” which is the one from my example… Also, in your last code post,
you show the source as being from your server, not IMDB’s. You have added in a file “includes/trailer.php”
as part of the iframe. Why? And, what is in this included file? The example I gave you with your added in
movie info array should look more like this:
[php]

[/php] Hope this helps... Let us know...

Well, Hyggelig75, in your first code you posted, you set up a SWF player, in other words a FLASH player.
But, to use that, you would need to OWN the video you are playing. Legally you can not play trailers unless
you get permission or own the video. Also, you can NOT directly embed a video on your server unless you
have the video. The “EMBED” code that I gave you is from the IMDB site. It allows you to display their
video trailers on your site inside of an iFrame. It does not allow you to use your own video player. Well, as
far as I know.

So, you would need to grab their EMBED code and then, just display it inside your code. You can save the
EMBED code into a database or just display it when needed. Either way would work. Changing the id num
should work if you have a valid one. The one I used in the EMBED example was vi1348706585 . So, I will
guess that your code inside of your array is not accurate. You should debug the data inside of that first.
Therefore, try adding in a display of the value and stopping the page at that point to see if it fits. So, just
before you display the iframe display it like this:
[php]
die(“current movie ID=***” . $movieArray[“trailer”] . “***”);
[/php]
I added in the stars so you can see if added spaces are in the value. Spaces will cause it to fail. It should
show a number similar to “vi1348706585” which is the one from my example… Also, in your last code post,
you show the source as being from your server, not IMDB’s. You have added in a file “includes/trailer.php”
as part of the iframe. Why? And, what is in this included file? The example I gave you with your added in
movie info array should look more like this:
[php]

[/php] Hope this helps... Let us know...
Sponsor our Newsletter | Privacy Policy | Terms of Service