Git Product home page Git Product logo

mopidy-soundcloud's Introduction

Mopidy-SoundCloud

Latest PyPI version CI build status Test coverage

Mopidy extension for playing music from SoundCloud.

Maintainer wanted

Mopidy-SoundCloud is currently kept on life support by the Mopidy core developers. It is in need of a more dedicated maintainer.

If you want to be the maintainer of Mopidy-SoundCloud, please:

  1. Make 2-3 good pull requests improving any part of the project.
  2. Read and get familiar with all of the project's open issues.
  3. Send a pull request removing this section and adding yourself as the "Current maintainer" in the "Credits" section below. In the pull request description, please refer to the previous pull requests and state that you've familiarized yourself with the open issues.

As a maintainer, you'll be given push access to the repo and the authority to make releases to PyPI when you see fit.

Installation

Install by running:

sudo python3 -m pip install Mopidy-SoundCloud

See https://mopidy.com/ext/soundcloud/ for alternative installation methods.

Configuration

  1. You must register for a user account at https://soundcloud.com/

  2. You need a SoundCloud authentication token for Mopidy from https://mopidy.com/authenticate

  3. Add the authentication token to the mopidy.conf config file:

    [soundcloud]
    auth_token = 1-1111-1111111
    explore_songs = 25
    
  4. Use explore_songs to restrict the number of items returned.

Troubleshooting

If you're having trouble with audio playback from SoundCloud, make sure you have the "ugly" plugin set from GStreamer installed for MP3 support. The package is typically named gstreamer1.0-plugins-ugly or similar, depending on OS and distribution. The package isn't a strict requirement for Mopidy's core, so you may be missing it.

Project resources

Credits

mopidy-soundcloud's People

Contributors

blueyed avatar davidcrawford avatar dreamlayers avatar janil avatar jarpy avatar jc3 avatar jodal avatar joshka avatar kingosticks avatar nama avatar prayerslayer avatar rawdlite avatar ticosax avatar tim-smart avatar trygveaa avatar xim 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mopidy-soundcloud's Issues

Rompr support

I don't see the new 1.2.0 vfs folders in Rompr mpd client but I can search (and find) Soundcloud streams.

Crash when SoundCloud returns 404 on track lookup

When SoundCloud returns 404 on a track lookup, it seems like the SoundCloud backend returns a None track, which makes the MPD frontend crash.

DEBUG    2013-10-08 09:04:00,661 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: lsinfo "/"
DEBUG    2013-10-08 09:04:00,661 [7194:MpdSession-6] mopidy.frontends.mpd
  Response to [::ffff:127.0.0.1]:33668: 
    playlist: jodal's liked on SoundCloud
    Last-Modified: 2013-10-08T07:04:00Z
    playlist: jodal's stream on SoundCloud
    Last-Modified: 2013-10-08T07:04:00Z
    playlist: Explore Easy Listening on SoundCloud
    Last-Modified: 2013-10-08T07:04:00Z
    playlist: Explore Indie on SoundCloud
    Last-Modified: 2013-10-08T07:04:00Z
    playlist: Explore Ambient on SoundCloud
    Last-Modified: 2013-10-08T07:04:00Z
    OK
DEBUG    2013-10-08 09:04:00,662 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: idle
DEBUG    2013-10-08 09:04:02,200 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: noidle
DEBUG    2013-10-08 09:04:02,202 [7194:MpdSession-6] mopidy.frontends.mpd
  Response to [::ffff:127.0.0.1]:33668: OK
DEBUG    2013-10-08 09:04:02,203 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: listplaylistinfo "jodal's liked on SoundCloud"
DEBUG    2013-10-08 09:04:02,204 [7194:SoundCloudBackend-3] mopidy.backends.soundcloud.playlists
  Resolving with jodal's liked on SoundCloud
DEBUG    2013-10-08 09:04:02,205 [7194:SoundCloudBackend-3] mopidy.backends.soundcloud.client
  Requesting https://api.soundcloud.com/me.json?client_id=93e33e327fd8a9b77becd179652272e2
DEBUG    2013-10-08 09:04:02,355 [7194:SoundCloudBackend-3] urllib3.connectionpool
  "GET /me.json?client_id=93e33e327fd8a9b77becd179652272e2 HTTP/1.1" 200 736
DEBUG    2013-10-08 09:04:02,357 [7194:SoundCloudBackend-3] mopidy.backends.soundcloud.playlists
  Fetching Liked playlist for jodal
DEBUG    2013-10-08 09:04:02,357 [7194:SoundCloudBackend-3] mopidy.backends.soundcloud.client
  Requesting https://api.soundcloud.com/users/39107921/favorites.json?client_id=93e33e327fd8a9b77becd179652272e2
DEBUG    2013-10-08 09:04:02,412 [7194:SoundCloudBackend-3] urllib3.connectionpool
  "GET /users/39107921/favorites.json?client_id=93e33e327fd8a9b77becd179652272e2 HTTP/1.1" 200 656
DEBUG    2013-10-08 09:04:02,696 [7194:SoundCloudBackend-3] urllib3.connectionpool
  "HEAD /tracks/38720262/stream?client_id=93e33e327fd8a9b77becd179652272e2 HTTP/1.1" 302 0
DEBUG    2013-10-08 09:04:02,697 [7194:MpdSession-6] mopidy.frontends.mpd
  Response to [::ffff:127.0.0.1]:33668: 
    file: soundcloud:song;38720262
    Time: 354
    Artist: Burial + Four Tet
    Title: Nova
    Album: SoundCloud
    Date: 
    Track: 0
    OK
DEBUG    2013-10-08 09:04:02,698 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: idle
DEBUG    2013-10-08 09:04:02,700 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: noidle
DEBUG    2013-10-08 09:04:02,701 [7194:MpdSession-6] mopidy.frontends.mpd
  Response to [::ffff:127.0.0.1]:33668: OK
DEBUG    2013-10-08 09:04:02,701 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: command_list_ok_begin
DEBUG    2013-10-08 09:04:02,703 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: addid "soundcloud:song;38720262"
DEBUG    2013-10-08 09:04:02,703 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: command_list_end
INFO     2013-10-08 09:04:02,705 [7194:SoundCloudBackend-3] mopidy.backends.soundcloud
  SoundCloud track id for soundcloud:song;38720262: song;38720262
DEBUG    2013-10-08 09:04:02,705 [7194:SoundCloudBackend-3] mopidy.backends.soundcloud.client
  Requesting https://api.soundcloud.com/tracks/song;38720262.json?client_id=93e33e327fd8a9b77becd179652272e2
DEBUG    2013-10-08 09:04:02,762 [7194:SoundCloudBackend-3] urllib3.connectionpool
  "GET /tracks/song;38720262.json?client_id=93e33e327fd8a9b77becd179652272e2 HTTP/1.1" 404 48
ERROR    2013-10-08 09:04:02,764 [7194:SoundCloudBackend-3] mopidy.backends.soundcloud.client
  Request https://api.soundcloud.com/tracks/song;38720262.json?client_id=93e33e327fd8a9b77becd179652272e2, failed with status code 404
DEBUG    2013-10-08 09:04:02,765 [7194:Core-4] mopidy.core
  Triggering event: tracklist_changed()
DEBUG    2013-10-08 09:04:02,767 [7194:MpdSession-6] mopidy.frontends.mpd
  Response to [::ffff:127.0.0.1]:33668: 
    Id: 0
    list_OK
    OK
DEBUG    2013-10-08 09:04:02,768 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: status
DEBUG    2013-10-08 09:04:02,772 [7194:MpdSession-6] mopidy.frontends.mpd
  Response to [::ffff:127.0.0.1]:33668: 
    volume: 28
    repeat: 0
    random: 0
    single: 0
    consume: 0
    playlist: 1
    playlistlength: 1
    xfade: 0
    state: stop
    OK
