AngellusMortis / sxm-client

Python library designed to help write applications for the popular XM Radio service.
MIT License
25 stars 8 forks source link

Session can't updated when stream started #8

Open dromicron opened 7 months ago

dromicron commented 7 months ago

Description

I can launch the script, Authentication are done and stream start but after short delay the session expire and script fail to update it

INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:11:12 +0000] "GET /AAC_Data/8206/HLS_8206_256k_v3/8206_256k_1_012272641075_00372573_v3.aac HTTP/1.1" 200 315251 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:11:22 +0000] "GET /8206.m3u8 HTTP/1.1" 200 256751 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:11:22 +0000] "GET /AAC_Data/8206/HLS_8206_256k_v3/8206_256k_1_012272650826_00372574_v3.aac HTTP/1.1" 200 315251 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:11:31 +0000] "GET /AAC_Data/8206/HLS_8206_256k_v3/8206_256k_1_012272660578_00372575_v3.aac HTTP/1.1" 200 315235 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:11:41 +0000] "GET /8206.m3u8 HTTP/1.1" 200 256751 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:11:42 +0000] "GET /AAC_Data/8206/HLS_8206_256k_v3/8206_256k_1_012272670329_00372576_v3.aac HTTP/1.1" 200 315251 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:11:51 +0000] "GET /AAC_Data/8206/HLS_8206_256k_v3/8206_256k_1_012272680081_00372577_v3.aac HTTP/1.1" 200 315251 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:01 +0000] "GET /8206.m3u8 HTTP/1.1" 200 256751 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:01 +0000] "GET /AAC_Data/8206/HLS_8206_256k_v3/8206_256k_1_012272689848_00372578_v3.aac HTTP/1.1" 200 315251 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:10 +0000] "GET /AAC_Data/8206/HLS_8206_256k_v3/8206_256k_1_012272699599_00372579_v3.aac HTTP/1.1" 200 315251 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:20 +0000] "GET /8206.m3u8 HTTP/1.1" 200 256751 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:20 +0000] "GET /AAC_Data/8206/HLS_8206_256k_v3/8206_256k_1_012272709350_00372580_v3.aac HTTP/1.1" 200 315251 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:30 +0000] "GET /AAC_Data/8206/HLS_8206_256k_v3/8206_256k_1_012272719102_00372581_v3.aac HTTP/1.1" 200 315251 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/client.py:Session expired, logging in and authenticating ERROR:/root/siriusxm/sxm-client/sxm/client.py:Failed to authenticate INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:40 +0000] "GET /8206.m3u8 HTTP/1.1" 503 172 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/client.py:Session expired, logging in and authenticating ERROR:/root/siriusxm/sxm-client/sxm/client.py:Failed to authenticate INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:41 +0000] "GET /8206.m3u8 HTTP/1.1" 503 172 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/client.py:Session expired, logging in and authenticating ERROR:/root/siriusxm/sxm-client/sxm/client.py:Failed to authenticate INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:41 +0000] "GET /8206.m3u8 HTTP/1.1" 503 172 "-" "(Windows NT 10.0; Win64; x64) PotPlayer/22.4.20" INFO:/root/siriusxm/sxm-client/sxm/client.py:Session expired, logging in and authenticating ERROR:/root/siriusxm/sxm-client/sxm/client.py:Failed to authenticate INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:12:42 +0000] "GET /8206.m3u8 HTTP/1.0" 503 172 "-" "" INFO:/root/siriusxm/sxm-client/sxm/client.py:Session expired, logging in and authenticating ERROR:/root/siriusxm/sxm-client/sxm/client.py:Failed to authenticate INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:13:05 +0000] "GET /8206.m3u8 HTTP/1.0" 503 172 "-" "" INFO:/root/siriusxm/sxm-client/sxm/client.py:Session expired, logging in and authenticating ERROR:/root/siriusxm/sxm-client/sxm/client.py:Failed to authenticate INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:13:28 +0000] "GET /8206.m3u8 HTTP/1.0" 503 172 "-" "" INFO:/root/siriusxm/sxm-client/sxm/client.py:Session expired, logging in and authenticating ERROR:/root/siriusxm/sxm-client/sxm/client.py:Failed to authenticate INFO:/root/siriusxm/sxm-client/sxm/http.py: [22/Jan/2024:20:13:51 +0000] "GET /8206.m3u8 HTTP/1.0" 503 172 "-" "" INFO:/root/siriusxm/sxm-client/sxm/client.py:Session expired, logging in and authenticating ERROR:/root/siriusxm/sxm-client/sxm/client.py:Failed to authenticate

A Possible fix can be applied?
The problem started a few days ago, and it had always worked fine before.
phofferkamp commented 7 months ago

Experiencing the same

cannondale99 commented 7 months ago

Similar error being received: INFO:httpx:HTTP Request: POST https://player.siriusxm.com/rest/v2/experience/modules/modify/authentication "HTTP/1.1 200 OK" ERROR:/home/siriusxm/sxm-client/sxm/client.py:Unable to authenticate because login failed

cannondale99 commented 7 months ago

This resolved my problem.

Just read the Pull Request posted by phracker and changing line 162 in client.py solved my problem. Change line 162 from "SXMAUTHNEW" to "SXMDATA" as shown here - https://github.com/AngellusMortis/sxm-client/pull/6/files

MiM-TMassey commented 7 months ago

Thank you @cannondale99 for saving me some time digging into this. I have updated my fork to include this: https://github.com/MiM-TMassey/SiriusXM . It also includes a couple of other enhancements.