WWW::Subsonic - Interface with the Subsonic API
version 0.005
This module provides a very simple interface to using the Subsonic API.
use Path::Tiny; use WWW::Subsonic; my $subsonic = WWW::Subsonic->new( username => 'user1', password => 'Assw0rd1P', ); my $pinged = $subsonic->api_request('ping.view'); my $starred = $subsonic->api_request('getStarred2'); foreach my $song (@{ $starred->{song} }) { my $dst = path($song->{path}); $dst->parent->mkpath; $dst->spew_raw( $subsonic->api_request(download => { id => $song->{id} }) ); }
Subsonic protocol, https (the default) or http.
Subsonic server name, defaults to localhost
Subsonic server port, default 4000
Subsonic username, required.
Subsonic user's password, required. This is never sent over the wire, instead it's hashed using a salt for the server to verify.
Salt for interacting with the server, regenerated each object instantiation. Will be randomly generated.
Generated from the salt and password.
UserAgent object used to interface with the Subsonic server. Needs to be an instance of Mojo::UserAgent.
The Subsonic API verion to target, currently defaults to the latest, Subsonic 6.1, API version 1.15.0.
The identifier to use for interfacing with the server, defaults to perl(WWW::Subsonic).
Builds an API request using the parameters.
This is the name of of the method to call, ie, getStarred, download, etc.
getStarred
download
Most API calls take one or more named arguments. Specify those named arguments in this hash reference and they will be encoded properly and joined with the other parameters to form the request.
This method provides the following arguments to all API calls so you don't have to: u - username, s - salt, t - token, v - API version, c - client identified, f - format (json).
Subsonic API Docs
Brad Lhotsky <brad@divisionbyzero.net>
This software is Copyright (c) 2017 by Brad Lhotsky.
This is free software, licensed under:
The (three-clause) BSD License
Brad Lhotsky <brad.lhotsky@gmail.com>
José Joaquín Atria <jjatria@gmail.com>
Mohammad S Anwar <mohammad.anwar@yahoo.com>
The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.
MetaCPAN
A modern, open-source CPAN search engine, useful to view POD in HTML format.
http://metacpan.org/release/WWW-Subsonic
RT: CPAN's Bug Tracker
The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.
https://rt.cpan.org/Public/Dist/Display.html?Name=WWW-Subsonic
This module's source code is available by visiting: https://github.com/reyjrar/WWW-Subsonic
To install WWW::Subsonic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Subsonic
CPAN shell
perl -MCPAN -e shell install WWW::Subsonic
For more information on module installation, please visit the detailed CPAN module installation guide.