Python Shoutcast Client

This forum is about all development around libVLC.
jerresnow
New Cone
New Cone
Posts: 3
Joined: 10 Feb 2023 10:52

Python Shoutcast Client

Postby jerresnow » 10 Feb 2023 19:18

I hope this is an easy one. I need to connect to a Shoutcast stream that may or may not be live, but will be live soon. I am using Python with Python-VLC.
If I connect to a live stream, it plays fine with this error

[00000160436e5360] prefetch stream error: unimplemented query (264) in control

I'm not concerned about that as it plays fine. The dead stream responds with this

[000002847da34e10] access stream error: HTTP 401 error
[000002847da2bce0] main input error: Your input can't be opened
[000002847da2bce0] main input error: VLC is unable to open the MRL 'https://sh.fl-us.audio-stream.com/#####/#####'. Check the log for details.

There is no need for authorization, which most of the docs refer to about the HTTP 401 error. I have tried more than a dozen VLC set/get/audio functions to test for a working stream. All my attempts return identical results for the live and the dead stream. What test should I be doing to recognize the lack of audio and retry in 30 seconds for a new attempt?

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Python Shoutcast Client

Postby Rémi Denis-Courmont » 10 Feb 2023 20:26

HTTP 401 can mean only one thing and that's the server asking for authentication. In other words, it is either a server problem, or an incorrect URL.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

jerresnow
New Cone
New Cone
Posts: 3
Joined: 10 Feb 2023 10:52

Re: Python Shoutcast Client

Postby jerresnow » 10 Feb 2023 21:12

It isn't an incorrect URL. Once the feed becomes live, the code works.

jerresnow
New Cone
New Cone
Posts: 3
Joined: 10 Feb 2023 10:52

Re: Python Shoutcast Client

Postby jerresnow » 15 Feb 2023 04:19

Work around: FWIW, I solved this with curl. This script needed to run on Windows, so I didn't try curl till late in the process. Curl gave different responses to the two conditions, live/dead stream. While searching for curl for windows. I was pleasantly surprised to find that curl has been included in Windows for a number of years. Who knew. Anyway, subprocess to get curl's response, and I'm OK.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests