So while debugging a bit, I found one problem. While the url generated by the scripts works for decrypting/playing the stream from TVHeadend, it was not sending emm info. Finally I noticed that alhough TVHeadend wasn't complaining (even in debug logs), it did not parse the "emm=1" properly. To get it to work, you need to add another "&" between "emm=1" and the trailing sid info for oscam. (":0:0:4")
So to get the emm pids to be sent, the url needs to be changed to something like:
http://pvu:pvu@192.168.1.10:17999/stream/service/5207215882cb76f456a5d65ecfba2124?profile=PowerVU&descramble=0&emm=1&:0:0:4
Here are updated scripts to automatically generate the correct urls.
VLC Playlist:
#!/bin/bash
# you must have installed jq (apt-get install jq)
############### BEGIN CONFIG ###################
tvh_data_path="/home/hts/.hts"
OSEmu="192.168.1.10:17999"
profile="PowerVU"
userpass="pvu:pvu"
############### END CONFIG ###################
echo \#EXTM3U
grep -rnwl $tvh_data_path'/tvheadend/input/dvb/networks' -e '\"caid\": 3584' | while read -r services
do
enabled=$(/usr/bin/jq -c '.enabled' $services)
sid_dec=$(/usr/bin/jq -c '.sid' $services)
sid=$(printf '%x' $sid_dec)
desc=$(/usr/bin/jq -c -r '.networkname' ${services:0:-81}/config)/$(/usr/bin/jq -c -r '.frequency/1000' ${services:0:-42}/config)$(/usr/bin/jq -c -r '.polarisation' ${services:0:-42}/config)/$(/usr/bin/jq -c -r '.svcname' $services)
if [ "$enabled" = "true" ]
then
echo \#EXTINF:-1, $desc
echo http://$userpass@$OSEmu/stream/service/$(basename "$services")\?profile=$profile\&descramble=0\&emm=1\&:0:0:$sid
fi
done
Enigma2 userbouquet:
#!/bin/bash
# you must have installed jq (apt-get install jq)
############### BEGIN CONFIG ###################
tvh_data_path="/home/hts/.hts"
OSEmu="192.168.1.10%3A17999"
profile="PowerVU"
userpass="pvu%3Apvu"
############### END CONFIG ###################
echo \#NAME PowerVU Channels
grep -rnwl $tvh_data_path'/tvheadend/input/dvb/networks' -e '\"caid\": 3584' | while read -r services
do
enabled=$(/usr/bin/jq -c '.enabled' $services)
sid_dec=$(/usr/bin/jq -c '.sid' $services)
sid=$(printf '%x' $sid_dec)
desc=$(/usr/bin/jq -c -r '.networkname' ${services:0:-81}/config)/$(/usr/bin/jq -c -r '.frequency/1000' ${services:0:-42}/config)$(/usr/bin/jq -c -r '.polarisation' ${services:0:-42}/config)/$(/usr/bin/jq -c -r '.svcname' $services)
if [ "$enabled" = "true" ]
then
echo \#SERVICE 1:0:1:$sid:0:0:0:0:0:0:http%3A//$userpass@$OSEmu/stream/service/$(basename "$services")\?profile=$profile\&descramble=0\&emm=1\&%3A0%3a0%3A$sid:$desc
echo \#DESCRIPTION $desc
fi
done