User Tools

Site Tools


programming:python:py-sonic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
programming:python:py-sonic [2013/04/28 19:20] – [ping(self)] jayprogramming:python:py-sonic [2024/01/01 17:13] (current) – [scrobble(self, sid, submission=True)] jay
Line 14: Line 14:
 **NOTE:** The RPMs are **not** guaranteed to be the latest versions.  Check [[https://github.com/crustymonkey/py-sonic|Github]] to find out what the latest version is.  That said, I will try and keep these up to date.  **NOTE:** The RPMs are **not** guaranteed to be the latest versions.  Check [[https://github.com/crustymonkey/py-sonic|Github]] to find out what the latest version is.  That said, I will try and keep these up to date. 
  
-{{:programming:python:py-sonic-0.2.0-1.src.rpm|py-sonic-0.2.1-1.src.rpm}} \\ +{{:programming:python:py-sonic-0.2.2-1.src.rpm|py-sonic-0.2.2-1.src.rpm}} \\ 
-{{:programming:python:py-sonic-0.2.0-1.noarch.rpm|py-sonic-0.2.1-1.noarch.rpm}}+{{:programming:python:py-sonic-0.2.2-1.noarch.rpm|py-sonic-0.2.2-1.noarch.rpm}}
  
 ===== Donations ===== ===== Donations =====
Line 101: Line 101:
 **UPDATE to the UPDATE:**  I've fixed this in version 0.1.10.  This will now handle redirects from Subsonic correctly. **UPDATE to the UPDATE:**  I've fixed this in version 0.1.10.  This will now handle redirects from Subsonic correctly.
  
-==== Important Notes About API Version 1.8.0 ====+==== Important Notes About API Version 1.8.0 (and later) ====
 It's important to note that Subsonic API version 1.8.0 added some methods that are not compatible with previous methods.  Prior to 1.8.0, the access to your library was only usable within a directory hierarchy context.  With 1.8.0, a number of access methods were added to search and get artists, albums, songs, etc. based on, instead of file system structure, the ID3 tags of the music files themselves. It's important to note that Subsonic API version 1.8.0 added some methods that are not compatible with previous methods.  Prior to 1.8.0, the access to your library was only usable within a directory hierarchy context.  With 1.8.0, a number of access methods were added to search and get artists, albums, songs, etc. based on, instead of file system structure, the ID3 tags of the music files themselves.
  
Line 162: Line 162:
 | name | str | The name of the playlist to **CREATE** | | name | str | The name of the playlist to **CREATE** |
 | songIds | list[str] | The list of songIds to populate the list with in either create or update mode.  Note that this list will replace the existing list if updating. | | songIds | list[str] | The list of songIds to populate the list with in either create or update mode.  Note that this list will replace the existing list if updating. |
 +
 +Returns a dict like the following:
 +<code python>
 +{
 +    u'status': u'ok',
 +    u'version': u'1.5.0',
 +    u'xmlns': u'http://subsonic.org/restapi'
 +}
 +</code>
 +
 +==== createPodcastChannel(self, url) ====
 +__Since API version: 1.9.0__
 +
 +Adds a new Podcast channel.  Note: The user must be authorized for Podcast administration
 +
 +
 +^ Name ^ Type ^ Description ^
 +| url | str | The URL of the Podcast to add |
  
 Returns a dict like the following: Returns a dict like the following:
Line 194: Line 212:
  
 See the documention on [[http://subsonic.org|the Subsonic site]] for more information on all the boolean role args. See the documention on [[http://subsonic.org|the Subsonic site]] for more information on all the boolean role args.
 +
 +Returns a dict like the following:
 +<code python>
 +{
 +    u'status': u'ok',
 +    u'version': u'1.5.0',
 +    u'xmlns': u'http://subsonic.org/restapi'
 +}
 +</code>
 +
 +==== deleteBookmark(self, mid) ====
 +__Since API version: 1.9.0__
 +
 +Deletes the bookmark for a given file
 +
 +^ Name ^ Type ^ Description ^
 +| mid | str | The ID of the media file to delete the bookmark from. Other users' bookmarks are not affected |
  
 Returns a dict like the following: Returns a dict like the following:
Line 220: Line 255:
 } }
 </code> </code>
 +==== deletePodcastChannel(self, pid) ====
 +__Since API version: 1.9.0__
  
 +Deletes a Podcast channel.  Note: The user must be authorized for Podcast administration
 +
 +^ Name ^ Type ^ Description ^
 +| pid | str | ID of the Podcast channel to delete |
 +
 +Returns a dict like the following:
 +<code python>
 +{
 +    u'status': u'ok',
 +    u'version': u'1.5.0',
 +    u'xmlns': u'http://subsonic.org/restapi'
 +}
 +</code>
 +
 +==== deletePodcastEpisode(self, pid) ====
 +__Since API version: 1.9.0__
 +
 +Deletes a Podcast episode.  Note: The user must be authorized for Podcast administration
 +
 +
 +^ Name ^ Type ^ Description ^
 +| pid | str | ID of the Podcast episode to delete |
 +
 +Returns a dict like the following:
 +<code python>
 +{
 +    u'status': u'ok',
 +    u'version': u'1.5.0',
 +    u'xmlns': u'http://subsonic.org/restapi'
 +}
 +</code>
 ==== deleteShare(self, shid) ==== ==== deleteShare(self, shid) ====
 __Since API version: 1.6.0__ __Since API version: 1.6.0__
Line 264: Line 332:
  
 Returns the file-like object for reading or raises an exception on error. Returns the file-like object for reading or raises an exception on error.
 +
 +==== downloadPodcastEpisode(self , pid) ====
 +__Since API version: 1.9.0__
 +
 +Tells the server to start downloading a given Podcast episode. Note: The user must be authorized for Podcast administration
 +
 +^ Name ^ Type ^ Description ^
 +| pid | str | The ID of the Podcast episode to download. |
 +
 +Returns a dict like the following:
 +<code python>
 +{
 +    u'status': u'ok',
 +    u'version': u'1.5.0',
 +    u'xmlns': u'http://subsonic.org/restapi'
 +}
 +</code>
  
 ==== getAlbum(self , id) ==== ==== getAlbum(self , id) ====
Line 415: Line 500:
 Returns the file-like object for reading or raises an exception on error Returns the file-like object for reading or raises an exception on error
  
 +==== getBookmarks(self) ====
 +__Since API version: 1.9.0__
 +
 +Returns all bookmarks for this user.  A bookmark is a position within a media file
 +
 +<code python>
 +{
 +  "bookmarks": {
 +    "bookmark": {
 +      "changed": "2013-04-28T13:18:55", 
 +      "comment": "testing a bookmark", 
 +      "created": "2013-04-28T13:18:55", 
 +      "entry": {
 +        "album": "The Anthology", 
 +        "albumId": 3480, 
 +        "artist": "A Tribe Called Quest", 
 +        "artistId": 1512, 
 +        "bitRate": 128, 
 +        "contentType": "audio/mpeg", 
 +        "coverArt": 45794, 
 +        "created": "2005-07-27T14:27:42", 
 +        "duration": 292, 
 +        "id": 45827, 
 +        "isDir": false, 
 +        "isVideo": false, 
 +        "parent": 45794, 
 +        "path": "A Tribe Called Quest/The Anthology/13 Stressed Out.mp3", 
 +        "size": 4685211, 
 +        "suffix": "mp3", 
 +        "title": "Stressed Out", 
 +        "track": 13, 
 +        "type": "music"
 +      }, 
 +      "position": 30000, 
 +      "username": "admin"
 +    }
 +  }, 
 +  "status": "ok", 
 +  "version": "1.9.0", 
 +  "xmlns": "http://subsonic.org/restapi"
 +}
 +</code>
 ==== getChatMessages(self, since=1) ==== ==== getChatMessages(self, since=1) ====
 __Since API version: 1.2.0__ __Since API version: 1.2.0__
Line 504: Line 631:
 I hope that table clarifies things a bit. I hope that table clarifies things a bit.
  
 +==== getInternetRadioStations(self) ====
 +__Since API version: 1.9.0__
 +
 +Returns all internet radio stations
 +
 +Returns a dict like the following:
 +
 +<code python>
 +{
 +  "internetRadioStations": {
 +    "internetRadioStation": {
 +      "homePageUrl": "http://www.di.fm/", 
 +      "id": 0, 
 +      "name": "DI hard dance", 
 +      "streamUrl": "http://listen.di.fm/public3/harddance.pls"
 +    }
 +  }, 
 +  "status": "ok", 
 +  "version": "1.9.0", 
 +  "xmlns": "http://subsonic.org/restapi"
 +}
 +</code>
 ====  getLicense(self) ==== ====  getLicense(self) ====
 __Since API version: 1.0.0__ __Since API version: 1.0.0__
Line 1015: Line 1164:
              u'xmlns': u'http://subsonic.org/restapi'}              u'xmlns': u'http://subsonic.org/restapi'}
 </code> </code>
 +==== hls(self , mid , bitrate=None) ====
 +__Since API version: 1.9.0__
 +
 +Creates an HTTP live streaming playlist for streaming video or audio HLS is a streaming protocol implemented by Apple and works by breaking the overall stream into a sequence of small HTTP-based file downloads. It's supported by iOS and newer versions of Android. This method also supports adaptive bitrate streaming, see the bitRate parameter.
 +
 +^ Name ^ Type ^ Description ^
 +| mid | str | The ID of the media to stream |
 +| bitrate | str | If specified, the server will attempt to limit the bitrate to this value, in kilobits per second. If this parameter is specified more than once, the server will create a variant playlist, suitable for adaptive bitrate streaming. The playlist will support streaming at all the specified bitrates.  The server will automatically choose video dimensions that are suitable for the given bitrates.  (since: 1.9.0) you may explicitly request a certain width (480) and height (360) like so: bitRate=1000@480x360 |
 +
 +Returns the raw m3u8 file as a string
 +
 ==== jukeboxControl(self, action, index=None, sids=[], gain=None , offset=None) ==== ==== jukeboxControl(self, action, index=None, sids=[], gain=None , offset=None) ====
 __Since API version: 1.2.0__ __Since API version: 1.2.0__
Line 1056: Line 1216:
 | sid | str | The ID of the file to scrobble | | sid | str | The ID of the file to scrobble |
 | submission | bool | Whether this is a "submission" or a "now playing" notification | | submission | bool | Whether this is a "submission" or a "now playing" notification |
 +| listenTime | int | The unix timestamp for the listen to scrobble. |
  
 Returns a dict like the following: Returns a dict like the following:
programming/python/py-sonic.1367176837.txt.gz · Last modified: 2013/04/28 19:20 by jay