HDMI for Channels

@johnofcamas Have you made in progress with Sling TV on ah4c? I'm giving it a shot myself, so let me know if you've figured anything out, or have any promising strategies for tuning thus far.

EDIT: I have a functioning structure figured out. Additional testing tomorrow, including adding more channels to the M3U.

1 Like

@turtletank If a given app is compatible with the "Live TV" guide, does that suggest (or guarantee) that deep links are supported? And if so, what's the best way to figure out what those links might be?

I have a working solution for Sling TV using keyevents, but I just want to be sure I'm not missing a possible solution using deep links.

Yes.

Sling supports deep links, but nobody has been able to find links that link to a specific channel and not just a specific program.

Figuring out what the links should be is the challenge. More often than not they just match up to the links used in the browser version of the service, but sometimes you just have to try a bunch of variants until something works (or doesn't).

Some tools/methods that can confirm deep link support and provide clues as to the structure of the supported links:


  1. Use apktool (apktool d app.apk) to decompile the apk and review the contents of AndroidManifest.xml. Each activity is broken down in this file along with the supported schemes, protocals, domains, etc.

  2. If you have adb setup and the app installed you can use adb shell dumpsys package package_name to get the same info. Example:

$ adb shell dumpsys package com.sling
Activity Resolver Table:
  Schemes:
      slingtv:
        8b32cae com.sling/.MainActivity filter 7294145
          Action: "android.intent.action.VIEW"
          Category: "android.intent.category.DEFAULT"
          Category: "android.intent.category.BROWSABLE"
          Scheme: "slingtv"
          Authority: "sling.com": -1
          Authority: "watch.sling.com": -1
          Authority: "play": -1
          Authority: "navigate": -1
          Authority: "open": -1
      http:
        8b32cae com.sling/.MainActivity filter ed2009a
          Action: "android.intent.action.VIEW"
          Category: "android.intent.category.DEFAULT"
          Category: "android.intent.category.BROWSABLE"
          Scheme: "http"
          Scheme: "https"
          Authority: "watch.sling.com": -1
          AutoVerify=true
      https:
        8b32cae com.sling/.MainActivity filter ed2009a
          Action: "android.intent.action.VIEW"
          Category: "android.intent.category.DEFAULT"
          Category: "android.intent.category.BROWSABLE"
          Scheme: "http"
          Scheme: "https"
          Authority: "watch.sling.com": -1
          AutoVerify=true
        8b32cae com.sling/.MainActivity filter cb55dcb
          Action: "android.intent.action.VIEW"
          Category: "android.intent.category.DEFAULT"
          Category: "android.intent.category.BROWSABLE"
          Scheme: "https"
          Authority: "slingtv.app.link": -1
          Authority: "slingtv-alternate.app.link": -1
          AutoVerify=true
        8b32cae com.sling/.MainActivity filter 1cef9a8
          Action: "android.intent.action.VIEW"
          Category: "android.intent.category.DEFAULT"
          Category: "android.intent.category.BROWSABLE"
          Scheme: "https"
          Authority: "slingtv.test-app.link": -1
          Authority: "slingtv-alternate.test-app.link": -1
          AutoVerify=true
...

In here you can see that links such as slingtv://watch.sling.com and http(s)://watch.sling.com are supported links that automatically match up to .MainActivity.

  1. If you want to see the URLs being used by the Live TV feature you can do something like adb shell dumpsys activity | grep https which would give you something along these lines:
intent={act=android.intent.action.VIEW dat=https://tv.youtube.com/watch/xxxx?launch=launcher&parentCsn=xxxx&parentTrackingParams=xxx flg=0x00000000 pkg=com.google.android.youtube.tvunplugged cmp=com.google.android.youtube.tvunplugged/com.google.android.apps.youtube.tvunplugged.activity.MainActivity}

I believe that Sling uses the same show specific URLs here as well, but it's been a while since I last checked.

Are you able to log into sling tv and view the channels from your computer? Does each channel have a unique address?

The unique part of the yoututbetv address that I used near the start of this thread as an alternative to automation came from the address that shows up in the browser when you turn each channel from your computer. Does sling hide its address when you use it from a browser?

Presumably, 7f5f5993457648d68db2fa5d5103cbcc would be the unique identifier for Showtime HD?:

Nothing from dumpsys activity | grep https (or http or slingtv), but I am seeing something that's maybe interesting from logcat | grep com.sling:

08-19 11:30:55.841   488   554 I ActivityManager: Start proc 2719:com.sling/u0a192 for service com.sling/com.movenetworks.livetv.LiveTvInputService
08-19 11:30:59.976   488  8424 I ActivityManager: START u0 {act=android.intent.action.VIEW (has data) flg=0x14800000 cmp=com.sling/.MainActivity (has extras)} from uid 10126
08-19 11:31:24.056   488  2751 I ActivityManager: START u0 {act=android.intent.action.VIEW (has data) cmp=com.sling/.MainActivity} from uid 10192

Is that a thread worth pulling on?

Hit play for the live stream for show time and see what the address changes to if any at all. Play or Watch now or whatever starts the live stream.

https://watch.sling.com/1/asset/a9f821f3629fd3f4955d56f96eaf45ce/watch

Try your luck with this from the terminal or some variation of it.

adb -s 192.168.1.171 shell am start -a android.intent.action.VIEW -d https://watch.sling.com/1/asset/a9f821f3629fd3f4955d56f96eaf45ce/watch

Change ip address to your own device of course

So that does work, although if recollection serves, that ID number will change once this movie is over. Also, perhaps this is expected, but I did get this message:

screenshot-htpc6-2023.08.19-12_46_54

I clicked, "Sling TV" and then "Always".

So it changes with each show being aired? Have you seen it do this?

The message should be merely about what you prefer for viewing based on the command you sent from the terminal. It shouldn't bother you anymore once you make your preference known.

The movie is going to change on one of my test channels in less than 10 minutes -- so I'll get back to you shortly.

Oh. I see from your other screenshot that you are on a Fire TV. For some reason the URLs are not included in the dumpsys activity output on that platform.

Try running the following while you load a channel from the guide in the Live section of the Fire interface. It has to be done live as it is not persistent.

adb shell logcat | grep "mPlaybackDeepLinkUri"
08-19 15:06:52.260 22369 22369 I ContextMenuFilteredStationListManager: Setting last tuned station to be: Station{mUserStationPreference=UserStationPreference(id=Key(baseKey=BaseKey(stationKey=ESPN,, source=com.amazon.firetv.youtube.tv/com.amazon.firetv.youtube.UnpluggedTvRecommendationService), profileId=amzn1.actor.person.did.xxx), lastTuneTime=xxx, tags=[], userRanks=[], hashedKey=xxxx), mStationMetadata=StationMetadata{mPackageName='com.amazon.firetv.youtube.tv', mStationKey='ESPN,', mTifName='ESPN', mDisplayName='ESPN', mDisplayNumber='', mEnhancedLogoUrl='https://m.media-amazon.com/images/S/msa-images/station-images/90202f9c13ff393a44e82018eb686366-tms_32645._FMpng_SY540_.png', mLocalLogoPath='content://android.media.tv/channel/32/logo', mAmazonId='amzn1.p11cat.station.xxx', mTifChannelId=32, mTsid=0, mOriginalNetworkId='0', mServiceId='0', mAffiliateCallsign='ESPNHD', mAffiliateName='ESPN HD', mMetadataExpirationTime=xxxx, mAttributes=[HDTV, ENTITLED], mGenres=[com.amazon.live.genre.sports], mProviderGenres=[], mRankingOptions={genre=[com.amazon.livetv.contentservice.sync.svc.model.RankingOption@d616f8a]}, mPlaybackInputId='com.amazon.firetv.youtube.tv/com.amazon.firetv.youtube.UnpluggedTvRecommendationService', mPlaybackChannelUri='content://android.media.tv/channel/32', mChannelType='TYPE_OTHER', mServiceType='SERVICE_TYPE_AUDIO_VIDEO', mExternalIdType='gracenote_ontv', mExternalIdValue='32645', mPlaybackDeepLinkUri='intent://tv.youtube.com/watch/xxxx?launch=guide#Intent;scheme=https;package=com.amazon.firetv.youtube.tv;end', mBrowsable=false, mSearchable=true, mShortName='null', mBarkerChannelId=-1, mUid=32, mInternalChannelNumber=xxxx}}

The URL should hopefully be included like it is with YouTube TV.

Here's the full output:

08-19 13:15:06.060  3437  3437 I ContextMenuFilteredStationListManager: Setting last tuned station to be: Station{mUserStationPreference=UserStationPreference(id=Key(baseKey=BaseKey(stationKey=Showtime,, source=com.sling/com.movenetworks.livetv.LiveTvInputService), profileId=amzn1.actor.person.did.AMC26YQNZB325Y2YB7L3JSVTAFBYTTB42F3ZD5O2KY4IEACGUC45GJAJ56TUYB3NSK6GCWB4), lastTuneTime=1692472503446, tags=[FAVORITE], userRanks=[StationRank(groupId=favorite, rank=0)], hashedKey=42b5b2ac8cd03cbe01520392e54d0bf57283c04e9f3fbb7ed3795073bad1d34b), mStationMetadata=StationMetadata{mPackageName='com.sling', mStationKey='Showtime,', mTifName='Showtime', mDisplayName='Showtime', mDisplayNumber='', mEnhancedLogoUrl='https://m.media-amazon.com/images/S/msa-images/station-images/49addf8a29b25a490628b5e67dbd3677-tms_21868._FMpng_SY540_.png', mLocalLogoPath='content://android.media.tv/channel/17/logo', mAmazonId='amzn1.p11cat.station.f4981c13-4df8-52f2-8723-132293b163d0', mTifChannelId=17, mTsid=0, mOriginalNetworkId='1079', mServiceId='0', mAffiliateCallsign='SHOWHD', mAffiliateName='Showtime HD', mMetadataExpirationTime=1692727485745, mAttributes=[ENTITLED, HDTV], mGenres=[], mProviderGenres=[], mRankingOptions={}, mPlaybackInputId='com.sling/com.movenetworks.livetv.LiveTvInputService', mPlaybackChannelUri='content://android.media.tv/channel/17', mChannelType='TYPE_OTHER', mServiceType='SERVICE_TYPE_AUDIO_VIDEO', mExternalIdType='gracenote_ontv', mExternalIdValue='21868', mPlaybackDeepLinkUri='slingtv://watch.sling.com/1/channel/7f5f5993457648d68db2fa5d5103cbcc/watch?linkContext=amazonLiveTV&trackingId=amazon-gracenote', mBrowsable=false, mSearchable=false, mShortName='null', mBarkerChannelId=-1, mUid=17, mInternalChannelNumber=1.7976931348623157E308}}

So should I try this as my URL?:

mPlaybackDeepLinkUri='slingtv://watch.sling.com/1/channel/7f5f5993457648d68db2fa5d5103cbcc/watch?linkContext=amazonLiveTV&trackingId=amazon-gracenote'

Using the @boukmandutty structure above -- something like:

am start -a android.intent.action.VIEW -d slingtv://watch.sling.com/1/channel/7f5f5993457648d68db2fa5d5103cbcc/watch?linkContext=amazonLiveTV&trackingId=amazon-gracenote

EDIT: Definitely works for the current movie, we'll see if the ID is persistent.

Unfortunately it does change when grabbing the URL from the browser -- but we might be on to something using the @turtletank logcat | grep "mPlaybackDeepLinkUri". It's a different ID altogether. I'll confirm back on the next change of show.

Interesting. I don't have any fire tv devices. I using mainly Nvidia shields and so all that is required for each channels is the address that corresponds to what you see in the web browser.

It seems unlikely it has anything to do with specific hardware or Android OS version, as once the previous movie ended and I stopped streaming, I couldn't use that link again in my computer's browser either.

@turtletank @boukmandutty Unfortunately, the mPlaybackDeepLinkUri isn't persistent either. A soon as you stop the stream, and try to "tune" again it gives an error message. So it looks like we'll need to stick with a keyevent approach for Sling TV.

What I've put together appears to work reasonably well, though of course, slower than using deep links. Thanks to you both for the assistance.

@turtletank @boukmandutty After walking away from the keyboard for a few minutes, I think I have it. It's a bit of a mash-up, but the ID we were after is embedded in the link that shows up when you click on a given channel icon in the (browser) guide:

So the link looks like this for "Showtime Showcase" when not playing anything:

https://watch.sling.com/dashboard/grid_guide/grid_guide_favorites/1/channel/b24b20f009e94eb1ad2441a19f98b7ff/browse

And for that channel the correct deep link would be:

https://watch.sling.com/1/channel/b24b20f009e94eb1ad2441a19f98b7ff/watch

All testing I've done so far has confirmed that this structure works. :slight_smile:

1 Like

Nice find!