DEBUG    2013-10-08 09:04:02,773 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: idle
DEBUG    2013-10-08 09:04:02,774 [7194:MpdSession-6] mopidy.frontends.mpd
  Response to [::ffff:127.0.0.1]:33668: 
    changed: playlist
    OK
DEBUG    2013-10-08 09:04:02,774 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: noidle
DEBUG    2013-10-08 09:04:02,812 [7194:MpdSession-6] mopidy.frontends.mpd
  Request from [::ffff:127.0.0.1]:33668: plchanges "0"
ERROR    2013-10-08 09:04:02,815 [7194:MpdSession-6] pykka
  Unhandled exception in MpdSession (urn:uuid:8f8bf31c-3087-4582-91c7-79804ddeea03):
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/home/sjodal/dev/mopidy/mopidy/utils/network.py", line 354, in on_receive
    self.on_line_received(line)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/session.py", line 33, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 46, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 75, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 85, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 106, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 135, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 148, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 160, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/dispatcher.py", line 168, in _call_handler
    return handler(self.context, **kwargs)
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/protocol/current_playlist.py", line 305, in plchanges
    context.core.tracklist.tl_tracks.get())
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/translator.py", line 127, in tracks_to_mpd_format
    result.append(track_to_mpd_format(track, position))
  File "/home/sjodal/dev/mopidy/mopidy/frontends/mpd/translator.py", line 35, in track_to_mpd_format
    ('file', track.uri or ''),
AttributeError: 'NoneType' object has no attribute 'uri'

Bug in Search

I believe there is an issue with search. Once the search query comes it it goes through a join like so

' '.join(query.values()[0])

Unfortunately lets say we want to search for Diplo. Instead of building a query string like so:
tracks.json?q=diplo" we get tracks.json?q=d+i+p+l+o, which give quite different results. The former yields the same search results as the actual soundcloud search.

Streams should play forever if necessary

