Giter Site home page Giter Site logo

siriusxm's Introduction

SiriusXM

This script creates a server that serves HLS streams for SiriusXM channels. To use it, pass your SiriusXM username and password and a port to run the server on. For example, you start the server by running: python3 sxm.py myuser mypassword -p 8888

You can see a list of the channels by setting the -l or --list flag: python3 sxm.py myuser mypassword -l

Then in a player that supports HLS (QuickTime, VLC, ffmpeg, etc) you can access a channel at http://127.0.0.1:8888/channel.m3u8 where "channel" is the channel name, ID, or Sirius channel number.

Here's a list of some of the channel IDs:

Name ID
The Covers Channel 9416
Sports 958 9427
Utah Jazz 9294
Sports 975 9212
VOLUME 9442
HLN cnnheadlinenews
Laugh USA laughbreak
Washington Wizards 9295
Carlin's Corner 9181
70s on 7 totally70s
SXM NHL Network Radio 8185
Tom Petty Radio 9407
Underground Garage undergroundgarage
SiriusXM Spotlight 9138
Radio Margaritaville radiomargaritaville
Cincinnati Reds 9237
Portland Trail Blazers 9290
SiriusXM FC 9341
Miami Marlins 9245
SiriusXM Insight 8183
SiriusXM FLY 9339
Red White & Booze 9178
Kids Place Live 8216
New York Islanders 9313
New York Rangers 9314
SiriusXM NASCAR Radio siriusnascarradio
1st Wave firstwave
Los Angeles Rams 9203
Houston Rockets 9276
Washington Capitals 9324
Joel Osteen Radio 9392
Attitude Franco energie2
Classic Rewind classicrewind
SiriusXM PGA TOUR Radio 8186
Miami Heat 9281
80s on 8 big80s
SiriusXM 375 9459
Dallas Stars 9304
Sports 977 9214
Denver Broncos 9155
Hip-Hop Nation hiphopnation
Boston Red Sox 9234
SXM Limited Edition 5 9399
SiriusXM Silk 9364
Flow Nación 9185
Miami Dolphins 9162
Sports 983 9327
Viva 8225
Sports 985 9329
Barstool Radio on SiriusXM 9467
San Francisco 49ers 9202
Sports 992 9336
Arizona Diamondbacks 9231
ESPN Xtra 8254
Utopia 9365
RockBar 9175
Road Dog Trucking roaddogtrucking
Colorado Rockies 9239
Colorado Avalanche 9303
Real Jazz purejazz
Free Bird: LynyrdSkynyrd 9139
Sports 994 9338
Bluegrass Junction bluegrass
Sports 986 9330
CBC Radio One cbcradioone
POTUS Politics indietalk
The Groove 8228
American Latino Radio 9133
Milwaukee Bucks 9282
Comedy Central Radio 9356
Z100/NY 8242
Philadelphia Flyers 9316
Chicago Bears 9151
FOX Business 9369
Washington Redskins 9206
Oklahoma City Thunder 9286
SXM Limited Edition 3 9353
SXM Rock Hall Radio 9174
Dallas Cowboys 9154
Boston Celtics 9268
Los Angeles Clippers 9278
Sports 980 9261
Classic Vinyl classicvinyl
Howard 101 howardstern101
TODAY Show Radio 9390
Sway's Universe 9397
ESPN Deportes espndeportes
Houston Texans 9158
MLB Network Radio 8333
Sports 974 9211
La Politica Talk 9134
BB King's Bluesville siriusblues
60s on 6 60svibrations
Sports 991 9335
C-SPAN Radio 8237
Spa spa73
St. Louis Blues 9320
Kansas City Royals 9242
CBC Radio 3 cbcradio3
SiriusXM 372 9456
The Garth Channel 9421
Howard 100 howardstern100
FOX Sports on SiriusXM 9445
Sports 979 9216
CBS Sports Radio 9473
RURAL Radio 9367
Sports 984 9328
E Street Radio estreetradio
Pop2K 8208
Indiana Pacers 9277
Korea Today 9132
PRX Public Radio 8239
Philadelphia Phillies 9251
Sports 963 9223
Dallas Mavericks 9272
Lithium 90salternative
New Orleans Saints 9165
SiriusXM SEC Radio 9458
The Joint reggaerhythms
Atlanta Braves 9232
BPM thebeat
Sports 981 9262
Florida Panthers 9307
Sports 969 9229
Willie's Roadhouse theroadhouse
SiriusXMU leftofcenter
Family Talk 8307
80s/90s Pop 9373
FOX News Headlines 24/7 9410
Ozzy's Boneyard buzzsaw
Mad Dog Sports Radio 8213
Diplo's Revolution Radio 9472
SiriusXM ACC Radio 9455
Minnesota Timberwolves 9283
ONEderland 9419
SXM Limited Edition 9 9403
Orlando Magic 9287
Sports 960 9220
Indianapolis Colts 9159
San Antonio Spurs 9291
Charlotte Hornets 9269
SiriusXM Stars siriusstars
Phoenix Suns 9289
Canada Laughs 8259
Venus 9389
Sports 989 9333
Minnesota Vikings 9163
Krishna Das Yoga Radio 9179
Vancouver Canucks 9323
En Vivo 9135
Buffalo Sabres 9298
Pittsburgh Pirates 9252
Sports 978 9215
The Highway newcountry
Kirk Franklin's Praise praise
Tampa Bay Buccaneers 9204
SiriusXM Rush 8230
Hair Nation hairnation
SiriusXM NFL Radio siriusnflradio
The Verge 8244
Milwaukee Brewers 9246
Vegas Stats & Info 9448
Petty's Buried Treasure 9352
The Loft 8207
Sports 959 9428
The Emo Project 9447
Yacht Rock Radio 9420
SiriusXM Pops siriuspops
The Bridge thebridge
SiriusXM Preview 0
SiriusXM Hits 1 siriushits1
90s on 9 8206
Cincinnati Bengals 9152
Raw Dog Comedy Hits rawdog
FOX News Talk 9370
Cleveland Browns 9153
Heart & Soul heartandsoul
Faction Punk faction
Toronto Raptors 9293
SiriusXM Scoreboard 8248
Ici Première premiereplus
Cleveland Indians 9238
Chicago White Sox 9236
Los Angeles Chargers 9171
New York Knicks 9285
Carolina Hurricanes 9299
Montreal Canadiens 9310
St. Louis Cardinals 9256
Águila 9186
Sports 988 9332
The Beatles Channel 9446
New York Yankees 9249
EW Radio 9351
Sports 971 9208
Canadian IPR 9358
SiriusXM Comes Alive! 9176
40s Junction 8205
Arizona Cardinals 9146
Sports 961 9221
Elvis Radio elvisradio
enLighten 8229
Atlanta Hawks 9266
Chicago Cubs 9235
Seattle Mariners 9255
Road Trip Radio 9415
Symphony Hall symphonyhall
SXM Limited Edition 11 9405
Latidos 9187
SiriusXM Comedy Greats 9408
Sports 982 9326
Sports 957 9426
Detroit Lions 9156
SiriusXM Chill chill
SiriusXM Pac-12 Radio 9457
Chicago Blackhawks 9302
Cinemagic 8211
SiriusXM Progress siriusleft
Atlanta Falcons 9147
Liquid Metal hardattack
Radio Disney radiodisney
The Blend starlite
Verizon IndyCar Series 9207
Toronto Blue Jays 9259
Octane octane
Jam On jamon
The Billy Graham Channel 9411
Calgary Flames 9301
Triumph 9449
Sports 966 9226
Houston Astros 9241
ESPNU Radio siriussportsaction
Chicago Bulls 9270
Pearl Jam Radio 8370
Caricia 9188
Brooklyn Nets 9267
Sports 990 9334
Denver Nuggets 9273
El Paisa 9414
New York Jets 9167
Iceberg icebergradio
70s/80s Pop 9372
The Message spirit
Minnesota Wild 9309
Nashville Predators 9312
Memphis Grizzlies 9280
PopRocks 9450
SXM Limited Edition 8 9402
Arizona Coyotes 9394
La Kueva 9191
SiriusXM NBA Radio 9385
Sports 967 9227
BBC World Service bbcworld
Sports 976 9213
Rumbón 9190
Ici Musique Chansons 8245
NPR Now nprnow
KIDZ BOP Radio 9366
Sports 973 9210
SXM Limited Edition 4 9398
Velvet 9361
Classic Rock Party 9375
Los Angeles Lakers 9279
Met Opera Radio metropolitanopera
SXM Limited Edition 6 9400
Green Bay Packers 9157
Sacramento Kings 9292
Pittsburgh Steelers 9170
Sports 954 9423
Carolina Shag Radio 9404
KIIS-Los Angeles 8241
Deep Tracks thevault
Business Radio 9359
Philadelphia Eagles 9169
Buffalo Bills 9149
The Spectrum thespectrum
Grateful Dead gratefuldead
Pitbull's Globalization 9406
CNN cnn
Oldies Party 9378
Golden State Warriors 9275
CNBC cnbc
Sports 965 9225
The Catholic Channel thecatholicchannel
New England Patriots 9164
New Orleans Pelicans 9284
ESPN Radio espnradio
Bloomberg Radio bloombergradio
The Heat hotjamz
Columbus Blue Jackets 9300
Sports 968 9228
Oakland Raiders 9168
Sports 972 9209
Detroit Tigers 9240
Pittsburgh Penguins 9318
HBCU 9130
Los Angeles Kings 9308
Ottawa Senators 9315
MSNBC 8367
Outlaw Country outlawcountry
SXM Limited Edition 7 9401
Prime Country primecountry
Jason Ellis 9363
Alt Nation altnation
No Shoes Radio 9418
Radio Andy 9409
Baltimore Ravens 9148
San Jose Sharks 9319
San Francisco Giants 9254
Siriusly Sinatra siriuslysinatra
New York Giants 9166
Doctor Radio doctorradio
Sports 987 9331
San Diego Padres 9253
Texas Rangers 9258
SiriusXM Turbo 9413
Shade 45 shade45
North Americana 9468
Kevin Hart's Laugh Out Loud Radio 9469
Los Angeles Angels 9243
Sports 964 9224
BYUradio 9131
Ici FrancoCountry rockvelours
Washington Nationals 9260
SportsCenter 9180
Baltimore Orioles 9233
EWTN Radio ewtnglobal
Vivid Radio 8369
The Village 8227
Carolina Panthers 9150
Escape 8215
Toronto Maple Leafs 9322
Studio 54 Radio 9145
New Jersey Devils 9311
Sports 962 9222
Kansas City Chiefs 9161
FOX News Channel foxnewschannel
RadioClassics radioclassics
Tennessee Titans 9205
Detroit Red Wings 9305
Telemundo 9466
The Coffee House coffeehouse
Vegas Golden Knights 9453
Neil Diamond Radio 8372
Minnesota Twins 9247
The Pulse thepulse
HUR Voices 9129
Tampa Bay Rays 9257
SiriusXM Love siriuslove
Rock The Bells Radio 9471
Jacksonville Jaguars 9160
Sports 953 9422
Philadelphia 76ers 9288
Oakland Athletics 9250
Canada Talks 9172
Watercolors jazzcafe
Edmonton Oilers 9306
Elevations 9362
SiriusXM Patriot siriuspatriot
On Broadway broadwaysbest
Detroit Pistons 9274
CNN en Español cnnespanol
Tampa Bay Lightning 9321
Indie 1.0 9451
NBC Sports Radio 9452
Celebrate! 9412
Y2Kountry 9340
Los Angeles Dodgers 9244
Sports 993 9337
CNN International 9454
Seattle Seahawks 9201
Cleveland Cavaliers 9271
Luna 9189
Caliente rumbon
Sports 956 9425
Ramsey Media Channel 9443
Faction Talk 8184
Winnipeg Jets 9325
50s on 5 siriusgold
Soul Town soultown
Anaheim Ducks 9296
New York Mets 9248
SiriusXM Urban View 8238
Comedy Roundup bluecollarcomedy
Sports 955 9424
Influence Franco 8246
SXM Fantasy Sports Radio 8368
CBC Country bandeapart
Boston Bruins 9297
Holiday Traditions 9342

