s9e Media Sites

s9e Media Sites 2.18.6

No permission to download
Hi there,

I just updated to XF2.3, using PHP 8.3 and I get this error:
An exception occurred: [ErrorException] [E_WARNING] Undefined array key "src" in src/addons/s9e/MediaSites/Helper.php on line 239

Thank you
Fabian
 
Is there anyway around Youtube blocking embedded play?
 

Attachments

  • Screenshot 2024-07-31 at 13.48.59.webp
    Screenshot 2024-07-31 at 13.48.59.webp
    6 KB · Views: 3
Not sure related to this addon of XF itself but after upgrading to 2.3, I started getting the error below:

TypeError: Template public:_media_site_embed_soundcloud error: XF\Util\Str::strtolower(): Argument #1 ($string) must be of type string, null given, called in /home/public_html/src/XF/Template/Templater.php on line 4454 src/XF/Util/Str.php:210
 
Is there anyway around Youtube blocking embedded play?
I don't think so but if you send me the video's URL (here or in DM) I'll take a look at it. It's theoretically possible that blocking referrers may make it available. Either way it won't work around geoblocking. An alternative frontend such as Invidious may be an option, although I haven't tried it personally.

Not sure related to this addon of XF itself but after upgrading to 2.3, I started getting the error below:

TypeError: Template public:_media_site_embed_soundcloud error: XF\Util\Str::strtolower(): Argument #1 ($string) must be of type string, null given, called in /home/public_html/src/XF/Template/Templater.php on line 4454 src/XF/Util/Str.php:210
Edit the post that generates that error (so that you can read it in text form) and send me the [MEDIA=soundcloud]...[/MEDIA] BBCode that's in it. I'll try it out locally to confirm whether or not I can reproduce that error on my 2.3 board.
 
Try upgrading the add-on because I don't see anything in the current version that could possibly trigger this error.
Thank you, but I was using the newest version already. Our developer said, it must have something todo with PHP 8.3 (wich probably isn't fully supported yet) and the stricter handling of arrays.

Code:
An exception occurred: [ErrorException] [E_WARNING] Undefined array key "src" in src/addons/s9e/MediaSites/Helper.php on line 239

XF::handlePhpError() in src/addons/s9e/MediaSites/Helper.php at line 239
s9e\MediaSites\Helper::replaceIframe() in src/addons/s9e/MediaSites/Helper.php at line 136
s9e\MediaSites\Helper::s9e\MediaSites\{closure}()
preg_replace_callback() in src/addons/s9e/MediaSites/Helper.php at line 130
s9e\MediaSites\Helper::replaceIframes() in src/XF/Extension.php at line 69
XF\Extension->fire() in src/XF/App.php at line 3319
XF\App->fire() in src/XF/Template/Templater.php at line 1820
XF\Template\Templater->renderTemplate() in src/XF/Template/Template.php at line 24
XF\Template\Template->render() in src/XF/Mvc/Renderer/Html.php at line 50
XF\Mvc\Renderer\Html->renderView() in src/XF/Mvc/Dispatcher.php at line 471
XF\Mvc\Dispatcher->renderView() in src/XF/Mvc/Dispatcher.php at line 453
XF\Mvc\Dispatcher->renderReply() in src/XF/Mvc/Dispatcher.php at line 412
XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 66
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2777
XF\App->run() in src/XF.php at line 798
XF::runApp() in index.php at line 23
 
Thank you, but I was using the newest version already.
My bad, I thought I was looking at the latest version but I was actually looking at a future (unreleased) version, that's why I couldn't find anything that could possibly trigger that error.

I'm going to look into it asap. In the meantime, you can try going to your admin panel, search for s9e_MediaSites_ClickToLoad_Oembed in the search engine (top right, or you can go to the add-on's options directly) and uncheck the Add a title to the click-to-load placeholders where available. It may be related. If it doesn't fix your issue, please send me the text content of any one post that triggers that error so that I can reproduce it locally.
 
I don't think so but if you send me the video's URL (here or in DM) I'll take a look at it. It's theoretically possible that blocking referrers may make it available. Either way it won't work around geoblocking.
https://www.youtube.com/watch?v=UGPrHj1nPt0
Unless geoblocking is only on embedded player, it works/plays within YT.
 
It's not just geoblocking, publishers can disable embedding altogether, or with some granularity (restrict to a list of domains, for example.)