(I will just leave this here, because I’d really like to have it. But no idea how this feature request relates to Mopidy's architecture, ie how much it relies on the concept of a directory/tracklist containing a finite number of files/tracks.)

Currently when I access SC streams via this extension I get either 10 (Stream) or 25 (Explore) tracks. These are played and that’s it. Party’s over. Can we somehow preload the next n tracks and append them to the tracklist?

I suppose we can't do it here as it’s only an interface to get tracks from SC without a notion of a currently playing track and so forth, but would it maybe somehow fit in a separate (frontend) extension? How would we know which stream to fetch from? Can we get it via the directory URI of a track in the tracklist?

Please advise 😃

Fetching likes list from soundcloud crashes ncmpcpp

This sound more like ncmpcpp issue really, but can't quite believe it.
Fetcing likes list causes ncmpcpp to crash with the following message in console, leaving terminal instance unusable:

ncmpcpp: src/send.c:61: send_check: Assertion 'connection != ((void *)0)' failed.
Connected to localhost!                                                          Aborted

mopidy log looks okay to me. It appears to be successful fetching the tracks. Could it be related to fact the likes list is somewhat largeish, totaling ~370 items? Playing small sets has no issues whatsoever.

#   Mopidy 0.19.5
#   Mopidy-HTTP 0.19.5
#   Mopidy-Local 0.19.5
#   Mopidy-MPD 0.19.5
#   Mopidy-SoftwareMixer 0.19.5
#   Mopidy-SoundCloud 1.2.5
#   Mopidy-Spotify 1.2.0
#   Mopidy-Stream 0.19.5

Note: hand-patched the changes introduced by 461ef6c and ac137b2

full log @ http://pastebin.com/Sicnuw45

On an unrelated note, is it normal that mopidy is detecting connections all over the 48XXX port range?
After launching mopidy. it prints information about new mpd connections every second:

[..]
INFO     New MPD connection from [::ffff:127.0.0.1]:48838
INFO     New MPD connection from [::ffff:127.0.0.1]:48840
INFO     New MPD connection from [::ffff:127.0.0.1]:48842
INFO     New MPD connection from [::ffff:127.0.0.1]:48844
INFO     New MPD connection from [::ffff:127.0.0.1]:48846
INFO     New MPD connection from [::ffff:127.0.0.1]:48848
INFO     New MPD connection from [::ffff:127.0.0.1]:48850
INFO     New MPD connection from [::ffff:127.0.0.1]:48852
INFO     New MPD connection from [::ffff:127.0.0.1]:48854
[..]

Authentication Token

When using the mopidy site I am unable to get an authentication token and am given the error 'Error: 401 - Unauthorized'

Can't get Soundcloud connection at the moment (status code 401)

It seems Soundcloud returns a 401 on authentication request but the code isn't prepared to handle the answer (attribute response is missing). I'm quite sure the auth_token I use is correct.

ERROR    Got un-handled exception from SoundCloudBackend
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 239, in _actor_error_handling
    yield
  File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 380, in start_backends
    config=config, audio=audio).proxy()
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 94, in start
    obj = cls(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/actor.py", line 21, in __init__
    self.remote = SoundCloudClient(config['soundcloud'])
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/soundcloud.py", line 80, in __init__
    if err.response is not None and err.response.status_code == 401:
AttributeError: 'ConnectionError' object has no attribute 'response'

Problem upon startup

Hi,

i am having difficulties to enable the soundcloud extension for my mopidy instance. Authentication does no seem to work (retrieved json using curl, seems to be valid).

But the startup fails here:

INFO 2013-11-19 22:45:45,317 [10402:MainThread] mopidy.utils.log
Starting Mopidy 0.16.1
DEBUG 2013-11-19 22:45:45,320 [10402:MainThread] mopidy.ext
Loading entry point: soundcloud = mopidy_soundcloud:SoundCloudExtension
DEBUG 2013-11-19 22:45:45,322 [10402:MainThread] mopidy.ext
Loaded extension: Mopidy-SoundCloud 1.0.16
DEBUG 2013-11-19 22:45:45,322 [10402:MainThread] mopidy.ext
Loading entry point: http = mopidy.frontends.http:Extension [http]
DEBUG 2013-11-19 22:45:45,324 [10402:MainThread] mopidy.ext
Loaded extension: Mopidy-HTTP 0.16.1
DEBUG 2013-11-19 22:45:45,324 [10402:MainThread] mopidy.ext
Loading entry point: mpd = mopidy.frontends.mpd:Extension
DEBUG 2013-11-19 22:45:45,325 [10402:MainThread] mopidy.ext
Loaded extension: Mopidy-MPD 0.16.1
DEBUG 2013-11-19 22:45:45,326 [10402:MainThread] mopidy.ext
Loading entry point: local = mopidy.backends.local:Extension
DEBUG 2013-11-19 22:45:45,327 [10402:MainThread] mopidy.ext
Loaded extension: Mopidy-Local 0.16.1
DEBUG 2013-11-19 22:45:45,327 [10402:MainThread] mopidy.ext
Loading entry point: stream = mopidy.backends.stream:Extension
DEBUG 2013-11-19 22:45:45,328 [10402:MainThread] mopidy.ext
Loaded extension: Mopidy-Stream 0.16.1
DEBUG 2013-11-19 22:45:45,341 [10402:MainThread] root
Discovered extensions: soundcloud, http, mpd, local, stream
DEBUG 2013-11-19 22:45:45,343 [10402:MainThread] mopidy.config.keyring
Fetching from keyring failed: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
INFO 2013-11-19 22:45:45,344 [10402:MainThread] mopidy.config
Loading config from: builtin defaults, /home/frederik/.config/mopidy/mopidy.conf, command line options
DEBUG 2013-11-19 22:45:45,354 [10402:MainThread] mopidy.ext
Validating extension: soundcloud
DEBUG 2013-11-19 22:45:45,432 [10402:MainThread] mopidy.ext
Validating extension: http
INFO 2013-11-19 22:45:45,448 [10402:MainThread] mopidy.ext
Disabled extension http: Dependency ws4py>=0.2.3 not found
DEBUG 2013-11-19 22:45:45,449 [10402:MainThread] mopidy.ext
Validating extension: mpd
DEBUG 2013-11-19 22:45:45,449 [10402:MainThread] mopidy.ext
Validating extension: local
DEBUG 2013-11-19 22:45:45,450 [10402:MainThread] mopidy.ext
Validating extension: stream
INFO 2013-11-19 22:45:45,451 [10402:MainThread] root
Enabled extensions: mpd, local, stream, soundcloud
INFO 2013-11-19 22:45:45,451 [10402:MainThread] root
Disabled extensions: http
DEBUG 2013-11-19 22:45:45,452 [10402:MainThread] mopidy.ext
Registering GStreamer elements for: soundcloud
DEBUG 2013-11-19 22:45:45,452 [10402:MainThread] mopidy.ext
Registering GStreamer elements for: mpd
DEBUG 2013-11-19 22:45:45,453 [10402:MainThread] mopidy.ext
Registering GStreamer elements for: local
DEBUG 2013-11-19 22:45:45,453 [10402:MainThread] mopidy.ext
Registering GStreamer elements for: stream
INFO 2013-11-19 22:45:45,454 [10402:MainThread] mopidy.main
Starting Mopidy audio
INFO 2013-11-19 22:45:45,479 [10402:Audio-1] mopidy.audio
Audio output set to "autoaudiosink"
INFO 2013-11-19 22:45:45,492 [10402:MainThread] mopidy.main
Starting Mopidy backends: SoundCloudBackend, LocalBackend, StreamBackend
DEBUG 2013-11-19 22:45:45,493 [10402:MainThread] mopidy.backends.soundcloud.client
Requesting https://api.soundcloud.com/me.json?client_id=93e33e327fd8a9b77becd179652272e2
INFO 2013-11-19 22:45:45,511 [10402:MainThread] requests.packages.urllib3.connectionpool
Starting new HTTPS connection (1): api.soundcloud.com
DEBUG 2013-11-19 22:45:45,579 [10402:Audio-1] mopidy.audio.mixers.auto
AutoAudioMixer chose: alsamixerelement1
INFO 2013-11-19 22:45:45,605 [10402:Audio-1] mopidy.audio
Audio mixer set to "alsamixer" using track "Master"
DEBUG 2013-11-19 22:45:45,739 [10402:MainThread] requests.packages.urllib3.connectionpool
"GET /me.json?client_id=93e33e327fd8a9b77becd179652272e2 ('HTTP/1.1',)" 200 740
ERROR 2013-11-19 22:45:45,741 [10402:MainThread] mopidy.backends.soundcloud.client
SoundCloud error: 'dict' object is not callable
ERROR 2013-11-19 22:45:45,742 [10402:MainThread] mopidy.backends.soundcloud.client
Authentication error: 'NoneType' object has no attribute 'get'. Check your auth_token!
DEBUG 2013-11-19 22:45:45,742 [10402:MainThread] mopidy.backends.soundcloud.client
Requesting https://api.soundcloud.com/me.json?client_id=93e33e327fd8a9b77becd179652272e2
DEBUG 2013-11-19 22:45:45,821 [10402:MainThread] requests.packages.urllib3.connectionpool
"GET /me.json?client_id=93e33e327fd8a9b77becd179652272e2 ('HTTP/1.1',)" 200 740
ERROR 2013-11-19 22:45:45,823 [10402:MainThread] mopidy.backends.soundcloud.client
SoundCloud error: 'dict' object is not callable
INFO 2013-11-19 22:45:45,823 [10402:MainThread] mopidy.main
Stopping Mopidy frontends
DEBUG 2013-11-19 22:45:45,929 [10402:MainThread] mopidy.utils.process
Stopping 0 instance(s) of MpdFrontend
INFO 2013-11-19 22:45:45,929 [10402:MainThread] mopidy.main
Stopping Mopidy core
DEBUG 2013-11-19 22:45:45,930 [10402:MainThread] mopidy.utils.process
Stopping 0 instance(s) of Core
INFO 2013-11-19 22:45:45,930 [10402:MainThread] mopidy.main
Stopping Mopidy backends
DEBUG 2013-11-19 22:45:45,930 [10402:MainThread] mopidy.utils.process
Stopping 0 instance(s) of SoundCloudBackend
DEBUG 2013-11-19 22:45:45,931 [10402:MainThread] mopidy.utils.process
Stopping 0 instance(s) of LocalBackend
DEBUG 2013-11-19 22:45:45,931 [10402:MainThread] mopidy.utils.process
Stopping 0 instance(s) of StreamBackend
INFO 2013-11-19 22:45:45,932 [10402:MainThread] mopidy.main
Stopping Mopidy audio
DEBUG 2013-11-19 22:45:45,932 [10402:MainThread] mopidy.utils.process
Stopping 1 instance(s) of Audio
DEBUG 2013-11-19 22:45:45,934 [10402:MainThread] mopidy.utils.process
All actors stopped.
ERROR 2013-11-19 22:45:45,934 [10402:MainThread] mopidy.main
'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/usr/share/mopidy/mopidy/main.py", line 81, in main
start(proxied_config, enabled_extensions)
File "/usr/share/mopidy/mopidy/main.py", line 134, in start
backends = start_backends(config, extensions, audio)
File "/usr/share/mopidy/mopidy/main.py", line 171, in start_backends
backend = backend_class.start(config=config, audio=audio).proxy()
File "/usr/lib/pymodules/python2.7/pykka/actor.py", line 95, in start
obj = cls(_args, *_kwargs)
File "/usr/share/mopidy/mopidy_soundcloud/actor.py", line 23, in init
self.playlists = SoundCloudPlaylistsProvider(backend=self)
File "/usr/share/mopidy/mopidy_soundcloud/playlists.py", line 17, in init
self.refresh()
File "/usr/share/mopidy/mopidy_soundcloud/playlists.py", line 79, in refresh
self._playlists.append(self.create_user_liked_playlist())
File "/usr/share/mopidy/mopidy_soundcloud/playlists.py", line 60, in create_user_liked_playlist
username = self.backend.sc_api.get_user().get('username')
AttributeError: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/usr/bin/mopidy", line 9, in
load_entry_point('Mopidy==0.16.1', 'console_scripts', 'mopidy')()
File "/usr/share/mopidy/mopidy/main.py", line 81, in main
start(proxied_config, enabled_extensions)
File "/usr/share/mopidy/mopidy/main.py", line 134, in start
backends = start_backends(config, extensions, audio)
File "/usr/share/mopidy/mopidy/main.py", line 171, in start_backends
backend = backend_class.start(config=config, audio=audio).proxy()
File "/usr/lib/pymodules/python2.7/pykka/actor.py", line 95, in start
obj = cls(_args, *_kwargs)
File "/usr/share/mopidy/mopidy_soundcloud/actor.py", line 23, in init
self.playlists = SoundCloudPlaylistsProvider(backend=self)
File "/usr/share/mopidy/mopidy_soundcloud/playlists.py", line 17, in init
self.refresh()
File "/usr/share/mopidy/mopidy_soundcloud/playlists.py", line 79, in refresh
self._playlists.append(self.create_user_liked_playlist())
File "/usr/share/mopidy/mopidy_soundcloud/playlists.py", line 60, in create_user_liked_playlist
username = self.backend.sc_api.get_user().get('username')
AttributeError: 'NoneType' object has no attribute 'get'

any ideas?

Network ports

Hi,

Which networks ports are used to communicate to outside (I mean only the soundcloud service)? Which protocol is used? over TCP/UDP?

I have tried netstat but I didn't find something related to soundcloud. In fact, I will restrict ports with iptables, but I don't want to block ports used by this extension...

Mopidy Client

Heya,

Thanks for taking the time to put together this extension for Mopidy. It is a pretty exciting project.

What Mopidy client are you using for development, I want to contribute back to the extension to make things more robust but I wanted to check we have a similar environment for testing.

Thanks

Having error with Soundcloud

ERROR    SoundCloudBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 19, in _backend_error_handling
    yield
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 112, in _browse
    result = backend.library.browse(uri).get()
  File "/usr/lib/python2.7/dist-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/usr/lib/python2.7/dist-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/library.py", line 166, in browse
    return self.list_liked()
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/library.py", line 78, in list_liked
    logger.debug('Adding liked track %s to vfs' % data.name)
AttributeError: 'list' object has no attribute 'name'

Crash in MPD browse of "Explore/Drum & Bass" because of Ref.name which is None

INFO     Loaded 57 Spotify playlists
INFO     Song 161665785 was removed
ERROR    Unhandled exception in MpdSession (urn:uuid:39ca2a02-eab4-4c0a-9f6c-b83f20256c77):
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/home/jodal/dev/mopidy/mopidy/utils/network.py", line 366, in on_receive
    self.on_line_received(line)
  File "/home/jodal/dev/mopidy/mopidy/mpd/session.py", line 33, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 46, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 75, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 85, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 104, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 133, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 146, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 158, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 167, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/home/jodal/dev/mopidy/mopidy/mpd/protocol/__init__.py", line 178, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/home/jodal/dev/mopidy/mopidy/mpd/protocol/__init__.py", line 156, in validate
    return func(**callargs)
  File "/home/jodal/dev/mopidy/mopidy/mpd/protocol/music_db.py", line 413, in lsinfo
    for path, lookup_future in context.browse(uri, recursive=False):
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 320, in browse
    path = '/'.join([base_path, ref.name.replace('/', '')])
AttributeError: 'NoneType' object has no attribute 'replace'
Traceback (most recent call last):
  File "/home/jodal/dev/mopidy/mopidy/utils/network.py", line 271, in recv_callback
    self.actor_ref.tell({'close': True})
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 437, in tell
    raise _ActorDeadError('%s not found' % self)
pykka.exceptions.ActorDeadError: MpdSession (urn:uuid:39ca2a02-eab4-4c0a-9f6c-b83f20256c77) not found
INFO     New MPD connection from [::ffff:127.0.0.1]:35489

playlists won't load

I've installed mopidy-soundcloud on my raspbian and on my ubuntu pc. as far as i can see, the settings are the same, but on the raspbian the soundcloud playlists won't load, on ubuntu it does.

When starting mopidy on raspbian it won't say "INFO Loaded 5 SoundCloud playlist(s)"
starting mopidy with -vvv says it's validating and starting the extension, but i can't see any more messages about mopidy-soundcloud.
When i edit the auth token to something random, it doesn't give any messages, but when i comment out the auth_token it will warn me the token must be set.
It looks like it can't create a connection with soundcloud.

do you have any ideas?

The ReadMe does not spesify how this extension is to be used

I'm fairly new to mopidy, so this could be my inability to understand how things work together... but i've installed the simple web interface, and tried the iOS MPD client "mPoD", and can't locate anything soundcloud related. not under playlists, songs, artists, albums, browse... etc.
I did see an issue where someone stated there needs to be more documentation on it's actual use, and I highly concur, especially as a new user to mopity.
I got a token from http://www.mopity.com/authenticate, and entered it into my config file, so I don't think that's the problem.
If this is my lack of experience and / or this particular app's fault, I apologize, but as it stands now, there isn't really any specific (or broad, for that matter) instructions on this extension's use

Error when searching text has accented chars.

The stacktrace I got is:

Query: "vem chegando o verão"

Server returned error: { message: 'Application error',
code: 0,
data:
{ message: 'u'\xe3'',
traceback: 'Traceback (most recent call last):\n File "/opt/twitter/lib/python2.7/site-packages/mopidy/utils/jsonrpc.py", line 130, in _handle_single_request\n result = self._unwrap_result(result)\n File "/opt/twitter/lib/python2.7/site-packages/mopidy/utils/jsonrpc.py", line 219, in _unwrap_result\n result = result.get()\n File "/opt/twitter/lib/python2.7/site-packages/pykka/future.py", line 299, in get\n exec('raise exc_info[0], exc_info[1], exc_info[2]')\n File "/opt/twitter/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop\n response = self._handle_receive(message)\n File "/opt/twitter/lib/python2.7/site-packages/pykka/actor.py", line 294, in _handle_receive\n return callee(_message['args'], message['kwargs'])\n File "/opt/twitter/lib/python2.7/site-packages/mopidy/core/library.py", line 195, in search\n return [result for result in pykka.get_all(futures) if result]\n File "/opt/twitter/lib/python2.7/site-packages/pykka/future.py", line 330, in get_all\n return [future.get(timeout=timeout) for future in futures]\n File "/opt/twitter/lib/python2.7/site-packages/pykka/future.py", line 299, in get\n exec('raise exc_info[0], exc_info[1], exc_info[2]')\n File "/opt/twitter/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop\n response = self._handle_receive(message)\n File "/opt/twitter/lib/python2.7/site-packages/pykka/actor.py", line 294, in _handle_receive\n return callee(_message['args'], message['kwargs'])\n

File "/opt/twitter/lib/python2.7/site-packages/mopidy_soundcloud/library.py", line 177, in search\n tracks=self.backend.remote.search(search_query)\n
File "/opt/twitter/lib/python2.7/site-packages/mopidy_soundcloud/soundcloud.py", line 212, in search\n quote_plus(query)\n

File "/opt/twitter/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1293, in quote_plus\n s = quote(s, safe + ' ')\n File "/opt/twitter/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1288, in quote\n return ''.join(map(quoter, s))\nKeyError: u'\xe3'\n',
type: 'KeyError' } }

Nothing in SoundCloud/Following

Hello,
when I open the "SoundCloud/Following" folder I get this error message:

ERROR    SoundCloudBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 19, in _backend_error_handling
    yield
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 112, in _browse
    result = backend.library.browse(uri).get()
  File "/usr/lib/python2.7/dist-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/usr/lib/python2.7/dist-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/library.py", line 147, in browse
    return self.list_user_follows()
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/library.py", line 89, in list_user_follows
    for (name, user_id) in self.backend.remote.get_followings():
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/soundcloud.py", line 149, in get_followings
    name = playlist.get('username')
AttributeError: 'unicode' object has no attribute 'get'

Runnig mopidy on Debian Jessie and Python 2.7.9.

THS-on

Updated: Formatted stack trace. -jodal

Search in Soundcloud breaks search

Since the update mopidy-soundcloud 1.2.3-1 (ubuntu) I can no longer search in soundcloud. Selecting soundcloud as a search scope even disables searching in spotify or local files.
In Rompr, I can select in which back-end to search. Searching in spotify and/or local files results in expected hits. Selecting soundcloud results in a popup saying "Search failed".
Also, in ncmpcpp, I can not choose the back-end in which to search in, so the result is empty, being consistent with Rompr's behaviour when soundcloud is selected.

Install fails

I can't get the extension to install properly. Not sure what is wrong...

pi@raspberrypi ~ $ pip install Mopidy-SoundCloud

Downloading/unpacking Mopidy-SoundCloud
Downloading Mopidy_SoundCloud-1.0.18-py27-none-any.whl
Downloading/unpacking Mopidy>=0.14 (from Mopidy-SoundCloud)
Downloading Mopidy-0.17.0-py27-none-any.whl (144kB): 144kB downloaded
Requirement already satisfied (use --upgrade to upgrade): distribute in /usr/local/lib/python2.7/dist-packages (from Mopidy-SoundCloud)
Requirement already satisfied (use --upgrade to upgrade): Pykka>=1.1 in /usr/lib/python2.7/dist-packages (from Mopidy-SoundCloud)
Downloading/unpacking requests>=2.0.0 (from Mopidy-SoundCloud)
Downloading requests-2.2.0-py2.py3-none-any.whl (623kB): 623kB downloaded
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python2.7/dist-packages (from Mopidy>=0.14->Mopidy-SoundCloud)
Installing collected packages: Mopidy-SoundCloud, Mopidy, requests
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip-1.5-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5-py2.7.egg/pip/commands/install.py", line 275, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5-py2.7.egg/pip/req.py", line 1371, in install
requirement.install(install_options, global_options, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5-py2.7.egg/pip/req.py", line 655, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5-py2.7.egg/pip/req.py", line 885, in move_wheel_files
pycompile=self.pycompile,
File "/usr/local/lib/python2.7/dist-packages/pip-1.5-py2.7.egg/pip/wheel.py", line 209, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5-py2.7.egg/pip/wheel.py", line 196, in clobber
os.makedirs(destsubdir)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Mopidy_SoundCloud-1.0.18.dist-info'

Storing debug log for failure in /home/pi/.pip/pip.log

Always 404

Using the stations

electronic/Ambient, pop/New Wave, rock/Indie

from the README, I always get 404s when trying to access those using ncmpcpp.

False Readme

In the Readme it says
"[soundcloud]
auth_key = 1-1111-1111111"

But when I do that I get the error message:
"ERROR Config value soundcloud/auth_key unknown config key. Did you mean auth_token?"

So when I change it to auth_token I get this error message:
INFO     Audio mixer set to "alsamixer" using track "Master"
INFO     Starting new HTTPS connection (1): api.soundcloud.com
ERROR    SoundCloud Authentication error: 'dict' object is not callable
ERROR    'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/usr/bin/mopidy", line 9, in
load_entry_point('Mopidy==0.14.2', 'console_scripts', 'mopidy')()
File "/usr/lib/pymodules/python2.7/mopidy/main.py", line 88, in main
backends = setup_backends(proxied_config, enabled_extensions, audio)
File "/usr/lib/pymodules/python2.7/mopidy/main.py", line 243, in setup_backends
backend = backend_class.start(config=config, audio=audio).proxy()
File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 93, in start
obj = cls(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/mopidy_soundcloud/actor.py", line 20, in init
self.sc_api = SoundCloudClient(config['soundcloud']['auth_token'])
File "/usr/local/lib/python2.7/dist-packages/mopidy_soundcloud/soundcloud.py", line 61, in init
self.user.get('username'), self.user.get('id')))
AttributeError: 'NoneType' object has no attribute 'get'

Plugin broken

Just started using the plugin but it does not seem to work for me.
Here's my config:

[soundcloud]
auth_token = XXXXXXXXXXXXXXXXXXXXXXXXx
explore = world/Cumbia, world/Bhangra, world/African

and it crashes:
http://pastebin.com/46bNXdwJ

Track parsing fails when attempting to load Soundcloud stream feed

Using ncmcpp as a front-end, whenever I try and load my liked stream, an exception is raised by the server, e.g.:

** Message: pygobject_register_sinkfunc is deprecated (GstObject)
INFO     Starting Mopidy 0.19.5
INFO     Loading config from builtin defaults
INFO     Loading config from /home/keith/.config/mopidy/mopidy.conf
INFO     Loading config from command line options
INFO     Enabled extensions: mpd, http, stream, softwaremixer, local, soundcloud
INFO     Disabled extensions: none
INFO     Starting Mopidy mixer: SoftwareMixer
INFO     Starting Mopidy audio
INFO     Starting Mopidy backends: LocalBackend, StreamBackend, SoundCloudBackend
INFO     Audio output set to "autoaudiosink"
INFO     Starting Mopidy core
INFO     Starting Mopidy frontends: HttpFrontend, MpdFrontend
INFO     HTTP server running at [::ffff:127.0.0.1]:6680
INFO     MPD server running at [::]:6600
INFO     New MPD connection from [::ffff:127.0.0.1]:35373
INFO     New MPD connection from [::ffff:127.0.0.1]:35374
INFO     New MPD connection from [::1]:48246
INFO     New MPD connection from [::ffff:127.0.0.1]:35376
INFO     New MPD connection from [::ffff:127.0.0.1]:35377
INFO     New MPD connection from [::ffff:127.0.0.1]:35378
INFO     New MPD connection from [::ffff:127.0.0.1]:35379
INFO     New MPD connection from [::ffff:127.0.0.1]:35380
INFO     New MPD connection from [::ffff:127.0.0.1]:35381
INFO     New MPD connection from [::ffff:127.0.0.1]:35382
INFO     New MPD connection from [::ffff:127.0.0.1]:35384
INFO     'The Mara (Duke Dumont Edit)- Kiwi' can't be streamed from SoundCloud
TRACK:
[]
ERROR    Unhandled exception in MpdSession (urn:uuid:29e95010-a156-48cd-9b94-16606594b9b2):
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/usr/lib/python2.7/site-packages/mopidy/utils/network.py", line 366, in on_receive
    self.on_line_received(line)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/session.py", line 33, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 46, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 75, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 85, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 104, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 133, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 146, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 158, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/dispatcher.py", line 172, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/protocol/__init__.py", line 178, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/protocol/__init__.py", line 156, in validate
    return func(**callargs)
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/protocol/music_db.py", line 433, in lsinfo
    result.extend(translator.track_to_mpd_format(tracks[0]))
  File "/usr/lib/python2.7/site-packages/mopidy/mpd/translator.py", line 42, in track_to_mpd_format
    ('file', track.uri or ''),
AttributeError: 'list' object has no attribute 'uri'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mopidy/utils/network.py", line 272, in recv_callback
    self.actor_ref.tell({'close': True})
  File "/usr/lib/python2.7/site-packages/pykka/actor.py", line 437, in tell
    raise _ActorDeadError('%s not found' % self)
pykka.exceptions.ActorDeadError: MpdSession (urn:uuid:29e95010-a156-48cd-9b94-16606594b9b2) not found
INFO     New MPD connection from [::1]:48256
INFO     'The Mara (Duke Dumont Edit)- Kiwi' can't be streamed from SoundCloud
...

As far as I can tell though, the API response looks okay:

{
  "kind": "track",
  "id": 161789203,
  "created_at": "2014/08/05 11:47:06 +0000",
  "user_id": 337162,
  "duration": 244058,
  "commentable": true,
  "state": "finished",
  "original_content_size": 9762540,
  "last_modified": "2015/02/20 15:53:07 +0000",
  "sharing": "public",
  "tag_list": "house pop club blaseboysclub \"duke dumont\" remix kiwi \"the mara\" mara",
  "permalink": "the-mara-duke-dumont-edit-kiwi",
  "streamable": false,
  "embeddable_by": "all",
  "downloadable": false,
  "purchase_url": "https://itunes.apple.com/gb/album/the-mara-single/id899382762?ign-mpt=uo%3D4",
  "label_id": null,
  "purchase_title": "BUY NOW",
  "genre": "Techno",
  "title": "The Mara (Duke Dumont Edit)- Kiwi",
  "description": "facebook.com/kiwidj\r\n\r\nChart topping dance music sensation Duke Dumont presents a new offering from his imprint and artist collective with ‘The Mara EP’ coming courtesy of fellow London-based producer and DJ, Kiwi. \r\n\r\nA sterling three-tracker, ‘The Mara’ can be heard alongside an edit from the label boss Duke Dumont himself and b-side addition ‘Gerenuk’.  \r\n\r\n'Hearing the demo of ‘The Mara’, it made me regress to the time I spent in the rainforest, chilling with the Chieftains and drinking ayahuasca,” explains the Duke. \r\n\r\n“The obscure sounds of exotic bird mating calls which I heard are replicated in the synth chirps and tonal aspects of this track. Ultimately though, I signed the song because of the unique character Kiwi has created sonically. Character within electronic music is usually hard to find, but Kiwi has achieved this effortlessly.”",
  "label_name": "",
  "release": "",
  "track_type": "",
  "key_signature": "",
  "isrc": "",
  "video_url": null,
  "bpm": null,
  "release_year": null,
  "release_month": null,
  "release_day": null,
  "original_format": "mp3",
  "license": "all-rights-reserved",
  "uri": "https://api.soundcloud.com/tracks/161789203",
  "user": {
    "id": 337162,
    "kind": "user",
    "permalink": "kiwidj",
    "username": "Kiwi_",
    "last_modified": "2015/02/09 16:41:29 +0000",
    "uri": "https://api.soundcloud.com/users/337162",
    "permalink_url": "http://soundcloud.com/kiwidj",
    "avatar_url": "https://i1.sndcdn.com/avatars-000126916754-khxsye-large.jpg"
  },
  "permalink_url": "http://soundcloud.com/kiwidj/the-mara-duke-dumont-edit-kiwi",
  "artwork_url": "https://i1.sndcdn.com/artworks-000087192976-9bgjpu-large.jpg",
  "waveform_url": "https://w1.sndcdn.com/oIBHlzZonvF8_m.png",
  "playback_count": 265433,
  "download_count": 0,
  "favoritings_count": 10009,
  "comment_count": 126,
  "attachments_uri": "https://api.soundcloud.com/tracks/161789203/attachments",
  "policy": "ALLOW"
}

I couldn't figure out how to spawn a PDB session at that point (any suggestions?), but adding a print statement showed that the track is an empty list, "[]".

System info:

** Message: pygobject_register_sinkfunc is deprecated (GstObject)
Platform: Linux-3.18.6-1-ARCH-x86_64-with-glibc2.2.5
Python: CPython 2.7.9 from /usr/lib/python2.7
Mopidy: 0.19.5 from /usr/lib/python2.7/site-packages
  setuptools: 12.2 from /usr/lib/python2.7/site-packages
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/site-packages
  tornado>=2.3: 4.1 from /usr/lib/python2.7/site-packages
Mopidy-SoundCloud: 1.2.5 from /usr/lib/python2.7/site-packages
  setuptools: 12.2 from /usr/lib/python2.7/site-packages
  Mopidy>=0.18: 0.19.5 from /usr/lib/python2.7/site-packages
    setuptools: 12.2 from /usr/lib/python2.7/site-packages
    Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/site-packages
    tornado>=2.3: 4.1 from /usr/lib/python2.7/site-packages
  Pykka>=1.1: 1.2.0 from /usr/lib/python2.7/site-packages
  requests>=2.0.0: 2.5.1 from /usr/lib/python2.7/site-packages
GStreamer: 0.10.36.0 from /usr/lib/python2.7/site-packages/gst-0.10/gst
  Detailed information: 
    Python wrapper: gst-python 0.10.22.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lame
        mad
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mp3parse

Any suggestions? I'm happy to help track down the issue, but not sure of how to get into PDB. I tried both hard-coding a 'import pdb; pdb.set_trace()' and launching from the CLI:

python2 -m pdb `which mopidy`

But perhaps because of the threading used, It does not open up PDB.

get_user_liked() runs slow on big liked-lists

Browsing the Database of the "Liked sounds" in Soundcloud takes too long on big soundcloud accounts. The Timeout of 60 seconds hits before everything is returned. Even with setting the gmpc client to 600 seconds, it just froze completely until the timeout has been hit.

I reduced the limit= in the API Call to make it faster. It works this way but sure is not the state-of-the-art.

Any Ideas here?

176c176
<         liked = self._get('e1/me/likes.json?limit=20')

---
>         liked = self._get('e1/me/likes.json?limit=1000')

1000 times out >
20 works <

Soundcloud playing problem

Hi,
I have followed the instructions regarding the soundcloud authentication (I just installed it). As the token didin't appear on Google Chrome, I get it with Ms Edge browser. I write it on the configuration file (/etc/mopidy/mopidy.conf) for mopidy as background service.
I can listen music from soundcloud, but only in the folder explore (not other folder, which are directly related to my soundcloud account). When I browse an other folder (than explore), no music appears and I get the following message in the log file:

root@raspberrypi:/var/log/mopidy # cat mopidy.log
2016-03-25 09:47:54,516 ERROR [545:Core-7] mopidy.core.library: SoundCloudBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 19, in _backend_error_handling
    yield
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 112, in _browse
    result = backend.library.browse(uri).get()
  File "/usr/lib/python2.7/dist-packages/pykka/threading.py", line 52, in get
    compat.reraise(*self._data['exc_info'])
  File "/usr/lib/python2.7/dist-packages/pykka/compat.py", line 12, in reraise
    exec('raise tp, value, tb')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 201, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 295, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/library.py", line 166, in browse
    return self.list_liked()
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/library.py", line 74, in list_liked
    for data in self.backend.remote.get_user_liked():
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/soundcloud.py", line 177, in get_user_liked
    liked = self._get('e1/me/likes.json?limit=1000')
  File "/usr/lib/python2.7/dist-packages/mopidy_soundcloud/soundcloud.py", line 235, in _get
    res.raise_for_status()
  File "/usr/lib/python2.7/dist-packages/requests/models.py", line 825, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 503 Server Error: Service Not Available

Does the problem come from soundcloud authentication? Is is just a soung that I liked which make all crash? Is it possible to get more verbose logs? Is it just a bug which will be soon fixed?

Here is my soundcloud profile : https://soundcloud.com/jay-bee-de

shows only 10 results in search

hi, i have been searching for hours to find a solution. maybe you can help me.

installed mopidy with SC plugin

installed web interface musicbox
installed GMPC

with web interface and GMPC i get only 10 results on a search. if i search manually direct on SC i found more results.

Is there a wayto fix?

mopidy cfg:
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
debug_file = mopidy.log
config_file =

[audio]
mixer = software
mixer_volume =
output = autoaudiosink
visualizer =

[proxy]
scheme =
hostname =
port =
username =
password =

[soundcloud]
enabled = true
explore_songs = 25
auth_token = ********

[musicbox_webclient]
enabled = true

[http]
enabled = true
hostname = 127.0.0.1
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname

[mpd]
enabled = true
hostname = 127.0.0.1
port = 6600
password =
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname

[softwaremixer]
enabled = true

[local]
enabled = true
library = json
media_dir = $XDG_MUSIC_DIR
data_dir = $XDG_DATA_DIR/mopidy/local
playlists_dir = $XDG_DATA_DIR/mopidy/local/playlists
scan_timeout = 1000
scan_flush_threshold = 1000
excluded_file_extensions =
.directory
.html
.jpeg
.jpg
.log
.nfo
.png
.txt

[stream]
enabled = true
protocols =
file
http
https
mms
rtmp
rtmps
rtsp
metadata_blacklist =
timeout = 5000

When browsing the SoundCloud stream less than ten songs are displayed

I'm using ncmpcpp as client. When navigating to Browse, [soundcloud], [stream], less than 10 songs appear in the list.

The (undocumented) API seems to have changed.
The problem seems to be in this function:

    def get_user_stream(self):
        # User timeline like playlist which uses undocumented api
        # https://api.soundcloud.com/e1/me/stream.json?offset=0
        # returns five elements per request
        tracks = []
        for sid in xrange(0, 2):
            stream = self._get('e1/me/stream.json?offset=%s' % sid * 5)
            for data in stream.get('collection'):
                kind = data.get('type')
                # multiple types of track with same data
                if 'track' in kind:
                    tracks.append(self.parse_track(data.get('track')))
                if kind == 'playlist':
                    playlist = data.get('playlist').get('tracks')
                    if isinstance(playlist, collections.Iterable):
                        tracks.extend(self.parse_results(playlist))

        return self.sanitize_tracks(tracks)

The offset parameter of the API call seems not to have an effect anymore.

The following works for me:

    def get_user_stream(self):
        # User timeline like playlist which uses undocumented api
        # https://api.soundcloud.com/e1/me/stream.json?limit=100
        tracks = []
        stream = self._get('e1/me/stream.json?limit=100')
        for data in stream.get('collection'):
            kind = data.get('type')
            # multiple types of track with same data
            if 'track' in kind:
                tracks.append(self.parse_track(data.get('track')))
            if kind == 'playlist':
                playlist_id = data.get('playlist').get('id')
                for track in self.get_set(playlist_id):
                    tracks.append(self.parse_track(track))

        return self.sanitize_tracks(tracks)

SoundCloudBackend backend caused an exception

I get this error when trying add this url playlist:

https://soundcloud.com/zeb-23/sets

ERROR    SoundCloudBackend backend caused an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 19, in _backend_error_handling yield
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 236, in lookup result = future.get()
  File "/usr/lib/python2.7/dist-packages/pykka/threading.py", line 52, in get compat.reraise(*self._data['exc_info'])
  File "/usr/lib/python2.7/dist-packages/pykka/compat.py", line 12, in reraise exec('raise tp, value, tb')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 201, in _actor_loop response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 295, in _handle_receive return callee(*message['args'], **message['kwargs'])
  File "/usr/local/lib/python2.7/dist-packages/mopidy_soundcloud/library.py", line 202, in lookup return self.backend.remote.resolve_url(uri)
  File "/usr/local/lib/python2.7/dist-packages/mopidy_soundcloud/soundcloud.py", line 225, in resolve_url return self.parse_results([self._get('resolve.json?url=%s' % uri)])
  File "/usr/local/lib/python2.7/dist-packages/mopidy_soundcloud/soundcloud.py", line 236, in _get res = self.http_client.get(url)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 467, in get return self.request('GET', url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 378, in send raise ConnectionError(e)
ConnectionError: HTTPSConnectionPool(host='api.soundcloud.com', port=443): Max retries exceeded with url: /resolve.json?url=https://soundcloud.com/zeb-23/sets&client_id=93e33e327fd8a9b77becd179652272e2 (Caused by <class 'socket.error'>: [Errno 104] Connection reset by peer)

Removed/Non-existant SoundCloud liked tracks are still listed in playlists & queues

It seems the call to get liked tracks from a SoundCloud account still returns tracks which have been removed, but the subsequent request to get the proper track details from the given Soundcloud URI then fails. Eg, in my "liked" tracks I get the below JSON track returned:

{u'username': u'BOILER ROOM', u'permalink': u'platform', u'avatar_url': u'https://i1.sndcdn.com/avatars-000148237176-ws6zkk-large.jpg', u'kind': u'user', u'uri': u'https://api.soundcloud.com/users/752705', u'last_modified': u'2015/07/17 11:42:15 +0000', u'permalink_url': u'http://soundcloud.com/platform', u'id': 752705}, u'genre': u'Boiler Room', u'isrc': u'', u'permalink_url': u'http://soundcloud.com/platform/jamie-xx-55-min-boiler-room', u'kind': u'track', u'release_year': None, u'license': u'all-rights-reserved', u'monetization_model': u'NOT_APPLICABLE', u'artwork_url': u'https://i1.sndcdn.com/artworks-000035639414-mc3ylb-large.jpg', u'created_at': u'2012/12/06 17:27:19 +0000', u'bpm': None, u'uri': u'https://api.soundcloud.com/tracks/70225661', u'original_content_size': 121006339, u'key_signature': u'', u'user_playback_count': 1, u'release': u'', u'tag_list': u'"Boiler Room" "Jamie XX"', u'embeddable_by': u'all'}

However the actual URI (https://api.soundcloud.com/tracks/70225661?client_id=....) returns a 404 error.

This doesn't then play nicely with the musicbox_webclient software as the Queue page appears empty due to an undefined entry in the returned array to the client!

Unhandled exception when search term contains UTF-8

OSX, running mopidy from git with mopidy-soundcloud installed from homebrew

When searching (via the MPD interface):

search artist "Air" album "Premiers Symptômes"

I get an unhandled exception:

INFO     Searching SoundCloud for 'Premieres Symptômes Air'
ERROR    Unhandled exception in MpdSession (urn:uuid:9f04da0f-fc43-42f1-948c-3099bcfcf0cf):
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/internal/network.py", line 370, in on_receive
    self.on_line_received(line)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/session.py", line 34, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 47, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 76, in     _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 89, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 105, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 134, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 147, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 68, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 159, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/dispatcher.py", line 174, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/protocol/__init__.py", line 180, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/protocol/__init__.py", line 142, in validate
    return func(*args, **kwargs)
  File "/Users/bob/mopidy-dev/mopidy/mopidy/mpd/protocol/music_db.py", line 443, in search
    results = context.core.library.search(query).get()
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/Users/bob/mopidy-dev/mopidy/mopidy/core/library.py", line 342, in search
    result = future.get()
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mopidy_soundcloud/library.py", line 196, in search
    tracks=self.backend.remote.search(search_query)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mopidy_soundcloud/soundcloud.py", line 212, in search
    quote_plus(query), self.explore_songs))
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1308, in quote_plus
    s = quote(s, safe + ' ')
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1303, in quote
    return ''.join(map(quoter, s))