siriusxm's People

Contributors

andrew0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

siriusxm's Issues

Able to play the stream, but the channel list request is returning partial information

Thanks for the new edition of sxm.py Got that running this afternoon.

The server is working, but when I request the channel listing I get partial information. Here is the example:

python sxm.py -u [USERNAME] -p [PASSWORD] -l
ID | Num | Name
9188 | ? |
rawdog | ? |
9189 | ? |
undergroundgarage | ? |
9181 | ? |
9186 | ? |
9187 | ? |
9185 | ? |
radioclassics | ? |
0000 | ? |
9191 | ? |
thebeat | ? |
9190 | ? |
thebridge | ? |
doctorradio | ? |
espnradio | ? |
...

Thanks again for your hard work on this.

Doesn't work since yesterday

Since yesterday I only get an exception when I tried to stream a channel.

28.Nov 2018 13:13:57 : Received error 100 Successful

Traceback (most recent call last):
File "/usr/lib/python3.5/socketserver.py", line 313, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.5/socketserver.py", line 341, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.5/socketserver.py", line 354, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.5/socketserver.py", line 681, in init
self.handle()
File "/usr/lib/python3.5/http/server.py", line 422, in handle
self.handle_one_request()
File "/usr/lib/python3.5/http/server.py", line 410, in handle_one_request
method()
File "sxm.py", line 318, in do_GET
data = self.sxm.get_playlist(self.path.rsplit('/', 1)[1][:-5])
File "sxm.py", line 233, in get_playlist
res = self.session.get(url, params=params)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 492, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 466, in request
prep = self.prepare_request(req)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 400, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/usr/lib/python3/dist-packages/requests/models.py", line 293, in prepare
self.prepare_url(url, params)
File "/usr/lib/python3/dist-packages/requests/models.py", line 353, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant http://None?

