Picking the correct tvc-guide-stationid for a channel

Does anyone have a better way to find the correct stationid for a channel?

What I've been doing is to grab a list of possible stationid's and put them in a custom channel m3u text playlist.
One stationid per channel number in the playlist like so.

m3u playlist
#EXTM3U x-tvg-url="http://192.168.1.3:8183/epg.xml"
#EXTINF:-1 channel-id="frndly-46" tvg-id="frndly-46" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/rjrwwh.png" tvc-guide-stationid="91415" tvg-chno="9001",Decades-91415
http://192.168.1.3:8183/play/decades.m3u8
#EXTINF:-1 channel-id="frndly-46" tvg-id="frndly-46" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/rjrwwh.png" tvc-guide-stationid="112941" tvg-chno="9002",Decades-112941
http://192.168.1.3:8183/play/decades.m3u8
#EXTINF:-1 channel-id="frndly-46" tvg-id="frndly-46" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/rjrwwh.png" tvc-guide-stationid="122694" tvg-chno="9003",Decades-122694
http://192.168.1.3:8183/play/decades.m3u8
#EXTINF:-1 channel-id="frndly-47" tvg-id="frndly-47" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/wwkont.png" tvc-guide-stationid="81349" tvg-chno="9011",Heroes & Icons-81349
http://192.168.1.3:8183/play/heroes___icons.m3u8
#EXTINF:-1 channel-id="frndly-47" tvg-id="frndly-47" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/wwkont.png" tvc-guide-stationid="90401" tvg-chno="9012",Heroes & Icons-90401
http://192.168.1.3:8183/play/heroes___icons.m3u8
#EXTINF:-1 channel-id="frndly-47" tvg-id="frndly-47" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/wwkont.png" tvc-guide-stationid="110477" tvg-chno="9013",Heroes & Icons-110477
http://192.168.1.3:8183/play/heroes___icons.m3u8
#EXTINF:-1 channel-id="frndly-47" tvg-id="frndly-47" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/wwkont.png" tvc-guide-stationid="120460" tvg-chno="9014",Heroes & Icons-120460
http://192.168.1.3:8183/play/heroes___icons.m3u8
#EXTINF:-1 channel-id="frndly-48" tvg-id="frndly-48" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/skjrxz.png" tvc-guide-stationid="74916" tvg-chno="9021",Start TV-74916
http://192.168.1.3:8183/play/start_tv.m3u8
#EXTINF:-1 channel-id="frndly-48" tvg-id="frndly-48" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/skjrxz.png" tvc-guide-stationid="109454" tvg-chno="9022",Start TV-109454
http://192.168.1.3:8183/play/start_tv.m3u8
#EXTINF:-1 channel-id="frndly-48" tvg-id="frndly-48" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/skjrxz.png" tvc-guide-stationid="122695" tvg-chno="9023",Start TV-122695
http://192.168.1.3:8183/play/start_tv.m3u8
#EXTINF:-1 channel-id="frndly-48" tvg-id="frndly-48" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/skjrxz.png" tvc-guide-stationid="122772" tvg-chno="9024",Start TV-122772
http://192.168.1.3:8183/play/start_tv.m3u8

I then run a curl/jq script that creates an airing listing for each stationid and compare the listings to see where any differences are and record that time slot to see what actually aired.

A lot of work.

1 Like

Here's an example of the curl command I use to get the scheduled airings from a channel.
It's based on what an Advanced Pass does when the only criteria is Channel == CH#

Using the first channel (9001) from the custom M3U source in my previous post.

#EXTINF:-1 channel-id="frndly-46" tvg-id="frndly-46" tvg-logo="https://d229kpbsb5jevy.cloudfront.net/frndlytv/400/400/content/common/logos/channel/logos/rjrwwh.png" tvc-guide-stationid="91415" tvg-chno="9001",Decades-91415
http://192.168.1.3:8183/play/decades.m3u8

This is channel 9001 using stationId 91415 for a Decades channel.
The curl command will emulate what viewing the match results of the Advanced Pass does and return a listing of (up to) the next 500 airings on channel 9001.

Since I run this on Windows, I need to escape double quote marks and open parens with the Windows command line escape character \

curl "http://192.168.1.3:8089/dvr/rules/test" --data "{\"EQ\":{\"Channel\":\"9001\"},\"Name\":\"What is on this channel\",\"Paused\":true}"

Here is the command broken down with the escape chars removed for easier viewing

curl 
"http://192.168.1.3:8089/dvr/rules/test" 
--data 
"{"EQ":{"Channel":"9001"},"Name":"What is on this channel","Paused":true}"

Now I want to format that raw json output that was returned into a tabular text format for easy comparison by piping it into the jq command-line utility and having the output redirected into the text file Decades-9001-91415.txt.

Again, since I run this on Windows, I need to escape double quote marks and open parens with the Windows command line escape character \

curl "http://192.168.1.3:8089/dvr/rules/test" --data "{\"EQ\":{\"Channel\":\"9001\"},\"Name\":\"What is on this channel\",\"Paused\":true}" | jq --raw-output ".[] | \"\(.Time)-\(.Duration) \(.Title)-S\(.SeasonNumber)E\(.EpisodeNumber)-\(.EpisodeTitle) \(.SeriesID)-\(.ProgramID)\"" > Decades-9001-91415.txt

Here is the command broken down with the escape chars removed for easier viewing

curl 
"http://192.168.1.3:8089/dvr/rules/test" 
--data 
"{"EQ":{"Channel":"9001"},"Name":"What is on this channel","Paused":true}" 
| jq --raw-output 
".[] | 
"(.Time)-(.Duration) (.Title)-S(.SeasonNumber)E(.EpisodeNumber)-(.EpisodeTitle) (.SeriesID)-(.ProgramID)"" 
> Decades-9001-91415.txt

I repeat this for each of the channels in the custom M3U channel source.
It's easy to make a copy of the command for each channel and just have to change the channel# and output filename.

Screenshot in the first post is what I use to compare the text files, Notepad++ using the Compare plugin.

Forgot to add linux version of commands
Need to use linux command line escape character \ on open parens

curl 'http://192.168.1.3:8089/dvr/rules/test' --data '{"EQ":{"Channel":"9001"},"Name":"What is on this channel","Paused":true}' | jq --raw-output '.[] | "\(.Time)-\(.Duration) \(.Title)-S\(.SeasonNumber)E\(.EpisodeNumber)-\(.EpisodeTitle) \(.SeriesID)-\(.ProgramID)"' > Decades-9001-91415.txt

Here is the command broken down with the escape chars removed for easier viewing

curl 
'http://192.168.1.3:8089/dvr/rules/test' 
--data 
'{"EQ":{"Channel":"9001"},"Name":"What is on this channel","Paused":true}' 
| jq --raw-output 
'.[] | 
"(.Time)-(.Duration) (.Title)-S(.SeasonNumber)E(.EpisodeNumber)-(.EpisodeTitle) (.SeriesID)-(.ProgramID)"' 
> Decades-9001-91415.txt