KeyError: u'\xf4'

Sounds in sets absent from available tracks

Sounds that are in a set but also exist as an individual upload are present, but any sounds that are not present as individual uploads do not seem to be included in searches or browse results (including my stream and the subscription list).

Song not played to the end when it has been paused for a while

Hi,
I listen a lot to long files like dj sets, usually well over an hour.
Sometimes I want to pause the music then continue listening later.
When I start playing again, the music continues fine but then after a while (few minutes?) it stops and just skips to the next item in the playlist.

Any idea what causes this issue?

AttributeError: 'NoneType' object has no attribute 'status_code'

Worked well and without change it seems that SoundCloud stopped working for some reason:

ERROR    Uncaught exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 274, in run
    backends = self.start_backends(config, backend_classes, audio)
  File "/usr/lib/python2.7/dist-packages/mopidy/commands.py", line 352, in start_backends
    config=config, audio=audio).proxy()
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 93, in start
    obj = cls(*args, **kwargs)
  File "/usr/share/mopidy/mopidy_soundcloud/actor.py", line 21, in __init__
    self.remote = SoundCloudClient(config['soundcloud'])
  File "/usr/share/mopidy/mopidy_soundcloud/soundcloud.py", line 80, in __init__
    if err.response.status_code == 401:
AttributeError: 'NoneType' object has no attribute 'status_code'

