gpodder / gpodder

The gPodder podcast client.
http://gpodder.org/
GNU General Public License v3.0
1.28k stars 204 forks source link

Soundcloud feeds are not working #1167

Open auouymous opened 3 years ago

auouymous commented 3 years ago

It appears subscribing and updating soundcloud feeds may be broken due to more API changes, see https://github.com/soundcloud/api/issues/142.

Subscribing:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/gpodder/gtkui/main.py", line 2667, in thread_proc
    channel = self.model.load_podcast(url=url, create=True,
  File "/usr/lib/python3.9/site-packages/gpodder/model.py", line 1564, in load_podcast
    return self.PodcastClass.load(self, url, create,
  File "/usr/lib/python3.9/site-packages/gpodder/model.py", line 1152, in load
    tmp.update(max_episodes)
  File "/usr/lib/python3.9/site-packages/gpodder/model.py", line 1332, in update
    self._consume_updated_feed(result.feed, max_episodes)
  File "/usr/lib/python3.9/site-packages/gpodder/model.py", line 1219, in _consume_updated_feed
    feed.get_cover_url() or None,
  File "/usr/lib/python3.9/site-packages/gpodder/plugins/soundcloud.py", line 205, in get_cover_url
    return self.sc_user.get_coverart()
  File "/usr/lib/python3.9/site-packages/gpodder/plugins/soundcloud.py", line 123, in get_coverart
    user_info = self.get_user_info()
  File "/usr/lib/python3.9/site-packages/gpodder/plugins/soundcloud.py", line 111, in get_user_info
    raise Exception('Soundcloud "%s": %d %s' % (json_url, r.status_code, r.reason))
Exception: Soundcloud "https://api.soundcloud.com/users/901720.json?consumer_key=zrweghtEtnZLpXf3mlm8mQ": 401 Unauthorized

From Yorvyk on mailing list:

I'm getting the above error on all my Soundcloud subscriptions.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gpodder/gtkui/main.py", line 2671, in
update_feed_cache_proc
    channel.update(max_episodes=self.config.max_episodes_per_feed)
  File "/usr/lib/python3/dist-packages/gpodder/model.py", line 1166, in update
    self._consume_updated_feed(result.feed, max_episodes)
  File "/usr/lib/python3/dist-packages/gpodder/model.py", line 1076, in
_consume_updated_feed
    new_episodes, seen_guids = feed.get_new_episodes(self, existing_guids)
  File "/usr/lib/python3/dist-packages/gpodder/plugins/soundcloud.py", line
196, in get_new_episodes
    return self._get_new_episodes(channel, existing_guids, 'tracks')
  File "/usr/lib/python3/dist-packages/gpodder/plugins/soundcloud.py", line
204, in _get_new_episodes
    tracks = list(self.sc_user.get_tracks(track_type))
  File "/usr/lib/python3/dist-packages/gpodder/plugins/soundcloud.py", line
128, in get_tracks
    tracks = [track for track in json_tracks if track['streamable'] or
track['downloadable']]
  File "/usr/lib/python3/dist-packages/gpodder/plugins/soundcloud.py", line
128, in <listcomp>
    tracks = [track for track in json_tracks if track['streamable'] or
track['downloadable']]
TypeError: string indices must be integers
christofdamian commented 2 years ago

Would it be an idea to include the scdl functionality in gpodder? That one doesn't use the API and either uses the available downloads or scrapes the tracks of a user or play-list.

auouymous commented 2 years ago

scdl appears to use the oauth API.

christofdamian commented 2 years ago

Oh, my bad. I didn't realise that. Sorry about the noise.

zotabee commented 2 years ago

Any news on soundcloud support? Still broken for now...

dante-chiesa commented 1 year ago

As of July 2021, it's impossible to use soundcloud's API without first registering an app under the developer's soundcloud account to get an app-specific secret key. Per their api docs, they don't even allow the "log in with soundcloud" /connect endpoint without a client_id and client_secret, so prompting users to sign in through soundcloud in order to get an Oauth token isn't a way around this.

Distributing a 'secret' key as part of an open source application is not very reasonable, so any fix to gpodder's soundcloud integration would require some hacky workaround:

tpikonen commented 1 year ago

I'll just note here again that the combination of rss-bridge and yt-dlp works fine with soundcloud feeds, at least the last time I tested them.

There is the PR under review (#1177) which may fix the soundcloud plugin, but if it cannot be merged, then maybe the plugin-based soundcloud support should be removed.

Also, the 'Soundcloud search' option under 'Discover new podcasts' does not work.