Skip to content

Exception when setting streamurl #6

Description

@dazza5000

Getting the following exception:

daz@iloveyou:~/metadata$ python metadata.py
Traceback (most recent call last):
File "metadata.py", line 1, in
from streamscrobbler import streamscrobbler
File "/home/daz/metadata/streamscrobbler.py", line 5

^

Here is my code:

from streamscrobbler import streamscrobbler
streamscrobbler = streamscrobbler()

##streamurl can be a url directly to the stream or to a pls file. Support for m3u is coming soon.
streamurl = "http://pubint.ic.llnwd.net/stream/pubint_kut"
stationinfo = streamscrobbler.getServerInfo(streamurl)
##metadata is the bitrate and current song
metadata = stationinfo.get("metadata")
## status is the integer to tell if the server is up or down, 0 means down, 1 up, 2 means up but also got metadata.
status = stationinfo.get("status")

Activity

  1. GijsTimmers commented on Jul 27, 2016

    @GijsTimmers
    Contributor

    That url you posted does not look like a streaming url, and furthermore doesn't lead anywhere.

  2. confact commented on Aug 30, 2016

    @confact
    Contributor

    Seems to be a problem with the headers or something. because it works when copy and paste in chrome.

    I am open with a pull request to fix this if you want @dazza5000

  3. unknownpedestrian commented on Jul 3, 2025

    @unknownpedestrian

    not sure if this is helpful all these years later, but we've been using this lib for a while and have come up with a few fixes here:
    https://github.com/CGillen/streamscrobbler-python
    this uses mostly code from #9

    but includes a fix for the headers and also has a fix for the way the metadata is parsed, what we found is that the end of the metadata buffer was getting prematurely removed, there's more information in the fork @confact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions