diff --git a/src/Adapters/Facebook/OEmbed.php b/src/Adapters/Facebook/OEmbed.php index d913964f..5bf19383 100644 --- a/src/Adapters/Facebook/OEmbed.php +++ b/src/Adapters/Facebook/OEmbed.php @@ -8,18 +8,14 @@ class OEmbed extends Base { - const ENDPOINT_PAGE = 'https://graph.facebook.com/v11.0/oembed_page'; - const ENDPOINT_POST = 'https://graph.facebook.com/v11.0/oembed_post'; - const ENDPOINT_VIDEO = 'https://graph.facebook.com/v11.0/oembed_video'; + const ENDPOINT_PAGE = 'https://graph.facebook.com/v25.0/oembed_page'; + const ENDPOINT_POST = 'https://graph.facebook.com/v25.0/oembed_post'; + const ENDPOINT_VIDEO = 'https://graph.facebook.com/v25.0/oembed_video'; protected function detectEndpoint(): ?UriInterface { $token = $this->extractor->getSetting('facebook:token'); - if (!is_string($token) || $token === '') { - return null; - } - $uri = $this->extractor->getUri(); if (strpos($uri->getPath(), 'login') !== false) { parse_str($uri->getQuery(), $params); @@ -28,7 +24,7 @@ protected function detectEndpoint(): ?UriInterface } } $queryParameters = $this->getOembedQueryParameters((string) $uri); - $queryParameters['access_token'] = $token; + if($token) $queryParameters['access_token'] = $token; return $this->extractor->getCrawler() ->createUri($this->getEndpointByPath($uri->getPath())) diff --git a/src/Adapters/Instagram/OEmbed.php b/src/Adapters/Instagram/OEmbed.php index a0c7bd20..ff7b056b 100644 --- a/src/Adapters/Instagram/OEmbed.php +++ b/src/Adapters/Instagram/OEmbed.php @@ -8,23 +8,19 @@ class OEmbed extends Base { - const ENDPOINT = 'https://graph.facebook.com/v8.0/instagram_oembed'; + const ENDPOINT = 'https://graph.facebook.com/v25.0/instagram_oembed'; protected function detectEndpoint(): ?UriInterface { $token = $this->extractor->getSetting('instagram:token'); - if (!is_string($token) || $token === '') { - return null; - } - $uri = $this->extractor->getUri(); if (strpos($uri->getPath(), 'login') !== false) { $uri = $this->extractor->getRequest()->getUri(); } $queryParameters = $this->getOembedQueryParameters((string) $uri); - $queryParameters['access_token'] = $token; + if($token) $queryParameters['access_token'] = $token; return $this->extractor->getCrawler() ->createUri(self::ENDPOINT)