Playlist is made, but the .aac files in it don't play

When I run http://127.0.0.1:9001:34 (as per example) in a media player or browser, the playlist is created, but the .aac files don't actually play. The app(s) I try just iterate through all of the files in the playlist as quick as it can, as if they are not actually good?

EDIT It seems this is not working because of SXM removing legacy player support.

it looks like this (with many more .aac entries):

EXTM3U

EXT-X-VERSION:1

EXT-X-TARGETDURATION:10

EXT-X-MEDIA-SEQUENCE:670507

EXT-X-ALLOW-CACHE:NO

EXT-X-KEY:METHOD=AES-128,URI="key/1"

EXT-X-PROGRAM-DATE-TIME:2016-06-09T09:05:40.944+00:00

EXTINF:10,

90salternative_256k_1_060932740944_00670507_v3.aac

EXT-X-PROGRAM-DATE-TIME:2016-06-09T09:05:50.697+00:00

EXTINF:10,

90salternative_256k_1_060932750697_00670508_v3.aac

EXT-X-PROGRAM-DATE-TIME:2016-06-09T09:06:00.450+00:00

Unable to authenticate, unable to get channel list

Did this stop working for anyone else recently? I now get this error. I have already updated SXMAUTH to SXMAUTHNEW and its been working for me for months.

