FreshRSS / Extensions

A repository containing all the official FreshRSS extensions
GNU Affero General Public License v3.0
350 stars 53 forks source link

added Youtube extension #217

Closed kevinpapst closed 6 months ago

kevinpapst commented 6 months ago

See #216

Dear Reviewer I do not have a running FreshRSS installation for testing. The 8+ year old codebase was upgraded blindly to latest FreshRSS and "modern" PHP style, especially the code regarding user configuration handling needs testing. In other words: install before merge 😁

Alkarex commented 6 months ago

Help to test welcome (I am not a user myself), and optionally to finalise the light code upgrade (e.g. [ ] instead of array(), <?= $x ?> instead of <?php echo $x; ?>, ...) but that is not urgent.

Ping @ImAReplicant Let's merge the latest changes if there is any missing from https://framagit.org/ImAReplicant/freshrss-youtube

pax0707 commented 6 months ago

Updated it yesterday. Didn't notice any issues.

ImAReplicant commented 6 months ago

Hello, I've been browsing the various topics about the youtube extension and there seems to be a misunderstanding about the fork I made.

I never wanted to steal @kevinpapst's work, in fact I had opened an issue to ask if I could integrate the fork (https://github.com/FreshRSS/Extensions/issues/133#issue-1204483674). I thought at the time that the extension was no longer maintained. I may have done it clumsily and I really apologize for that.

The changes I've made concern peertube videos, because without my changes peertube videos wouldn't be integrated.

In extension.php file, line 136 : if (preg_match('#^https?://www\.youtube\.com/watch\?v=|/videos/watch/[0-9a-f-]{36}$#', $link) !== 1) { to if (preg_match('#^https?://www\.youtube\.com/watch\?v=|/w/[0-9a-zA-Z]{22}$#', $link) !== 1) {

line 177 : $url = str_replace('/watch', '/embed', $link); to $url = str_replace('/w', '/videos/embed', $link);

As for the rest of the changes, it was an attempt to modify the display of the peertube description, but it doesn't seem to work anymore. Indeed, the description is displayed in a rather strange way:

![Capture d’écran du 2024-03-16 10-45-30](https://github.com/FreshRSS/Extensions/assets/71564949/db3444ec-8144-4204-9214-27070268439f)

Sorry again for this misunderstanding and the problems it has caused.

kevinpapst commented 6 months ago

Thanks for your explanation @ImAReplicant

From my end this is ready for merge, as @pax0707 confirmed that the current version works.

Let's do the Peertube (how many people use that?) integration either in its own extension or at least in second PR.

Alkarex commented 6 months ago

Could you please update https://github.com/FreshRSS/Extensions/blob/master/repositories.json accordingly?

kevinpapst commented 6 months ago

Done

kevinpapst commented 6 months ago

Thanks for accepting the extension!

Alkarex commented 6 months ago

https://github.com/FreshRSS/Extensions/issues/222