Advice Needed - ADBTuner or AH4C?

@uspino
I fixed the bmitunetest.sh to bmitune.sh...

The Spectrum App uses DeepLinks to go directly to the live stream for each channel tuned. I don't know your apps or whether they have deep links for the live stream or not. I currently don't know how you go about finding the deeplinks for the ATV. But...we should be able to tune them manually.

As far as the Tennis Channel and CNN Max app or any others.
I will assume 2 things.

  • The app is installed on the ATV that you are using as a tuner
  • You can step through the screens using the remote and play the content you are asking about.

Part 1: Using Portainer and ah4c stack Exec Console

  • Go to the ah4c Stack and log into the Exec Console again.
  • Type atvremote --storage-filename /root/.android/.pyatv.conf -s 10.10.11.42 app_list
  • Look through list and find the name of the app you want
  • In Spectrum's case it is called Spectrum TV
  • Remove any spaces in the name and try to launch it
  • Type atvremote --storage-filename /root/.android/.pyatv.conf -s 10.10.11.42 launch_app=spectrumTV:
  • You have to remove all spaces and it may not care about capitalizations. Don't forget the ":" at the end. On the ATV it may ask you if you are trying to launch a specific app the first time and you will have to confirm.

Ok now that you know how to lauch the app...

Part 2: Figure out the remote commands to move through App and start stream if needed...

  • Launch the App...then type in some of the following commands to figure out the correct sequence of commands to get to live stream while watching the ATV output.

atvremote --storage-filename /root/.android/.pyatv.conf -s 10.10.11.42 up
atvremote --storage-filename /root/.android/.pyatv.conf -s 10.10.11.42 down
atvremote --storage-filename /root/.android/.pyatv.conf -s 10.10.11.42 right
atvremote --storage-filename /root/.android/.pyatv.conf -s 10.10.11.42 left
atvremote --storage-filename /root/.android/.pyatv.conf -s 10.10.11.42 select

  • Create a command combining the required commands with any needed delays to make sure it works everytime...

Example: atvremote --storage-filename /root/.android/.pyatv.conf -s 10.10.11.42 up delay=100 up delay=200 right right delay=400 select

Part 3: Use "Case" in bmitune.sh script to launch specific channel

Possible m3u file

#EXTM3U
#EXTINF:-1 channel-id="1001" channel-number="1001" tvg-name="Tennis" tvc-guide-stationid=" ",Tennis_Channel
http://{{ .IPADDRESS }}/play/tuner/1001
#EXTINF:-1 channel-id="1002" channel-number="1002" tvg-name="CNN_Live" tvc-guide-stationid=" ",CNN_Live
http://{{ .IPADDRESS }}/play/tuner/1002

Possible bmitune.sh

/bin/bash

channelID="$1"
streamerIP="$2"

case $channelID in

  1001)
    atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP launch_app=TennisTV:
    atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP up delay=100 up delay=200 right right delay=400 select
    ;;

  1002)
    atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP launch_app=MaxCNN:
    atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP up delay=100 up delay=200 right right delay=400 select
    ;;

  *)
    #run this line if nothing matched earlier
    ;;
esac

Let me know how it all works.

Everything is up and running. I had to play with the delay and sleep options to avoid some hiccups. I also added a turn_on command to wake up the ATV before launching the app. Do you also do that? Here's how it looks. First the m3u file (Is there a way to force a specific channel number in CDVR guide? They seem to appear with random numbers in my guide):

#EXTM3U

#EXTINF:-1 channel-id="Tennis Channel" channel-number="8888",TENISHD
http://{{ .IPADDRESS }}/play/tuner/8888

#EXTINF:-1 channel-id="CNN" channel-number="8889",CNNHD
http://{{ .IPADDRESS }}/play/tuner/8889

And here is bmitune.sh:

#!/bin/bash

channelID="$1"
streamerIP="$2"

case $channelID in

  8888)
        atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP turn_on
        sleep 2
        atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP launch_app=com.tennischannel.tceverywhere
        sleep 8
        atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP menu delay=200 down delay=200 down delay=200 down delay=200 down delay=200 down delay=200 select 
        ;;
  8889)
        atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP turn_on
        sleep 2
        atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP launch_app=com.wbd.stream
        sleep 5
        atvremote --storage-filename /root/.android/.pyatv.conf -s $streamerIP select delay=4000 up delay=200 right delay=200 right delay=200 right delay=200 right delay=200 right delay=400 down delay=400 select
         ;;
  *)
            #run this line if nothing matched earlier
        ;;
