Skip to content

Add <enclosure> in FreshRSS output rss to be compatible with podcast software #1796

@danc

Description

@danc

Hi all,
I played a bit with the code this week-end, my idea being the following :

  • I hear a lot of podcasts coming from various sources, mainly heard on my phone (with the excellent gPodder free software), in disconnected mode (downloading them automatically when I have a wifi access)
  • Some podcasts I follow only interess me partially, and I don't want to download all episodes on my phone
  • after some months of manually crafting a specific rss feed for the episode I want to hear (basically a copy/paste from the original feed, cherry-picking only the interesting episodes, and sometime missing some), I had the idea of the following flow :
    - subscribe all potential podcasts in freshrss
    - mark (star) the desired episodes in freshrss
    - use the existing fresrss rss streams of starred podcasts (e.g https://mydomain.org/rss/i/?a=rss&get=c_10&state=4 ) reinjected in my podcast reader to automatically download the desired episodes

It is almost working out of the box, the only part missing being an additional in the existing rss output stream to be able for the podcast reader to download the episode.
I did a quick and dirty patch to prototype it, and it worked nicely, I am now able to reinject the starred episodes in gpodder.
My patch only adds one line in app/views/index/rss.phtml, and looks like :

        <enclosure <?php echo str_replace("src", "url", strstr(strstr($item->content(),"src"),"controls", true));?> type="audio/mpeg" />

(full example here : https://github.com/danc/FreshRSS/blob/podcast/app/views/index/podcast.phtml )

I don't provide a PR though, because the code would need some improvements I was not able to craft with my limited knowledge of FreshRSS base code. It would need to properly retrieve the download url, the exact mime type, the length of the .mp3, etc ... and verify the compatibility of the rss with the main podcast practises (or manage a specific output apart of the regular rss.phtml).

So this is a submission of the idea for further discussion and improvements, if you find the idea interesting.
I'd be glad to improve my patch to be able to include it in the regular basecode in the longer term.
Any ideas or suggestions ?

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions