Closed PrinceOfAbyss closed 2 years ago
This is probably not a bug, but explicitly set by IMDb. I guess they don't have the rights or permissions to show some trailers outside their site, so they might simply set the headers to disallow that.
However, the iframe sources you provided had some dead URLs in it. Simply, you can't view the src via direct link as well.
This is probably not a bug, but explicitly set by IMDb. I guess they don't have the rights or permissions to show some trailers outside their site, so they might simply set the headers to disallow that.
However, the iframe sources you provided had some dead URLs in it. Simply, you can't view the src via direct link as well.
Honestly, I think it's a bit more complicated than that! Basically what I do is I take the vi
video id that this class is scraping, and put it in the code provided by their stock embed feature (image below)...
It's that URL that is not working for some videos, while it works for others... Also, a URL that doesn't work in its 'embed' form, when you take out the 'embed' relevant part of it, it works just fine!!!
Take a look at the following URLs:
https://www.imdb.com/video/imdb/vi2945515801/imdb/embed?autoplay=false&&width=640 <- This doesn't work
https://www.imdb.com/video/imdb/vi2945515801 <- But if you take out the embed part /imdb/embed?autoplay=false&&width=640
it redirects to the link below, which works fine
https://www.imdb.com/video/vi2945515801 <- This works fine
Also for the embed links that work, ie the one below, you can replace the 2nd occurrence of imdb in the link, and it will still work. So all of the links below work just fine whether you put the iframes in a blank page, or use the iframes' src directly as an address
https://www.imdb.com/video/imdb/vi1726152985/imdb/embed?autoplay=false&width=640 https://www.imdb.com/video/aaaaaa/vi1726152985/imdb/embed?autoplay=false&width=640 https://www.imdb.com/video/bbbbbbbb/vi1726152985/imdb/embed?autoplay=false&width=640 https://www.imdb.com/video/gggg/vi1726152985/imdb/embed?autoplay=false&width=640 https://www.imdb.com/video/chair/vi1726152985/imdb/embed?autoplay=false&width=640
Yeah, so there is probably nothing you can do. If IMDb doesn't allow/want you to embed the video, they will enforce that.
All movies TrailerAsUrl: n/A why?
I've updated getTrailerAsUrl
in https://github.com/FabianBeiner/PHP-IMDB-Grabber/commit/8d745276472181e1be9c559bc65d2b9317f50cb8, give it a try.
I'm so sorry for opening this issue @FabianBeiner and @bla0r when it's not an issue with this great project!
I'm just hoping for some insight on this problem I'm facing...
So, I'd like to be able to embed some trailers I'm acquiring through this class... I found this stock IMDb tool that even produces the embed code for you...
The produced code looks like this:
Then I thought that by changing the
vi9999999999
param in the iframe's source, I'd be able to get any other trailer embedded in my site... Wrong... Some videos play normally, while others complain about the x-frame-options: sameorigin directive/policy in effect...If it didn't work at all, I'd perfectly understand that... But why does it work on some videos, and on some others it doesn't?
From the collection of iframes below, 50% of them work, while the other 50% don't...
I'm totally confused about this. Can you shed some light on this please? TIA