craft-embedded-assets
craft-embedded-assets copied to clipboard
Embed\Exceptions\InvalidUrlException: Invalid url ... (Status code 429)
Bug Description
On my production site, pasting a YouTube URL results in a "Could not retrieve embed information." error.
Interestingly, my staging site of the same project, server & PHP version works successfully (preview shows up after pasting URL).
I see it is returning "Status code 429", which indicates the client application has surpassed its rate limit. Does this mean it is a YouTube issue? Are there any workarounds? We are not even using a large number of YouTube URLs or requests during this initial development phase of the site...
Here's the web.log
error output for this action on the production server:
2024-02-06 17:04:56 [-][1][2jikokf5g3u11cu0rgdpamb8mm][error][Embed\Exceptions\InvalidUrlException] Embed\Exceptions\InvalidUrlException: Invalid url 'https://www.youtube.com/watch?v=wk0sMrLTaLU' (Status code 429) in /home/forge/my-craft-project.com/vendor/embed/embed/src/Embed.php:142
Stack trace:
#0 /home/forge/my-craft-project.com/vendor/embed/embed/src/Embed.php(81): Embed\Embed::process()
#1 /home/forge/my-craft-project.com/vendor/spicyweb/craft-embedded-assets/src/Service.php(123): Embed\Embed::create()
#2 /home/forge/my-craft-project.com/vendor/spicyweb/craft-embedded-assets/src/Service.php(67): spicyweb\embeddedassets\
Service->_getDataFromAdapter()
#3 /home/forge/my-craft-project.com/vendor/spicyweb/craft-embedded-assets/src/Controller.php(168): spicyweb\embeddedass
ets\Service->requestUrl()
#4 [internal function]: spicyweb\embeddedassets\Controller->actionPreview()
#5 /home/forge/my-craft-project.com/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#6 /home/forge/my-craft-project.com/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(
)
#7 /home/forge/my-craft-project.com/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#8 /home/forge/my-craft-project.com/vendor/craftcms/cms/src/web/Application.php(295): yii\base\Module->runAction()
#9 /home/forge/my-craft-project.com/vendor/craftcms/cms/src/web/Application.php(608): craft\web\Application->runAction(
)
#10 /home/forge/my-craft-project.com/vendor/craftcms/cms/src/web/Application.php(274): craft\web\Application->_processA
ctionRequest()
#11 /home/forge/my-craft-project.com/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleReques
t()
#12 /home/forge/my-craft-project.com/web/index.php(21): yii\base\Application->run()
#13 {main}
Potentially related:
Steps to reproduce
- Open "Assets" in Craft Control Panel
- Paste YouTube URL
- "Could not retrieve embed information." error appears
Expected behaviour
Video preview shows up after pasting YouTube URL.
Embedded Assets version
2.11.4
Craft CMS version
Craft CMS 3.9.10