13.Jun 2021 19:41:08 : Unable to authenticate
13.Jun 2021 19:41:08 : Unable to get channel list

Exception happened during processing of request from ('192.168.0.120', 59983)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "sxm.py", line 323, in do_GET
data = sxm.get_playlist(self.path.rsplit('/', 1)[1][:-5])
File "sxm.py", line 227, in get_playlist
guid, channel_id = self.get_channel(name)
File "sxm.py", line 313, in get_channel
if x.get('name', '').lower() == name or x.get('channelId', '').lower() == name or x.get('siriusChannelNumber') == name:
AttributeError: 'NoneType' object has no attribute 'get'

13.Jun 2021 19:41:08 : Unable to authenticate
13.Jun 2021 19:41:08 : Unable to get channel list

Exception happened during processing of request from ('192.168.0.120', 59984)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 720, in init
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "sxm.py", line 323, in do_GET
data = sxm.get_playlist(self.path.rsplit('/', 1)[1][:-5])
File "sxm.py", line 227, in get_playlist
guid, channel_id = self.get_channel(name)
File "sxm.py", line 313, in get_channel
if x.get('name', '').lower() == name or x.get('channelId', '').lower() == name or x.get('siriusChannelNumber') == name:
AttributeError: 'NoneType' object has no attribute 'get'

Authentication Failure Suddenly

First of all, thanks for such a great project. It worked great for me for months, but just today (9/18/19), I was no longer able to stream due to an authentication failure:

