madiele / vod2pod-rss

Vod2Pod-RSS converts a YouTube or Twitch channel into a podcast with ease. It creates a podcast RSS that can be listened to directly inside any podcast client. VODs are transcoded to MP3 on the fly and no server storage is needed!
MIT License
207 stars 6 forks source link

[Feature request] Peertube support #76

Closed fwn0 closed 1 year ago

fwn0 commented 1 year ago

Add support for selfhosted server - Peertube and other independent servers, plz.

madiele commented 1 year ago

If you give me a list of those others indipendent streaming services I will open an issue for each of them. And see what I can do when I have some free spare time to investigate them

madiele commented 1 year ago

I've renamed the issue to only include Peertube, for more platform just open a separate issue for each of them

madiele commented 1 year ago

I've made a code refactoring that will allow anyone to contribute with a custom media provider, currently in PR #82 and will be merged soon.

Anyone who wants to contribute will just have to implement the MediaProvider trait and put the implementation in the provider folder. Anyone who wants to try can check the module for more info and can feel free to ask me for any question.

Since I don't use Peertube I don't know if I ever will implement this feature on my own, but if anyone want to take a shot a it feel free to open a PR

madiele commented 1 year ago

As for the peertube support, funnily enough vod2pod is almost able to do it out of the box by adding the instance URL to the whitelist and passing in the RSS feed URL generated by the UI, At the moment this will return an empty list though.

image

this is due to the fact that they don't publish the \<itunes:duration> field inside the media element, for this there is already an issue about it, if it gets resolved peertube will receive automatic support, no extra provider implementation needed

https://github.com/Chocobozzz/PeerTube/issues/4734

an other option would be to use the API to inject the duration during the RSS injection step, which is already done with the youtube provider, but it seems they don't offer any way of easily get that info that is not by scraping the website

madiele commented 1 year ago

@fwn0 there is now peertube support on the beta image, you just need to add the ENV variable PEERTUBE_VALID_DOMAINS=https://peertube.??????.com to the docker compose.

seeking unfortunately does not seem to work due to a bug in ffmpeg it seems, if I find a solution in the future I'll do a patch.

to anyone who want to try to investigate the bug,

ffmpeg -ss 900 -i 'https://??????.?????.com/static/streaming-playlists/hls/fbd0c3a2-31b5-424f-a7be-470cddfe0f00/f1c4ab6c-e093-46a1-9613-8c9da07af9a0-480.m3u8' -acodec libmp3lame -ab 192k -f mp3 -loglevel debug out.mp3

when run with the -ss option ffmpeg will never write any input while reading from the source mp4 file, I could not find any helpful solution onlune.

I will close the issue since what can be done to add support on vod2pod-rss side has been done