shweshi / OpenGraph

A Laravel package to fetch Open Graph data of a website.
https://opengraph.shashi.dev
MIT License
154 stars 29 forks source link

Doesn't get the open graph data from Netflix #75

Closed sebastiaands closed 3 years ago

sebastiaands commented 3 years ago

It doesn't seem to parse the open graph data from Netflix correctly.

When you fetch the open graph data from Netflix (any page on netflix.com) using OpenGraph::fetch('view-source:https://www.netflix.com/nl-en/title/70180387', true)

it only returns:

[
    "viewport" => "width=device-width, initial-scale=1",
]

while the tags seem to be present in the source:

<meta property="og:title" content="Homeland | Netflix"/>
<meta property="og:description" content="CIA analyst Carrie Mathison struggles with mental health and family issues while leading the war against terrorism in this political thriller series."/>
<meta property="og:url" content="https://www.netflix.com/nl-en/title/70180387" id="meta-url"/>
<meta property="og:image" content="https://occ-0-435-769.1.nflxso.net/dnm/api/v6/E8vDc_W8CLv7-yMQu8KMEC7Rrr8/AAAABecpPMdDJbTCAHnkTPNz5_MTnRfgAQ8NuGi1h2O_FZ5y-IcWYq-PZWQ9GhQ0zreFSDbmz48qepCON5qbqtFDq_wJn7dJ.jpg?r=286"/>
<meta property="al:ios:url" content="nflx://www.netflix.com/title/70180387?locale=en-NL"/>
<meta property="al:ios:app_store_id" content="363590051"/>
<meta property="al:ios:app_name" content="Netflix"/>
<meta property="al:android:url" content="nflx://www.netflix.com/title/70180387?locale=en-NL"/>
<meta property="al:android:package" content="com.netflix.mediaclient"/>
<meta property="al:android:app_name" content="Netflix"/>
<meta name="twitter:card" content="summary_large_image"/><meta name="twitter:site" content="@netflix"/>
shweshi commented 3 years ago

Hi @sebastiaands Thanks for using OpenGraph.

This issue maybe because of the URL. The URL is broken and returning no data. See the screenshot.

Screenshot from 2021-02-25 18-25-52

also tried fetching the OpenGraph tags using online tools like opengraph.xyz There also it's not returning OpenGraph tags. Please check: https://www.opengraph.xyz/url/https:%2F%2Fwww.netflix.com%2Fnl-en%2Ftitle%2F70180387/

Also make sure the URL is public and available, and not require authentication.

sebastiaands commented 3 years ago

Hi @shweshi , thank you for your response!

I understand the issue now, it is because of the local content of Netflix. The URL is not available in another region.

I'll close the issue and find another solution!

shweshi commented 3 years ago

Hi @sebastiaands sure.. if you find some solution or workaround, and if it can be incorporated into OpenGraph please raise a Pull Request and help to make OpenGraph better.