Comments (5)
Would need more details about this:
- Is the local config the same (i.e. PHP 8.3.6)?
- What happens? Is an error message shown? Does the console log anything?
- The field makes an API call to fetch the embed data, can you try dumping
kirby()->site()->getEmbedData('https://vimeo.com/868805980')
anywhere on your website, what does it return?
from kirby-embed.
I ran into the same issue, both on the production server as well as my local environment. Both running PHP 8.1.
Running kirby()->site()->getEmbedData('https://youtu.be/s2R6bD2trz4?si=9TAkSLNA3e62QeQU')
produced an error status response with an empty error message.
I disabled the try {} catch {}
in getEmbedData
and got this error: Embed\Http\NetworkException (23)
with an empty message.
Digging further into embeds
CurlDispatcher` class I found out that "23" is an error code that somehow doesn't get resolved to its human message in the process:
An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback.
CurlDispatcher
is providing its own CURLOPT_WRITEFUNCTION
that writes to 'php://temp'
. I logged the writing and it works. I looked upstream in https://github.com/oscarotero/Embed and found neither an error report nor a newer version where they might have fixed this.
I disabled the error exception and the results look fine so for now as my temporary fix I enhanced CurlDispatcher's exec
method with a check to ignore error 23:
if (curl_errno($this->curl) && curl_errno($this->curl) != 23){
$this->error(curl_error($this->curl), curl_errno($this->curl));
}
from kirby-embed.
I found a cleaner way to ignore the error – embed has a built in way:
In siteMethods.php
you can change:
$embed = new Embed\Embed();
To:
use Embed\Http\Crawler;
use Embed\Http\CurlClient;
...
$client = new CurlClient();
$client->setSettings([
'ignored_errors' => [23]
]);
$embed = new Embed\Embed(new Crawler($client));
from kirby-embed.
Sync also failed on my side when trying with any Youtube video. Here's what happen when I try with https://www.youtube.com/watch?v=ZXJWO2FQ16c
for example :
![Capture d’écran 2024-06-11 à 21 04 16](https://private-user-images.githubusercontent.com/764332/338713720-e0645da4-d2b2-440c-b217-e8f3439ff5c8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyOTEwMDQsIm5iZiI6MTcyNDI5MDcwNCwicGF0aCI6Ii83NjQzMzIvMzM4NzEzNzIwLWUwNjQ1ZGE0LWQyYjItNDQwYy1iMjE3LWU4ZjM0MzlmZjVjOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMlQwMTM4MjRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02M2ZmMTRjNjczNjM1N2U4ZGRkMmZjNmZjNDYwZDkxNjZiNjllZjlkNGI4MjMyOGJlZGU0MzA0MzQ0MWJlMDI0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.7Du6VB5jCCWwYMYyeTQefXMguJVI-0sGICQM4hdxJF8)
Env info
PHP: 8.3.6
K: 3.10.0.1
Plugin: 1.1.2
Debug
It happens only on the production machine hosted by Uberspace. Not on local env. 🤔 Also, it works with Vimeo link but not with a Youtube link.
Here's what I get when I try <?php dump(kirby()->site()->getEmbedData('https://www.youtube.com/watch?v=ZXJWO2FQ16c')); ?>
on hosted server :
![Capture d’écran 2024-06-11 à 21 13 13](https://private-user-images.githubusercontent.com/764332/338716294-65d64f01-465a-43c4-8c85-93d2899db8cc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyOTEwMDQsIm5iZiI6MTcyNDI5MDcwNCwicGF0aCI6Ii83NjQzMzIvMzM4NzE2Mjk0LTY1ZDY0ZjAxLTQ2NWEtNDNjNC04Yzg1LTkzZDI4OTlkYjhjYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMlQwMTM4MjRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02ZDI4Yjk2YzE0OGJiYmQ1ZWRhZTU0YmU0NThiNGQ1MDFjZTE2ZjYwNWYzNWYzZTNiN2MxZDM1ZTY3NTI2MWU3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.-jS2elyeGNfUQ_S8G1KnKEeeDYec1SJn2H208PmAj3A)
I'll wait for an update, hopefully this feedback helps. Thanks for such a great plugin 🙏
from kirby-embed.
from kirby-embed.
Related Issues (20)
- autoloader issue when kirby-cms-path and kirby-plugin-path are set HOT 6
- Sync failed HOT 9
- Twitter won't sync HOT 3
- Sync error when trying to embed private Vimeo video HOT 9
- Preview does not update when used within Structure field
- Youtube privacy consent information as media content HOT 3
- Feature idea: option for a bigger preview HOT 1
- Check for empty embed field HOT 2
- AspectRatio always returns "56.5" HOT 1
- Instagram embed not working HOT 7
- Storing field from the frontend HOT 6
- 3.8 compatibility
- Sync failed HOT 1
- Consider Bandcamp-support HOT 5
- Video doesn't synchronize on php 8.2 HOT 1
- [K4] 4.0 Compatibility HOT 2
- Plugin stopped working at Strato HOT 12
- Fetch video title for the structure preview
- Add possibility for YouTube privacy-enhanced URLs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kirby-embed.