You could use one of the following scripts to generate a playlist. It is not very secure since it will include the user:password, but if that doesn't bother you...
For all enabled services:
#!/bin/bash
# you must have installed jq (apt-get install jq)
############### BEGIN CONFIG ###################
tvh_data_path="/home/hts/.hts"
profile="profile"
admin_pass="admin:password"
user_pass="user:password"
host="192.168.1.13:9981"
############### END CONFIG ###################
wget -O /tmp/services_unsorted.json http://$admin_pass@localhost:9981/api/mpegts/service/grid?limit=100000
#cp /tmp/services_unsorted.json /tmp/services.json
jq '.entries |= sort_by(.network, .svcname)' /tmp/services_unsorted.json > /tmp/services.json
echo \#EXTM3U
entries=$(/usr/bin/jq -c '.total' /tmp/services.json)
for (( service=0; service<= $entries; service++ ))
do
enabled=$(/usr/bin/jq -c '.entries['$service'].enabled' /tmp/services.json)
if [ "$enabled" = "true" ]
then
svcname=$(/usr/bin/jq -c -r '.entries['$service'].svcname' /tmp/services.json)
uuid=$(/usr/bin/jq -c -r '.entries['$service'].uuid' /tmp/services.json)
network=$(/usr/bin/jq -c -r '.entries['$service'].network' /tmp/services.json)
multiplex=$(/usr/bin/jq -c -r '.entries['$service'].multiplex' /tmp/services.json)
desc="$network/$multiplex/$svcname"
echo \#EXTINF:-1, $desc
echo http://$userpass@$host/stream/service/$uuid\?profile=$profile
fi
done
#rm /tmp/services_unsorted.json /tmp/services.json
For all enabled channels:
#!/bin/bash
# you must have installed jq (apt-get install jq)
############### BEGIN CONFIG ###################
tvh_data_path="/home/hts/.hts"
profile="profile"
admin_pass="admin:password"
user_pass="user:password"
host="192.168.1.13:9981"
############### END CONFIG ###################
wget -O /tmp/channels_unsorted.json http://$admin_pass@localhost:9981/api/channel/grid?limit=100000
#cp /tmp/channels_unsorted.json /tmp/channels.json
#jq '.entries |= sort_by(.name)' /tmp/channels_unsorted.json > /tmp/channels.json
jq '.entries |= sort_by(.number)' /tmp/channels_unsorted.json > /tmp/channels.json
echo \#EXTM3U
entries=$(/usr/bin/jq -c '.total' /tmp/channels.json)
for (( service=0; service<= $entries; service++ ))
do
enabled=$(/usr/bin/jq -c '.entries['$service'].enabled' /tmp/channels.json)
if [ "$enabled" = "true" ]
then
svcname=$(/usr/bin/jq -c -r '.entries['$service'].svcname' /tmp/channels.json)
uuid=$(/usr/bin/jq -c -r '.entries['$service'].uuid' /tmp/channels.json)
name=$(/usr/bin/jq -c -r '.entries['$service'].name' /tmp/channels.json)
number=$(/usr/bin/jq -c -r '.entries['$service'].number' /tmp/channels.json)
desc="$number - $name"
echo \#EXTINF:-1, $desc
echo http://$userpass@$host/stream/channel/$uuid\?profile=$profile
fi
done
#rm /tmp/channels_unsorted.json /tmp/channels.json
Edit the top section with the correct data for you (admin username/password, user username/password, profile, and host address:port)
To create an unsorted list, comment out the jq sort and uncomment the cp command.
If you do not want to specify the profile (and just use the default) you can remove the part "\?profile=$profile" from the end of the line.
To see the output in a more readable format, try:
python -m json.tool /tmp/services.json
From there you can see what fields can be used for sorting and/or in the description.
Also, when you get it working how you want, you should probably uncomment the rm at the bottom
Original script was by B C taken from here:
https://tvheadend.org/d/3170-howto-tvheadend-with-powervu?r=19432