-
Notifications
You must be signed in to change notification settings - Fork 817
Description
Feature Summary
User provided templates populated from user provided regexes
What problem does this feature solve?
For context youtube changed something again. I think the rules for where the embedded player can be embedded are different now? Previously I could open the embed url in a tab by itself and it would play, now it says "player config error" and I have to navigate to the whole youtube UI to see the video. The docs are vague, and suggest that maybe it wants to be on https? Maybe it wants Chrome? Maybe my adblocker is a problem? Maybe it doesn't like swear words in the domain of the site it's embedded in? Maybe the iframe has the wrong ACLs or CORS or attributes? Who knows?
And since changing the youtube player requires a whole-ass issue -> PR -> release -> update cycle, it might be nice to provide a middle ground option like letting a user/admin edit the templates for the youtube player directly in miniflux
Proposed Solution
Ideally I'd like a mechanism that:
- lets me specify regexs to match stuff in the item (possibly at feed level and globally):
item.url =~ /youtube/ && item.url =~ /v=(?<videoid> .*)/ - The option to use the data that it matches to fill in a template:
<iframe src="https://video-jank-layer.com/youtube/[% videoid %].js"></iframe> - Then shove the results of that rendered template at the top of the miniflux's item page
(ideally this would look like like a working youtube player) - Maybe those match names/values can also be exposed via the APIs and in web hooks too? That might be neat.
I'm the only user of my instance, so I'm happy to pay the cost of regex matches and user templates being rendered every time somebody opens an item though I imagine shared instances would want to be more conservative and only do the matches the first time the item is seen, and then store both the key/values and the result of the rendered template in the db so it doesn't have to run every time.
Alternatives Considered
- Setting
add_youtube_video_using_invidious_playeron every feed on myminifluxinstance (~1000 of my 1500 feeds are from youtube) - Writing a janky cron job to mess with the
db(unlikely to help me, let alone others) - Manually opening the youtube url in a new window and keeping the miniflux window open so I can come back and click "mark as unread" or "star" on the item if needed (current solution, not ideal)
Additional Context
(sorry for the perl brain here, but regexes are definitely the answer)
Checklist
- I have searched existing issues to ensure this feature hasn't been requested before.
- I understand that feature requests are not guaranteed to be implemented.
- I agree to follow the project's contribution guidelines.