By the looks of it, this specific video doesn't allow embedding at all. It is possible to embed it via an Invidious mirror, but I don't know what form it would take at the add-on's level and I'd have to spend more time thinking about it. If that type of videos is frequent on your board, you may want to create a custom Invidious media site using your preferred instance.
 
Hey @JoshyPHP We discussed Donald Trump's platform TruthSocial and how to add the capability by adding it to Mastodon hosts. As someone later pointed out, he is the Republican nominee and his platform is probably utilized by millions of people and having a forum full of users that are talking politics for the next 3 months, it would be super sweet if there was any way to figure out why the "Truths" don't embed properly due to height issues. The two pics below just illustrate a tweet of his w/ a pic that doesn't display fully (and then what it's suppoosed to look like) and then a short tweet of his that for whatever reason has an extended lower area.

If it's an issue on their end or too difficult or whatever, understand. Not that big of a deal but boy, it would be pretty cool if it worked. Thanks either way. Great add-on.

truth.webp

truth2.webp
 
If it's an issue on their end [...]

Yes, I'm afraid this is entirely on their end. From what I understand, Truth Social is based on a fork of Mastodon that has not been kept in sync with the original. Comparing their embed.js file, I see that they are missing this fix related to embeds' resizing. Truth Social's embed.js file contains a custom modification that adds a fixed amount of padding set to 165px, which may be an attempt to mitigate issues related to resizing, I don't know.

There is a secondary issue in Truth Social's code in that (as far as I can tell) they have disabled this part of the original code which is responsible for answering queries about the embed's height. Being aware of potential resizing issues in that type of embeds (Mastodon or others, this is a common issue) I have set the add-on to periodically ask/poll the embedded page about its current size, so that even if the provider (here, Truth Social) does not proactively notifies the embedder in real time that the content needs to be resized, it should still end up with the right dimensions eventually.

Your best bet here would be to report this to Truth Social's team. If they re-enable communication (the embedded page needs to reply to setHeight messages) then the embeds should get resized correctly. I should also mention that their official embed code (seen below) suffers from similar issues. The content isn't resized to the correct dimensions, although you still get to see 165 more pixels of it due to the fixed padding.
HTML:
<iframe src="https://truthsocial.com/@realDonaldTrump/112884145655105485/embed" class="truthsocial-embed truthsocial-video" style="max-width: 100%; border: 0" width="600" allowfullscreen="allowfullscreen"></iframe>
<script src="https://truthsocial.com/embed.js" async="async"></script>
 
Edit the post that generates that error (so that you can read it in text form) and send me the [MEDIA=soundcloud]...[/MEDIA] BBCode that's in it. I'll try it out locally to confirm whether or not I can reproduce that error on my 2.3 board.

Code:
[MEDIA=soundcloud]track_id=8735394[/MEDIA]
1722618688628.webp
 
That's a different error message, but at least with this one you know what to do: reinstall the add-on and it should be fixed.
 
That's a different error message, but at least with this one you know what to do: reinstall the add-on and it should be fixed.
I already did but it didn't fix the issue. It is not a diffrent error message. Admin log error is same. This is what you see in the frontend.
 
I looked into the PHP error from earlier and I confirmed it on XF 2.3. Something has changed between 2.2 and 2.3, and other templates may be affected. I'll need to check whether this is the expected behavior in XF 2.3, and if so I'll have to inspect all templates. In the meantime, I manually fixed the SoundCloud template for this specific type of embeds.
 
I looked into the PHP error from earlier and I confirmed it on XF 2.3. Something has changed between 2.2 and 2.3, and other templates may be affected. I'll need to check whether this is the expected behavior in XF 2.3, and if so I'll have to inspect all templates. In the meantime, I manually fixed the SoundCloud template for this specific type of embeds.

We're still on Xen v2.2 and running your addon v2.11.1. Should we wait to update to Xen 2.3 before updating your addon to the most recent version?

Thanks!
 
I don't think it's worth delaying your upgrade. Only a handful of sites are potentially affected, and it requires some specific circumstances to be able to trigger the error. The error itself doesn't prevent the rest of the post to be displayed.

A cursory look at the sites that match at least one of the criteria returns the following list: bbcnews, cbsnews, democracynow, facebook, gist, internetarchive, msnbc, pinterest, soundcloud, ted.
 
Back
Top Bottom