WARNING:/usr/local/lib/python3.7/dist-packages/sxm/client.py:Received status code 403 for path 'modify/authentication'
ERROR:/usr/local/lib/python3.7/dist-packages/sxm/client.py:Unable to authenticate because login failed
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/tenacity/init.py", line 361, in call
result = fn(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/sxm/client.py", line 233, in authenticate
raise AuthenticationError("Reset session")
sxm.client.AuthenticationError: Reset session

I found that by changing the FakeUserAgent signature from "chrome" to "firefox" in client.py, I was able to get it going again. I don't know if they had put a trap in the handling on their end to fix something that was broken in the Chrome browser, or if they are trying to pick off rogue clients by their User-agent signature.

With your knowledge of the handshaking, you may be able to diagnose this more deeply than I am currently able to.

Updated list of Channels

Hello Andrew (or whomever knows)

How would one go about pooling SiriusXM to get an updated channel listing so we can add new channels as they are released?

Broken Pipe message & empty playlist

I have stepped through the code, it seems to be failing around self.wfile.write(res.text)

I can not find any reason for this, as I am not very familiar with python.

Authentication Error "Unable to authenticate because login failed"

ETA: Or, just use kryptek's fork: https://github.com/kryptek/SiriusXM It already has the fix, as well as additional features...

This is the same as Issue #20 which is marked closed (so I didn't find it and had to re-debug and re-create it...). I'm opening a new issue here to hopefully save others the pain... Pull Request 29: #29

Getting "Unable to authenticate because login failed" when trying to connect. Could login successfully using https://player.siriusxm.com so credentials were correct. Examining the cookies within the browser seem to indicate that SXM changed "SXMAUTH" to "SXMAUTHNEW". Updated code and was able to list/play channels.

Hopefully the code can get pulled in when this issue is closed this time... :) Until then, find the following:

    return 'SXMAUTH' in self.session.cookies

and change it to SXMAUTHNEW and you'll be all set!

Authenication error

Been using this since Oct 2019 and love it. Enables me to time shift record content from SiriusXM.

Everything worked fine on Tuesday 4/28/2020. When I tried to get the updated channel list on Friday 5/1, I get an authentication error. I have tried a few more times and still get the error.

Have no idea on what has changed, but the python code no longer goes further.

Hoping this is easy to fix. Will miss my regular program recording.

What Version of Python

What version of Python should I be running for this to run correctly? I've tried 2.7 and 3.4

Session Timeout

Everything seems to be working great on my new setup, but running into a some sort of timeout on the streams. All streams seem to stop after a few hours. When I check back on the script I see a message about 'session expired'. Re-running the script connects it once again.

Is the a way to keep the steam running continuously? Am I missing something?

JSONDecodeError: Expecting ',' delimiter

EDIT: Finally understood that it was a missing "," not in the sxm.py, but in my config.json – I fixed that, and now the recording script seems to work!! Just started it, but hopefully I managed to get it working now. If yes, I'll close this issue as soon as I found out.

EDIT 2: I've figured everything out now – it works! Thanks so much for this fantastic script and the work which went into it, highly appreciated! Closing this issue now. (Feel free to delete the whole thing, if you wish – I can't do this as the poster, if I see it correctly.)


I'm unfortunately not very familiar with coding and Python, but I am trying my best to get the SiriusXM script for the ripping server running to record my favourite Underground Garage shows. I managed to set up the simple streaming server for playing the channel in VLC/Quicktime – however, starting the server in ripping mode gives me headaches. At the moment, I get this message when trying to start it:

Traceback (most recent call last):
File "/Users/lars/SiriusXM-master/sxm.py", line 868, in
main()
File "/Users/lars/SiriusXM-master/sxm.py", line 841, in main
ripper = SiriusXMRipper(sirius_handler, args)
File "/Users/lars/SiriusXM-master/sxm.py", line 552, in init
self.config = json.load(open("/Users/lars/SiriusXM-master/config.json", "r"))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/init.py", line 293, in load
return loads(fp.read(),
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 19 column 2 (char 570)

Could the problem be that the config.json isn't found? I put the file in the same folder as the sxm.py, but it wasn't found ("[Errno 2] No such file or directory: 'config.json") – so I added the correct full path to the config.json into the script at the three lines where it is directly consulted. Does the JSONDecodeError tell me that the file still isn't found? And do the lines above that tell me that I also still have other problems running the script?

Sorry for the confusion, but I'm totally lost with this – I would be so grateful if anybody could help me out what to exactly change in the script. This is how I saved it at the moment:

https://www.dropbox.com/s/mqx339wjcsfl0hf/sxm.py?dl=0

Thanks so much in advance!!! (and sorry for bad technical English – no native speaker ...)

Convert to a Proper Python Package

First off, awesome job on this. This repo is going my life like 100 times easier!

Would you be interested in actually converting this into a installable package and possibly even uploading it to PyPi?

If so I can make a pull request/work with you to get it all put together. My plan was actually to build a Discord bot that could play SiriusXM so being able to pip install sxm and importing the SiriusXM class would be a huge help so I do not have to reference the Github repo directly.

Bad request

Worked fine yesterday, but now get

127.0.0.1 - - [22/Aug/2020 15:34:26] code 400, message Bad request version ('Zß²\x17b)\x81?tl\x95|\x00\x00,\x00ÿÀ,À+À$À#À')
Zß²b)�?tl�|,ÿÀ,À+À$À#À" 400 -:34:26] "¤ _A�R�Ä>Î|UH+��yÂ�#

