SoCo
latest

User Documentation

  • Getting started
  • Examples
  • Frequently Asked Questions
  • Plugins
  • Authors

In depth topics

  • Speaker Topologies
  • UPnP Services
  • Events
  • The Music Library Data Structures

API documentation

  • soco package
    • Subpackages
      • soco.music_services package
      • soco.plugins package
        • Submodules
        • Module contents
    • Submodules

Release Notes

  • SoCo releases

Development Topics

  • Unit and integration tests
  • Release Procedures
SoCo
  • Docs »
  • soco package »
  • soco.plugins package »
  • soco.plugins.sharelink module
  • Edit on GitHub

soco.plugins.sharelink module¶

ShareLink Plugin.

class soco.plugins.sharelink.ShareClass[source]¶

Base class for supported services.

canonical_uri(uri)[source]¶

Recognize a share link and return its canonical representation.

Parameters

uri (str) – A URI like “https://tidal.com/browse/album/157273956”.

Returns

The canonical URI or None if not recognized.

Return type

str

service_number()[source]¶

Return the service number.

Returns

A number identifying the supported music service.

Return type

int

static magic()[source]¶

Return magic.

Returns

Magic prefix/key/class values for each share type.

Return type

dict

extract(uri)[source]¶

Extract the share type and encoded URI from a share link.

Returns

The shared type, like “album” or “track”. encoded_uri: An escaped URI with a service-specific format.

Return type

share_type

class soco.plugins.sharelink.SpotifyShare[source]¶

Spotify share class.

canonical_uri(uri)[source]¶

Recognize a share link and return its canonical representation.

Parameters

uri (str) – A URI like “https://tidal.com/browse/album/157273956”.

Returns

The canonical URI or None if not recognized.

Return type

str

service_number()[source]¶

Return the service number.

Returns

A number identifying the supported music service.

Return type

int

extract(uri)[source]¶

Extract the share type and encoded URI from a share link.

Returns

The shared type, like “album” or “track”. encoded_uri: An escaped URI with a service-specific format.

Return type

share_type

class soco.plugins.sharelink.SpotifyUSShare[source]¶

Spotify US share class.

service_number()[source]¶

Return the service number.

Returns

A number identifying the supported music service.

Return type

int

class soco.plugins.sharelink.TIDALShare[source]¶

TIDAL share class.

canonical_uri(uri)[source]¶

Recognize a share link and return its canonical representation.

Parameters

uri (str) – A URI like “https://tidal.com/browse/album/157273956”.

Returns

The canonical URI or None if not recognized.

Return type

str

service_number()[source]¶

Return the service number.

Returns

A number identifying the supported music service.

Return type

int

extract(uri)[source]¶

Extract the share type and encoded URI from a share link.

Returns

The shared type, like “album” or “track”. encoded_uri: An escaped URI with a service-specific format.

Return type

share_type

class soco.plugins.sharelink.DeezerShare[source]¶

Deezer share class.

canonical_uri(uri)[source]¶

Recognize a share link and return its canonical representation.

Parameters

uri (str) – A URI like “https://tidal.com/browse/album/157273956”.

Returns

The canonical URI or None if not recognized.

Return type

str

service_number()[source]¶

Return the service number.

Returns

A number identifying the supported music service.

Return type

int

extract(uri)[source]¶

Extract the share type and encoded URI from a share link.

Returns

The shared type, like “album” or “track”. encoded_uri: An escaped URI with a service-specific format.

Return type

share_type

class soco.plugins.sharelink.AppleMusicShare[source]¶

Apple Music share class.

canonical_uri(uri)[source]¶

Recognize a share link and return its canonical representation.

Parameters

uri (str) – A URI like “https://tidal.com/browse/album/157273956”.

Returns

The canonical URI or None if not recognized.

Return type

str

service_number()[source]¶

Return the service number.

Returns

A number identifying the supported music service.

Return type

int

extract(uri)[source]¶

Extract the share type and encoded URI from a share link.

Returns

The shared type, like “album” or “track”. encoded_uri: An escaped URI with a service-specific format.

Return type

share_type

class soco.plugins.sharelink.ShareLinkPlugin(soco)[source]¶

A SoCo plugin for playing music service share links.

Initialize the plugin.

property name¶

Human-readable name of the plugin

is_share_link(uri)[source]¶

bool: Is the URI for a supported music service.

add_share_link_to_queue(uri, position=0, as_next=False, **kwargs)[source]¶

Add a Spotify/Tidal/… item to the queue.

This is similar to soco.add_uri_to_queue() but will work with music service share links that do not directly point to sound files.

Parameters
  • uri (str) – A URI like “spotify:album:6wiUBliPe76YAVpNEdidpY”.

  • position (int) – The index (1-based) at which the URI should be added. Default is 0 (add URI at the end of the queue).

  • as_next (bool) – Whether this URI should be played as the next track in shuffle mode. This only works if “play_mode=SHUFFLE”.

Returns

The index of the new item in the queue.

Return type

int

Next Previous

© Copyright 2015-2021, The SoCo Team Revision f2594687.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions
latest
stable
v0.29.0
v0.28.1
v0.28.0
v0.27.1
v0.27.0
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.1
v0.24.0
v0.23.3
v0.23.2
v0.23.1
v0.23.0
v0.22.6
v0.22.5
v0.22.4
v0.22.3
v0.22.2
v0.22.1
v0.22.0
v0.21.3
v0.21.2
v0.21.1
v0.21
v0.20
v0.19
v0.18.1
v0.18
v0.17
v0.16
v0.15
v0.14
v0.13
v0.12
v0.11.1
v0.11
v0.10
v0.9
v0.8
v0.7
v0.6
v0.5
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.