MusicChoice Support for DirecTV

Music Choice offer variety of music channels with video and radio stations,access is authorised by TVE credentials.

I tried to do some preliminary job - base code here -> here

However I encounter problem because puppeteer always gives me "network error, press retry to reconnect" error and I cannot fix it :frowning: Usage:

  • extract archive
  • npm install
  • replace in app.js strings YOUREMAIL and YOURPASSWORD with your credentials
  • run node app.js

In app.js I included array of anchors representing different music stations, on Website clicking into anchor reloads musicplayer. Each streaming link can be accessed from player using document.getElementsByTagName("video")[1].attributes[6].nodeValue

Important information: due to weird nature of contracts Music Choice has, TVE authorisation on web lasts ~4hours, while authorisation on mobile device is for 30 days :expressionless:
I tried to:

await page.setUserAgent('Mozilla/5.0 (iPad; CPU OS 12_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148');

but that's apparently a no-go because each stream URL extracted that way had a ?Platform\=Web\ component :frowning:

1 Like

Ok I did something and it is working now.
If anyone intrested I put the code on Github https://github.com/Behinder/MusicChoice_M3u

It requires setting dtvpass and dtvemail variables in .env file.
There is an array of channel links in app.js file, just uncomment channels you want to unlock.

These are for now only for audio channels. There will be black screen present and no artist/track info as I don't know how to fetch it. Also I need suggestions what parameters needs to be filled for better CHannels guide experience

I added support for video channels.

Please keep working on this. Would really love to see this working perfectly.

Nice, someone appreciated :slight_smile: I thought nobody uses MusicChoice. At the moment I am stuck because I don't know how to capture requests from inside iOS app. Without this links going to work only for like 4 hours.
At current stage it should work as expected. Things to to:

  • find some nice logos for channel
  • there is no EPG for video channels so we have to fill this with something
  • artist/track info

Artist track info seems to be tricky as it is not included within the stream :frowning: Musicchoice does present this info in separate fields on the page with additional process working as Ajax that fetches that info from somewhere :frowning:

What do you need captured? I was messing around with my android app, but don't really know what I'm looking at. Was capturing some stuff through fiddler proxy but not really sure what I was looking at.

And do the credential settings only work with direct TV, or can it be used with say xfinity?

currently it works only with DirecTV because only that I was able to test. If you provide me what link goes to authorisation window when you put email and password for Xfinity then I can work it further.

As for proxy, I had the same problem. The thing to capture is URL app is requesting when you hit "DirectTV" button or "XFinity" button as well as User-Agent, and what URL app requesting when you choose for example audio channel with 80s. Web player contain \platform=Web in URL and not sure what needs to be substituted to simulate authorisation from mobile device.
With this, maybe I can obtain links that are valid for 30 days.

Spent a lot of time trying to grab https packets, but the app looks to block any of it. Tried on my phone, android emulator, and rooted tablet. Can only grab http only and that doesn't appear to give any of the info needed.

I see in the first post you mention trying the UserAgent I'm assuming from the iPad browser. The one I get from trying to grab from the app is UserAgent:stagefright/1.2 (Linux;Android 11). Don't know if that could get you anywhere.

you should be possible to grap https using Wireshark or software called Proxyman. If you have any luck let me know :slight_smile:

1 Like

Cracked it, had to modify the app to allow it to give up the https. The authentication for the app gives up this

  "TVEMaximumSessionInMinutes": 20160,
  "MaximumStreamSessionInMinutes": 240,

When I get some more time I'll look at it more. Juggling a one year old and messing with computers gets a little hard.

1 Like

Over 4 hours later and the m3u8 links from the app stopped working.

Kids can be absorbing, that’s true.
As for result I assume this is response for the request,can you provide what request app is doing (delete your credentials if any)

GET https://authservices.musicchoice.com/api/mvpd/2 HTTP/1.1
IsDR: false
mc-platform: Android
mc-api-version: 3.0
Host: authservices.musicchoice.com
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/4.9.0

Nah, replicating that request goes nowhere :frowning:

Could it be because that request is for xfinity and not direct tv like you need?

I see that the request is for Xfinity but that's not the point, the response I get is OK 200, but I cannot do anything with that response anyway, because I won't be redirected. I would need URL to something where I can put login and password to see where I can get :frowning:

I'm working on getting this running on my pc, with xfinity. Mostly there, had to launch browser instead of headless because I'm not quite sure how the login info works. What does the structure of the .env file look like, and what do you name the .env file? I've never really used nodejs before. Got it running without headless running, but needed to adjust the baseplayerurl and looks like I might need to adjust some channels in order to grab the urls. Gonna see about getting an android emulator setup with the modified app to see if packet sniffing is easier for you to use instead of back and forthing with me (someone that's not very familiar with all this). Hahaha

When you manage it to work, feel free to fork or create another branch on github I can later add ability with switch -xfnity -directv depends on user needs.
As for .env file it is common practice to name file that includes environmental variables that are processed during runtime to avoid messing with code. Of course on production server it's better to hardcode the values but for testing it's sufficient to work. As for structure it is simple:

dtvemail=
dtvpass=
iceadmin=
icepass=
host=
port=

the last 4 variables are for generating bash script that transcode each of the audio channel and sends it to icecast server, it's not working yet properly (some problems with escaping characters), so you may leave them blank.

baseplayerurl is the url for the player I get in the browser, I assume for the app access they can be different but not sure if the request then can be captured.

await page.$eval(
    "#usernameInputId",
    (el,dtvemail) => {(el.value = dtvemail)},dtvemail);

  await page.$eval('.inputFieldPass',(el,dtvpass) => {el.value =dtvpass},dtvpass);
  await page.click("#loginSubmitId");
  await page.waitForNavigation();

this is how you handle DirecTV login form, not sure what ID has form fields on Xfinity. As I said that's why I'm developing this for Directv only.