Using the kryptek branch.

Edit: Happens sporadically. Unknown cause.

Error when trying to stream on Onkyo receiver

The Onkyo TX-NR709 has a favorite option they can custom stream links added to. I put the link http://192.168.1.200:8888/9486.m3u8 that works using VLC in the Onkyo and it generates the error information below. I don't have details on what the Onkyo supports but it will play acc streams. This is one that works http://wfuv-onair.streamguys.org:80/onair-aacplus. I realize sxm.py is different than the wfuv one and it may not be possible. Any thoughts or suggestions?

Onkyo:
Connection Error.
The server connection could not be established or was terminated early. Please try again later.

sxm.py:
Exception happened during processing of request from ('192.168.1.50', 47958)
Traceback (most recent call last):
File "/usr/lib/python3.6/socketserver.py", line 317, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.6/socketserver.py", line 348, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.6/socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.6/socketserver.py", line 721, in init
self.handle()
File "/usr/lib/python3.6/http/server.py", line 418, in handle
self.handle_one_request()
File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
method()
File "./sxm.py", line 324, in do_GET
self.wfile.write(bytes(data, 'utf-8'))
File "/usr/lib/python3.6/socketserver.py", line 800, in write
self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe

Another is this still working ?

Stumbled across this and it looks like it might solve my squeezebox issue. I know nothing about python, which will probably become obvious in the next few sentences...

I've created a windows vm and install python for windows 3.7.0 and the python launcher.

Running the command mentioned in the readme with like this:
python sxm.py '[email protected]' 'Mypassword' 8888 resulted in a

ModuleNotFoundError: No module named 'requests'

so I found what I think is the requests module here: https://github.com/requests/requests

and cloned that next to the script itself.

now when I run it I get:

Traceback (most recent call last):
  File "sxm.py", line 352, in <module>
    httpd = HTTPServer(('', int(sys.argv[3])), make_sirius_handler(sys.argv[1],
sys.argv[2]))
  File "sxm.py", line 312, in make_sirius_handler
    class SiriusHandler(BaseHTTPRequestHandler):
  File "sxm.py", line 314, in SiriusHandler
    sxm = SiriusXM(username, password)
  File "sxm.py", line 15, in __init__
    self.session = requests.Session()
AttributeError: module 'requests' has no attribute 'Session'

What am I doin wrong?

Empty .m3u8

Hi, i don't get the proper stream playlist,
am i doing something wrong ?

HLS_AES_KEY question

Can you explain how you were able to get the HLS stream key? I've tried doing some research on how to recover the key from HLS streams but haven't had much luck.

Systemd unit files

If anyone cares, I created a generic systemd unit file on my fork: https://github.com/fts-tmassey/SiriusXM

If someone chooses to use my updated script, there's also an override file you can look at that shows how I use environment variables to safely store my credentials yet still start the script automatically.

A big thank you to andrew0 for his script: it's awesome for me to now have SXM in every room of my house!

Can't Authenticate

I am trying to use this script, but it always says that it is unable to authenticate. I verified that the username (in my case my email address) and my password work correctly if I try to login at https://player.siriusxm.com/login but it doesn't seem to work with this script. Any ideas on what to try? Here's the log when I try to connect via VLC to a channel.