esac

It's very smart to force-quit the app via stopbmitun.sh when streaming is done.

Ands that's it, hope this thread helps somebody else with Apple TV. Let me know what you think, thanks!

Great to hear everything is working...

I disabled sleep instead.

Did you set it to "Prefer channel-number from M3U" when adding it to CDVR...as long as the numbers don't conflict with something already there I believe it will use your m3u numbers.

I actually changed a handful of settings on the AppleTV...

Sleep After: Never
TV Button: Home Screen
Automatically Update Apps: Off
Automatically Install Apps: Off
Offload Unused Apps: Off
Software Updates:Automatic Updates:Off
Siri:Off

Some apps don't always start up right on app_launch if it is already running and since you are using button presses to navigate it gives you a consistant starting point at channel launch... :slightly_smiling_face: :+1:

Definitely a better option, don't think ATV power consumption in Main Menu is relevant.

Is there deep-linking to different channels in Sling TV app (in the form of launch_app=spectrumTV://watch.spectrum.net/livetv/$channelID)? There seems to be conflicting info on this...

Sling TV Tuning with AppleTV and ah4c

I did a little experimenting with the Sling TV app on the AppleTV...
Looks like they do have deep linking working on it right now.

I don't have a Sling TV subscription so this was done with a few freestream channels and they were able to load and play multiple shows in a row for over 2 hours so it appears that the way I did it is pointing to the "channel" not the individual show.

Start by installing Sling TV on Apple TV tuner
Test starting up Sling TV using atvremote command...

atvremote -s 10.10.11.42 launch_app=slingtv:

First time you may have to confirm that you want to launch the Sling TV app.

Using a computer go to
https://watch.sling.com/dashboard/grid_guide/grid_guide_all

Find a channel you want and select it so it starts to play. After it starts playing right click on playing video and select the option "Create QR code for this page"
Copy the link they show and attach it after the launch_app=slingtv: removing the http: so it starts with the //

Here are 3 samples that should launch...

Alien Nation Channel
atvremote -s 10.10.11.42 launch_app=slingtv://watch.sling.com/1/asset/51f52123df99dc6d97e5887fdf23e6c3/watch

CBS 24/7 News Channel
atvremote -s 10.10.11.42 launch_app=slingtv://watch.sling.com/1/asset/0bf0d288245ed13cb11b9c87a4bc62ba/watch

Alf TV Channel
atvremote -s 10.10.11.42 launch_app=slingtv://watch.sling.com/1/asset/bf658731eeb0d9d4ab7023803cf0caff/watch

Depending on the channels you add you may be able to find guide data inside Channels but I have not tried.
Good Luck

1 Like

It absolutely works! For those using Safari, no QR code creation option, but the same channel id appears in the address bar while watching a channel. I hope this id number does not change often. Again, thanks a lot for taking the time to check this!

1 Like

Update: well, it only took a few days for Sling to change the stream IDs, so I guess I'll have to forget about deep-linking and go back to remote commands. Was really smooth while it worked, but after a few days I got into the "This content is not available".

@uspino

Did you spot check one of the id's for a channel or two to see if they really did change?

I believe Sling is known to not always be the most reliable streaming service.

You sure Sling isn't down/having issues???
If they take to long to tune it will error out.
I am getting lots of errors trying to watch directly from website right now.
Taking LONG time to either load a channel or say error can't play right now. :man_shrugging:

Yes. And when I copy/paste the new channel ID's to the bmitune.sh file it starts working fine again, and tuning straight into the channel stream. I'll see how often this happens...

@uspino

Sorry to here that.
I think some people have figured out how to run something that can scrape a website and maybe pull the information out then auto put it in a m3u. But that is currently beyond my humble skills by about 2 miles... :rofl: I may have to do some research at some point and see if I can figure it out.

FYI...The AppleTv's demanded I update the apps this morning or would not work. So far this seems to happen every 6 months or so...but I still prefer to leave the automatic updates off. I may have to revisit this at some point.

Also in case you haven't seen it some updates have been made to the apple:test* images and everything seems to be working good.

I have already updated mine this morning and am having no issues with it.