SoCo
0.26.4

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
  • soco package
  • soco.plugins package
  • soco.plugins.sharelink module
  • View page source

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)[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

Previous Next

© Copyright 2015-2021, The SoCo Team.

Built with Sphinx using a theme provided by Read the Docs.