May be first step would be to handle correctly err.response is None.

Not playing on OS X.

Using Mopidy 0.19.4 and ncmpcpp.

I can browse music but when I attempt to play any track I get this error in the console:

[ERROR 2014-10-24 14:18:08,865 [66730:MainThread] mopidy.audio.actor
Resource not found. Debug message: gstsouphttpsrc.c(924): gst_soup_http_src_finished_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin3/GstSoupHTTPSrc:source:
libsoup status code 6

I have the same issue on two different Mac machines. One is using Mavericks and other Yosemite. Different internet connections too, so don't think it is a proxy problem.

I thought I'd try it on Linux (Ubuntu) and it works fine.

Other mopidy extensions are working fine (SomaFM, Tunein).

Does anyone have suggestions or is there more logging I can provide?

Cache explore categories

The current code makes an API to get the explore categories every time you load the info, even though it never changes. I'm submitting a patch to cache it.

Liked returns no results

Running the SC extension on Mopidy 0.19.4 with the Moped 0.4.0 frontend. When I click the 'Liked' button in the extension I see the spinning wheel indicating that it is loading. While this is happening I get messages in the console such as

INFO     'Too Close feat. Detour City' can't be streamed from SoundCloud
INFO     'Wilkinson - Heartbeat ft. P Money & Arlissa' can't be streamed from SoundCloud
INFO     'Wilkinson - Heatwave ft K. Flay [PREVIEW]' can't be streamed from SoundCloud
INFO     'Kangaroo Court' can't be streamed from SoundCloud
INFO     'Moiez vs Daphne & Project 46 - Crime (3LAU Mix)' can't be streamed from SoundCloud
INFO     'Devil's Work (Dirty South Remix)' can't be streamed from SoundCloud

After which the loading wheel stops running and no results are returned.

Error with likes

ERROR    Unhandled exception in MpdSession (urn:uuid:fbfd0421-ab77-4aa1-90ff-bfb6c1c8ead0):
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/usr/lib/python2.7/dist-packages/mopidy/utils/network.py", line 366, in on_receive
    self.on_line_received(line)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/session.py", line 33, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 46, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 75, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 85, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 104, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 133, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 146, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 158, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 167, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/protocol/__init__.py", line 178, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/protocol/__init__.py", line 156, in validate
    return func(**callargs)
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/protocol/music_db.py", line 413, in lsinfo
    for path, lookup_future in context.browse(uri, recursive=False):
  File "/usr/lib/python2.7/dist-packages/mopidy/mpd/dispatcher.py", line 319, in browse
    for ref in future.get():
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 73, in browse
    return backend.library.browse(uri).get()
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/usr/share/mopidy/mopidy_soundcloud/library.py", line 148, in browse
    return self.list_liked()
  File "/usr/share/mopidy/mopidy_soundcloud/library.py", line 60, in list_liked
    logger.debug('Adding liked track %s to vfs' % data.name)
AttributeError: 'list' object has no attribute 'name'

Playing local songs also adds soundcloud songs

Hi,
I also use the local backend of mopidy. When I add an artist from the local library, the playlist also fills up with songs found in soundcloud. I'd like to only play the local ones however. If I want to play something from soundcloud, I use search. Is it possible to only play the local songs? I have mopidy running on a raspberry pi, I tried MPDroid and GMPC as clients.

Failed to lookup soundcloud song

When I'm trying to get into "Liked" in my ncmpcpp client I'm getting this INFO:

INFO     Failed to lookup soundcloud:song/(yuxx bootleg demo).83080709: SoundCloud track not found
INFO     Failed to lookup soundcloud:song/YOU ARE INVITED.125240468: SoundCloud track not found
INFO     Failed to lookup soundcloud:song/Carving Ymir (old version).65413451: SoundCloud track not found
INFO     Failed to lookup soundcloud:song/Various YZYX Kawaii Loli Attack uMmr EdItIoN (Tracklist and Download in description).50694917: SoundCloud track not found
...

And so on. I think that Mopidy is running correctly. It prints:

INFO     New MPD connection from [::ffff:127.0.0.1]:54440
INFO     New MPD connection from [::ffff:127.0.0.1]:54444
INFO     New MPD connection from [::ffff:127.0.0.1]:54452
INFO     New MPD connection from [::ffff:127.0.0.1]:54456
...

I'm using Arch and I tried both mopidy official repo and mopidy-git from AUR. As far as I am concerned there is nothing wrong with my modipy.config. Is this some link-parsing error?

Also I linked up AUR because maybe the problem lies in the PKGBUILD? Building is done by python2 setup.py install --root="$pkgdir/" --optimize=1 command. And here is the list of dependencies:

depends=(
  'python2'
  'python2-requests'
  'python2-pykka>=1.1'
  'gstreamer0.10-ugly-plugins'
  'mopidy>=1.0'
)

Crash when auth token has become invalid

If you change your SoundCloud password, the auth token is invalidated and must be updated in mopidy.conf. Until you do so, Mopidy-Soundcloud crashes hard with a stack trace:

$ mopidy
INFO     Starting Mopidy 0.18.3-307-gcb6e19c
INFO     Loading config from: builtin defaults, /etc/xdg/xdg-ubuntu/mopidy/mopidy.conf, /usr/share/upstart/xdg/mopidy/mopidy.conf, /etc/xdg/mopidy/mopidy.conf, /home/jodal/.config/mopidy/mopidy.conf, command line options
INFO     Enabled extensions: spotify, mpd, http, stream, lux, scrobbler, mpris, moped, dirble, local, api_explorer, soundcloud
INFO     Disabled extensions: beets, nad, gmusic, subsonic, radio-de, arcam
INFO     Starting Mopidy audio
INFO     Starting Mopidy backends: LocalBackend, StreamBackend, SoundCloudBackend, SpotifyBackend, DirbleBackend
INFO     Loaded 0 local playlists from /home/jodal/.local/share/mopidy/local/playlists
INFO     Loaded 0 local tracks using json
INFO     Audio output set to "autoaudiosink"
INFO     Audio mixer is using software mixing
INFO     Mopidy uses SPOTIFY(R) CORE
INFO     Starting Mopidy core
INFO     Starting Mopidy frontends: MprisFrontend, ScrobblerFrontend, HttpFrontend, MpdFrontend
INFO     MPRIS server connected to D-Bus
INFO     MPD server running at [::]:6600
INFO     HTTP server running at http://:::6680
INFO     Connected to Spotify
INFO     Scrobbler connected to Last.fm
INFO     New MPD connection from [::ffff:127.0.0.1]:55797
INFO     Searching SoundCloud for 'glycerine'
ERROR    Unhandled exception in MpdSession (urn:uuid:6e6ea63f-0af0-4398-abbb-e2971b95e115):
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 303, in _handle_receive
    return self.on_receive(message)
  File "/home/jodal/dev/mopidy/mopidy/utils/network.py", line 366, in on_receive
    self.on_line_received(line)
  File "/home/jodal/dev/mopidy/mopidy/mpd/session.py", line 33, in on_line_received
    response = self.dispatcher.handle_request(line)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 46, in handle_request
    return self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 75, in _catch_mpd_ack_errors_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 85, in _authenticate_filter
    return self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 104, in _command_list_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 133, in _idle_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 146, in _add_ok_filter
    response = self._call_next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 67, in _call_next_filter
    return next_filter(request, response, filter_chain)
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 158, in _call_handler_filter
    response = self._format_response(self._call_handler(request))
  File "/home/jodal/dev/mopidy/mopidy/mpd/dispatcher.py", line 167, in _call_handler
    return protocol.commands.call(tokens, context=self.context)
  File "/home/jodal/dev/mopidy/mopidy/mpd/protocol/__init__.py", line 171, in call
    return self.handlers[tokens[0]](context, *tokens[1:])
  File "/home/jodal/dev/mopidy/mopidy/mpd/protocol/__init__.py", line 140, in validate
    return func(*args, **kwargs)
  File "/home/jodal/dev/mopidy/mopidy/mpd/protocol/music_db.py", line 473, in search
    results = context.core.library.search(**query).get()
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/home/jodal/dev/mopidy/mopidy/core/library.py", line 193, in search
    return [result for result in pykka.get_all(futures) if result]
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 330, in get_all
    return [future.get(timeout=timeout) for future in futures]
  File "/usr/lib/python2.7/dist-packages/pykka/future.py", line 299, in get
    exec('raise exc_info[0], exc_info[1], exc_info[2]')
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File "/home/jodal/dev/mopidy-soundcloud/mopidy_soundcloud/library.py", line 177, in search
    tracks=self.backend.remote.search(search_query)
  File "/home/jodal/dev/mopidy-soundcloud/mopidy_soundcloud/soundcloud.py", line 212, in search
    quote_plus(query)
  File "/home/jodal/dev/mopidy-soundcloud/mopidy_soundcloud/soundcloud.py", line 238, in _get
    res.raise_for_status()
  File "/usr/lib/python2.7/dist-packages/requests/models.py", line 773, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 401 Client Error: Unauthorized
INFO     Loaded 57 Spotify playlists
Traceback (most recent call last):
  File "/home/jodal/dev/mopidy/mopidy/utils/network.py", line 271, in recv_callback
    self.actor_ref.tell({'close': True})
  File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 437, in tell
    raise _ActorDeadError('%s not found' % self)
pykka.exceptions.ActorDeadError: MpdSession (urn:uuid:6e6ea63f-0af0-4398-abbb-e2971b95e115) not found
INFO     New MPD connection from [::ffff:127.0.0.1]:55809

Mopidy-Soundcloud should catch 401 Unauthorized HTTP errors and log a good error message explaining possible reasons for the error instead of failing with an uncatched exception.

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.