Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions plugin.audio.soundcloud/addon.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.audio.soundcloud" name="SoundCloud" version="4.0.2" provider-name="jaylinski">
<addon id="plugin.audio.soundcloud" name="SoundCloud" version="4.1.0" provider-name="jaylinski">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.requests" version="2.22.0"/>
<import addon="script.module.requests" version="2.29.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>audio</provides>
</extension>
<extension point="xbmc.addon.metadata">
<summary lang="de_DE">SoundCloud – Musik- und Podcast-Streaming-Plattform</summary>
<summary lang="en_GB">SoundCloud – Music and podcast streaming platform</summary>
<summary lang="nl_NL">SoundCloud – Muziek- en podcaststreamingplatform</summary>
<description lang="de_DE">SoundCloud ist eine Musik- und Podcast-Streaming-Plattform, mit der Du Millionen von Songs aus der ganzen Welt anhören kannst.</description>
<description lang="en_GB">SoundCloud is a music and podcast streaming platform that lets you listen to millions of songs from around the world.</description>
<description lang="nl_NL">SoundCloud is een muziek- en podcaststreamingplatform waarmee je naar miljoenen nummers van over de hele wereld kunt luisteren.</description>
<disclaimer lang="en_GB">This plugin is not official, approved or endorsed by SoundCloud.</disclaimer>
<disclaimer lang="nl_NL">Deze plugin is niet officieel, goedgekeurd of gesteund door SoundCloud.</disclaimer>
<platform>all</platform>
<license>MIT</license>
<forum>https://forum.kodi.tv/showthread.php?tid=206635</forum>
<website>https://soundcloud.com</website>
<source>https://github.com/jaylinski/kodi-addon-soundcloud</source>
<news>4.0.2 (2022-03-13)
<news>4.1.0 (2025-10-06)
Fixed error when using addon
Added description and follower-counts to user profiles
Added description and likes to playlists
Added playcount to tracks
Updated Dutch translations

4.0.2 (2022-03-13)
Fixed random CloudFront errors when sending requests
Added context-menu option for removing search-history items

Expand Down
4 changes: 2 additions & 2 deletions plugin.audio.soundcloud/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img align="right" src="https://github.com/xbmc/xbmc/raw/master/addons/webinterface.default/icon-128.png" alt="Kodi logo">

