Home

Awesome

plutoTV-tvheadend

Perl-Script to generate m3u and xmltv-epg from PlutoTV-API.
Works best using streamlink in current version.

There are two ways to use these scripts:

I recommend using plutotv-localserver.pl to ensure that the channel list (m3u8) is always up-to-date.

install used modules

sudo cpan install DateTime DateTime::Format::Strptime JSON JSON:Parse HTTP::Request URI::Escape LWP::UserAgent UUID::Tiny File::Which

when using plutotv-localserver.pl also: sudo cpan install HTTP::Request::Params HTTP::Daemon HTTP::Status HTTP::Request::Common HTTP::Cookies Net::Address::IP::Local

usage

perl plutotv-generate.pl [--createm3u] [--usebash] [--useffmpeg | --usestreamlink]

or

perl plutotv-localserver.pl [--localonly] [--port <portnumber>] [--usestreamlink] (or start as systemd-daemon)

meaning of params

plutotv-generate.pl

parametereffect
--createm3ucreate playlist-file plutotv.m3u8 and xmltv-file plutotv-epg.xml
--usebashcreate bash-file for each pluto-tv-channel for starting service
--useffmpegwill use ffmpeg-pipe instead of using original URL to channel
--usestreamlinksame as --useffmpeg, but using streamlink instead of ffmpeg

plutotv-localserver.pl

parametereffect
--localonlywill configure server to listen on localhost 127.0.0.1
--port <number>set listening-port for server (default: 9000)
--usestreamlinkprovide playlist with call for streamlink instead ffmpeg

available endpoints for localserver

endpointtask
/playlistpath to get m3u8-file
/master3u8?id=path to get playlist.m3u8 for given channelid
/channel?id=path to get ts via ffmpeg or streamlink for given channelid
/epgpath to get xmltv-epg-file

how to load xmltv-guide into tvheadend

cat plutotv-epg.xml | socat - UNIX-CONNECT:/var/lib/hts/.hts/tvheadend/epggrab/xmltv.sock

more

PlutoTV only delivers timelines 6h in future. So epg has to be fetched at least every 6 hours: crontab: 15 */6 * * * perl plutotv-generate.pl

or

15 */6 * * * wget http://localhost:9000/epg -O plutotv-epg.xml