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 20:13] – [getInternetRadioStations(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 505: Line 505:
 Returns all bookmarks for this user.  A bookmark is a position within a media file 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 601: Line 638:
 Returns a dict like the following: Returns a dict like the following:
  
-<source lang=python>+<code python>
 { {
   "internetRadioStations": {   "internetRadioStations": {
Line 615: Line 652:
   "xmlns": "http://subsonic.org/restapi"   "xmlns": "http://subsonic.org/restapi"
 } }
-</source>+</code>
 ====  getLicense(self) ==== ====  getLicense(self) ====
 __Since API version: 1.0.0__ __Since API version: 1.0.0__
Line 1127: 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 1168: 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.1367180018.txt.gz · Last modified: 2013/04/28 20:13 by jay