[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/jaylinski/kodi-addon-soundcloud.svg)](https://github.com/jaylinski/kodi-addon-soundcloud/releases)
[![Build Status](https://img.shields.io/github/workflow/status/jaylinski/kodi-addon-soundcloud/Continuous%20Integration/master.svg)](https://github.com/jaylinski/kodi-addon-soundcloud/actions)
[![CI Build Status](https://github.com/jaylinski/kodi-addon-soundcloud/actions/workflows/ci.yml/badge.svg)](https://github.com/jaylinski/kodi-addon-soundcloud/actions)
[![Link to Kodi forum](https://img.shields.io/badge/Kodi-Forum-informational.svg)](https://forum.kodi.tv/showthread.php?tid=206635)
[![Link to Kodi wiki](https://img.shields.io/badge/Kodi-Wiki-informational.svg)](https://kodi.wiki/view/Add-on:SoundCloud)
[![Link to Kodi releases](https://img.shields.io/badge/Kodi-v19%20%22Matrix%22-green.svg)](https://kodi.wiki/view/Releases)
Expand Down Expand Up @@ -51,7 +51,7 @@ This add-on uses [Pipenv](https://pypi.org/project/pipenv/) to manage its depend

### Setup

[Install Pipenv](https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv) and run `pipenv install --dev`.
[Install Pipenv](https://pipenv.pypa.io/en/latest/installation.html#installing-pipenv) and run `pipenv install --dev`.

### Build

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,11 @@ msgstr "In deinem Land nicht verfügbar"
msgctxt "#30903"
msgid "Preview"
msgstr "Vorschau"

msgctxt "#30904"
msgid "followers"
msgstr "Follower"

msgctxt "#30905"
msgid "likes"
msgstr "Likes"
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,11 @@ msgstr ""
msgctxt "#30903"
msgid "Preview"
msgstr ""

msgctxt "#30904"
msgid "followers"
msgstr ""

msgctxt "#30905"
msgid "likes"
msgstr ""
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Jan Hekkerman\n"
"Last-Translator: Miniontoby\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -46,11 +46,11 @@ msgstr ""

msgctxt "#30061"
msgid "Client-ID"
msgstr ""
msgstr "Client ID"

msgctxt "#30062"
msgid "Localization"
msgstr ""
msgstr "Localisatie"

msgctxt "#30063"
msgid "auto"
Expand Down Expand Up @@ -144,4 +144,12 @@ msgstr "Niet beschikbaar in jouw land"

msgctxt "#30903"
msgid "Preview"
msgstr "Voorbeeld"

msgctxt "#30904"
msgid "followers"
msgstr "volgers"

msgctxt "#30905"
msgid "likes"
msgstr ""
11 changes: 6 additions & 5 deletions plugin.audio.soundcloud/resources/lib/kodi/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ def charts(self):
items = []

# Top 50
list_item = xbmcgui.ListItem(label=format_bold(self.addon.getLocalizedString(30301)))
url = self.addon_base + PATH_CHARTS + "?" + urllib.parse.urlencode({
"action": "top"
})
items.append((url, list_item, True))
# TOOD Not working anymore, replace with new GraphQL API
# list_item = xbmcgui.ListItem(label=format_bold(self.addon.getLocalizedString(30301)))
# url = self.addon_base + PATH_CHARTS + "?" + urllib.parse.urlencode({
# "action": "top"
# })
# items.append((url, list_item, True))

# Trending
list_item = xbmcgui.ListItem(label=format_bold(self.addon.getLocalizedString(30302)))
Expand Down
19 changes: 17 additions & 2 deletions plugin.audio.soundcloud/resources/lib/models/playlist.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from resources.lib.models.list_item import ListItem
import urllib.parse
import xbmcaddon
import xbmcgui

likes = xbmcaddon.Addon().getLocalizedString(30905)


class Playlist(ListItem):
thumb = ""
Expand All @@ -11,12 +14,24 @@ class Playlist(ListItem):
def to_list_item(self, addon_base):
list_item = xbmcgui.ListItem(label=self.label, label2=self.label2)
list_item.setArt({"thumb": self.thumb})
list_item.setInfo("music", {
"title": self.label
list_item.setIsFolder(True)
list_item.setProperty("isPlayable", "false")
# We have to use the `video`-type in order to display a proper folder description
list_item.setInfo("video", {
"plot": self._get_description()
})

url = addon_base + "/?" + urllib.parse.urlencode({
"action": "call",
"call": "/playlists/{id}".format(id=self.id)
})

return url, list_item, True

def _get_description(self):
return "{}\n{} {}\n\n{}".format(
self.info.get("artist"),
self.info.get("likes"),
likes,
self.info.get("description") or ""
)
1 change: 1 addition & 0 deletions plugin.audio.soundcloud/resources/lib/models/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def to_list_item(self, addon_base):
"genre": self.info.get("genre"),
"title": self.label,
"year": self.info.get("date")[:4],
"playcount": self.info.get("playback_count"),
"comment": self.info.get("description")
})
list_item.setProperty("isPlayable", "true")
Expand Down
19 changes: 17 additions & 2 deletions plugin.audio.soundcloud/resources/lib/models/user.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from resources.lib.models.list_item import ListItem
from resources.routes import *
import urllib.parse
import xbmcaddon
import xbmcgui

followers = xbmcaddon.Addon().getLocalizedString(30904)


class User(ListItem):
thumb = ""
Expand All @@ -11,12 +14,24 @@ class User(ListItem):
def to_list_item(self, addon_base):
list_item = xbmcgui.ListItem(label=self.label, label2=self.label2)
list_item.setArt({"thumb": self.thumb})
list_item.setInfo("music", {
"title": self.info.get("description")
list_item.setIsFolder(True)
list_item.setProperty("isPlayable", "false")
# We have to use the `video`-type in order to display a proper folder description
list_item.setInfo("video", {
"plot": self._get_description()
})

url = addon_base + PATH_USER + "?" + urllib.parse.urlencode({
"id": self.id,
"call": "/users/{id}/tracks".format(id=self.id)
})

return url, list_item, True

def _get_description(self):
return "{}\n{} {}\n\n{}".format(
self.label2 if self.label2 != "" else self.label,
self.info.get("followers"),
followers,
self.info.get("description") or ""
)
14 changes: 9 additions & 5 deletions plugin.audio.soundcloud/resources/lib/soundcloud/api_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ApiV2(ApiInterface):
api_limit = 20
api_limit_tracks = 50
api_lang = "en"
api_user_agent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0"
api_user_agent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/142.0"
api_cache = {
"discover": 120 # 2 hours
}
Expand Down Expand Up @@ -175,7 +175,8 @@ def _map_json_to_collection(self, json_obj):
user.label2 = item.get("full_name", "")
user.thumb = self._get_thumbnail(item, self.thumbnail_size)
user.info = {
"artist": item.get("description", None)
"description": item.get("description", ""),
"followers": item.get("followers_count", 0)
}
collection.items.append(user)

Expand All @@ -185,7 +186,9 @@ def _map_json_to_collection(self, json_obj):
playlist.label2 = item.get("label_name", "")
playlist.thumb = self._get_thumbnail(item, self.thumbnail_size)
playlist.info = {
"artist": item["user"]["username"]
"artist": item["user"]["username"],
"description": item.get("description", ""),
"likes": item.get("likes_count", 0)
}
collection.items.append(playlist)

Expand Down Expand Up @@ -251,7 +254,8 @@ def _build_track(self, item):
"genre": item.get("genre", None),
"date": item.get("display_date", None),
"description": item.get("description", None),
"duration": int(item["duration"]) / 1000
"duration": int(item["duration"]) / 1000,
"playback_count": item.get("playback_count", 0)
}

return track
Expand All @@ -273,7 +277,7 @@ def fetch_client_id():
response.encoding = "utf-8" # This speeds up `response.text` by 3 seconds

# Extract the API key
key = re.search(r"exports={\"api-v2\".*client_id:\"(\w*)\"", response.text)
key = re.search(r"client_application_id:[1-9]+,client_id:\"(\w*)\"", response.text)

if key:
return str(key.group(1))
Expand Down