08.May 2020 18:54:13 <SiriusXM>: Unable to authenticate because login failed
08.May 2020 18:54:13 <SiriusXM>: Unable to authenticate
08.May 2020 18:54:13 <SiriusXM>: Unable to get channel list
----------------------------------------
Exception happened during processing of request from ('192.168.0.189', 49565)
Traceback (most recent call last):
  File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/lib/python3.7/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
    method()
  File "sxm.py", line 323, in do_GET
    data = sxm.get_playlist(self.path.rsplit('/', 1)[1][:-5])
  File "sxm.py", line 227, in get_playlist
    guid, channel_id = self.get_channel(name)
  File "sxm.py", line 313, in get_channel
    if x.get('name', '').lower() == name or x.get('channelId', '').lower() == name or x.get('siriusChannelNumber') == name:
AttributeError: 'NoneType' object has no attribute 'get'
----------------------------------------
08.May 2020 18:54:13 <SiriusXM>: Unable to authenticate because login failed
08.May 2020 18:54:13 <SiriusXM>: Unable to authenticate
08.May 2020 18:54:13 <SiriusXM>: Unable to get channel list
----------------------------------------
Exception happened during processing of request from ('192.168.0.189', 49566)
Traceback (most recent call last):
  File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/lib/python3.7/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
    method()
  File "sxm.py", line 323, in do_GET
    data = sxm.get_playlist(self.path.rsplit('/', 1)[1][:-5])
  File "sxm.py", line 227, in get_playlist
    guid, channel_id = self.get_channel(name)
  File "sxm.py", line 313, in get_channel
    if x.get('name', '').lower() == name or x.get('channelId', '').lower() == name or x.get('siriusChannelNumber') == name:
AttributeError: 'NoneType' object has no attribute 'get'```

Error parsing json response for all channels

18.Jul 2020 09:51:28 : Error parsing json response for channels
18.Jul 2020 09:51:28 : No channel for 9402
127.0.0.1 - - [18/Jul/2020 09:51:28] "GET /9402.m3u8 HTTP/1.1" 500 -

I have tried numerous with the same result. Seems to have broken sometime over the last 7 days.

Authentication Failure

Unable to authenticate with script. Receive the following:

<SiriusXM>: Unable to authenticate because login failed <SiriusXM>: Unable to authenticate <SiriusXM>: Unable to get channel list Traceback (most recent call last): raceback (most recent call last): File "sxm.py", line 362, in <module> channels = list(sorted(sxm.get_channels(), key=lambda x: (not x.get('isFavorite', False), int(x.get('siriusChannelNumber', 9999))))) File "sxm.py", line 362, in <lambda> channels = list(sorted(sxm.get_channels(), key=lambda x: (not x.get('isFavorite', False), int(x.get('siriusChannelNumber', 9999))))) AttributeError: 'NoneType' object has no attribute 'get'

I am using trying to run the scrip via sudo python3 sxm.py username password -p 8888

What am I missing? is this script still working ?

Using script in Logitech Media Server

I started using this script in LMS to replace the no longer supported Official SiriusXM stream. It works well until I change stations. The new station plays for a while then stops. The python terminal output shows a lot of 403 Forbidden errors when I select a different station and appears to be attempting to stream both the old and new selection. I'm not very familiar with python but shouldn't the previous stream be terminated in favor of the new one?

Pass credentials in environment variables

Hello!

Passing credentials (username and password) on the command line is no bueno: it's trivial to see the command line of a task running on a system! Plus, if you start your task with e.g. systemd, you will need to hard-code your password into your unit files. Not for me.

So, I modified the code to add an -e (--env) parameter. That allows the SXM_USER and SXM_PASS variables to override the username and password passed on the command line. Combined with the EnvironmentFile parameter of a systemd unit file, this will allow you to store your credentials to be stored in a file (owned by, say, root with 400 ownership).

I wanted to change the underlying code as little as possible, so the username and password parameters are still required: I just use "user" and "pass". With the -e parameter, they will get overwritten by the environment variables (if the variables exist). If the author wanted to clean this up further (like not using the parameter in the first place and simply defining that the environment variables work all the time, and possibly allowing the username and password parameters to be optional if the environment variables exist), that would be trivial. In fact, I volunteer to do that if andrew0 wants me to (and will check in the results!!!). Otherwise, my changes are as minimal as possible and meet my needs. Hopefully they might meet yours, too.

A shout out to kryptek and his fork here: https://github.com/kryptek/SiriusXM He has a more comprehensive way of doing this with configuration files, plus more features. However, his script requires more modules, etc. and I don't personally need those features (mostly recording SXM streams) so I'm sticking with the basic script with my couple of patches.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.