Difference between revisions of "Headphones"

From Amahi Wiki
Jump to: navigation, search
(Started a page for a how-to install headphones.)
 
 
(26 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[https://github.com/rembo10/headphones Headphones] is a SABnzbd add-on that automates your music downloading. You can import all your favorite artists from iTunes, and keep an eye out for any new albums they might be releasing.
+
{{NeedsUpdate}}
 +
 
 +
 
 +
<b>NOTE:</b>  Installing git is not necessary and the needed program files can be downloaded from the site as a zip file.  No need to clone the repo and add further overhead to the HDA.
 +
 
 +
[https://github.com/rembo10/headphones Headphones] is a [http://www.amahi.org/apps/sabnzbd-plus SABnzbd Plus] add-on that automates your music downloading. You can import all your favorite artists from iTunes, and keep an eye out for any new albums they might be releasing.
  
 
It can be configured to work with a few search providers, including NZBMatrix, NZBs.org and Newznab servers.
 
It can be configured to work with a few search providers, including NZBMatrix, NZBs.org and Newznab servers.
Line 7: Line 12:
 
*Music:  [https://github.com/rembo10/headphones Headphones]
 
*Music:  [https://github.com/rembo10/headphones Headphones]
  
{{MessageBox|
 
backgroundcolor = #FBB|
 
image =Warning.png|
 
heading =WARNING|
 
message = Headphones is still under heavy development and in alpha stadium.}}
 
 
This guidance will instruct you how to get Headphones and add it to your HDA.  Upon completion, you will have Headphones running, but not as a service since their is only a init.d script for Ubuntu users at this moment.   
 
This guidance will instruct you how to get Headphones and add it to your HDA.  Upon completion, you will have Headphones running, but not as a service since their is only a init.d script for Ubuntu users at this moment.   
  
 
== PreRequisites ==
 
== PreRequisites ==
[http://www.amahi.org/apps/sabnzbd SabNZBD]
+
[http://www.amahi.org/apps/sabnzbd-plus SABnzbd Plus]
  
 
== Install ==
 
== Install ==
* First install git-core in case you don't have it.:
 
{{Code|su -
 
yum install git-core
 
}}
 
* Now get headphones using the following command.:
 
{{Code|git clone https://github.com/rembo10/headphones.git
 
}}
 
  
* Now you can start up headphones by executing the following command. (Change /headphones/directory to your download directory eg. /home/user/headphones/Headphones.py)
+
==== Amahi 6 (Ubuntu) Automated Method====
{{Code|python /headphones/directory/Headphones.py
+
 
}}
+
* The Amahi [https://www.amahi.org/apps/headphones Headphones] <b>BETA</b> one-click app install for Amahi 6 works for the most part, with two exceptions.
Now you can use Headphones by going to http://hda:8181/
+
** The app never registers on the Amahi Dashboard/Web Interface
 +
** The app doesn't start at boot
 +
<br>
 +
* To make Headphones start at boot, create the start up script:
 +
nano /etc/init.d/headphones
 +
 
 +
<pre>#! /bin/sh
 +
 
 +
### BEGIN INIT INFO
 +
# Provides:          Headphones application instance
 +
# Required-Start:    $all
 +
# Required-Stop:    $all
 +
# Default-Start:    2 3 4 5
 +
# Default-Stop:      0 1 6
 +
# Short-Description: starts instance of Headphones
 +
# Description:      starts instance of Headphones using start-stop-daemon
 +
### END INIT INFO
 +
 
 +
############### EDIT ME ##################
 +
# path to app
 +
APP_PATH=/var/hda/web-apps/headphones/html
 +
 
 +
# path to python bin
 +
DAEMON=/usr/bin/python
 +
 
 +
# startup args
 +
DAEMON_OPTS="Headphones.py -q"
 +
 
 +
# script name
 +
NAME=headphones
 +
 
 +
# app name
 +
DESC=headphones
 +
 
 +
# user
 +
RUN_AS=www-data
 +
 
 +
PID_FILE=/var/run/headphones.pid
 +
 
 +
############### END EDIT ME ##################
 +
 
 +
test -x $DAEMON || exit 0
 +
 
 +
set -e
 +
 
 +
case "$1" in
 +
  start)
 +
        echo "Starting $DESC"
 +
        start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE  --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
 +
        ;;
 +
  stop)
 +
        echo "Stopping $DESC"
 +
        start-stop-daemon --stop --pidfile $PID_FILE
 +
        ;;
 +
 
 +
  restart|force-reload)
 +
        echo "Restarting $DESC"
 +
        start-stop-daemon --stop --pidfile $PID_FILE
 +
        sleep 15
 +
        start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE  --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
 +
        ;;
 +
  *)
 +
        N=/etc/init.d/$NAME
 +
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
 +
        exit 1
 +
        ;;
 +
esac
 +
 
 +
exit 0</pre>
 +
 
 +
* Enable the Headphones service
 +
sudo chkconfig headphones on
 +
 
 +
==== Amahi 6 (Ubuntu) Manual Method ====
 +
 
 +
These instructions are for an Ubuntu 12.04 setup, modification will be required for a Fedora install
 +
 
 +
* Create a new web app named "headphones" from the dashboard:
 +
** It should be under Setup > Apps > Webapps (you need to have [[Advanced_Settings|advanced settings]] enabled first)
 +
** You may have to create the directory for the webapp by hand from the command line with
 +
mkdir -p /var/hda/web-apps/headphones/html /var/hda/web-apps/headphones/logs
 +
 
 +
* Install git-core in case you don't have it.
 +
sudo apt-get install git-core
 +
 
 +
* Issue the following commands to correct the html directory permissions
 +
sudo chown [username]:users /var/hda/web-apps/headphones/html
 +
chmod 775 /var/hda/web-apps/headphones/html
 +
: Remember to replace [username] with your username
 +
 
 +
* Clone the git source from github to your web root directory (html) with
 +
git clone https://github.com/rembo10/headphones.git /var/hda/web-apps/headphones/html/
 +
 
 +
* Open and modify the included Ubuntu init.d script
 +
nano /var/hda/web-apps/headphones/html/init.ubuntu
 +
: Change APP_PATH line to read APP_PATH=/var/hda/web-apps/headphones/html
 +
 
 +
: Ctrl + X then Y then Return to save and exit
 +
 
 +
* Copy the file to the appropriate location and tell ubuntu to use use the script
 +
sudo cp /var/hda/web-apps/headphones/html/init.ubuntu /etc/init.d/headphones
 +
sudo chmod +x /etc/init.d/headphones
 +
sudo update-rc.d headphones defaults
 +
 
 +
Test it is working by issuing the following command and checking http://headphones:8181 in your browser
 +
sudo /etc/init.d/headphones start
 +
 
 +
----
 +
[[Category:apps]]

Latest revision as of 22:44, 14 September 2015

Msgbox.update.png Update Needed
The contents of this page have become outdated or irrelevant. Please consider updating it.


NOTE: Installing git is not necessary and the needed program files can be downloaded from the site as a zip file. No need to clone the repo and add further overhead to the HDA.

Headphones is a SABnzbd Plus add-on that automates your music downloading. You can import all your favorite artists from iTunes, and keep an eye out for any new albums they might be releasing.

It can be configured to work with a few search providers, including NZBMatrix, NZBs.org and Newznab servers.

This guidance will instruct you how to get Headphones and add it to your HDA. Upon completion, you will have Headphones running, but not as a service since their is only a init.d script for Ubuntu users at this moment.

PreRequisites

SABnzbd Plus

Install

Amahi 6 (Ubuntu) Automated Method

  • The Amahi Headphones BETA one-click app install for Amahi 6 works for the most part, with two exceptions.
    • The app never registers on the Amahi Dashboard/Web Interface
    • The app doesn't start at boot


  • To make Headphones start at boot, create the start up script:
nano /etc/init.d/headphones
#! /bin/sh

### BEGIN INIT INFO
# Provides:          Headphones application instance
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts instance of Headphones
# Description:       starts instance of Headphones using start-stop-daemon
### END INIT INFO

############### EDIT ME ##################
# path to app
APP_PATH=/var/hda/web-apps/headphones/html

# path to python bin
DAEMON=/usr/bin/python

# startup args
DAEMON_OPTS="Headphones.py -q"

# script name
NAME=headphones

# app name
DESC=headphones

# user
RUN_AS=www-data

PID_FILE=/var/run/headphones.pid

############### END EDIT ME ##################

test -x $DAEMON || exit 0

set -e

case "$1" in
  start)
        echo "Starting $DESC"
        start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE  --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
        ;;
  stop)
        echo "Stopping $DESC"
        start-stop-daemon --stop --pidfile $PID_FILE
        ;;

  restart|force-reload)
        echo "Restarting $DESC"
        start-stop-daemon --stop --pidfile $PID_FILE
        sleep 15
        start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE  --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0
  • Enable the Headphones service
sudo chkconfig headphones on

Amahi 6 (Ubuntu) Manual Method

These instructions are for an Ubuntu 12.04 setup, modification will be required for a Fedora install

  • Create a new web app named "headphones" from the dashboard:
    • It should be under Setup > Apps > Webapps (you need to have advanced settings enabled first)
    • You may have to create the directory for the webapp by hand from the command line with
mkdir -p /var/hda/web-apps/headphones/html /var/hda/web-apps/headphones/logs
  • Install git-core in case you don't have it.
sudo apt-get install git-core
  • Issue the following commands to correct the html directory permissions
sudo chown [username]:users /var/hda/web-apps/headphones/html
chmod 775 /var/hda/web-apps/headphones/html
Remember to replace [username] with your username
  • Clone the git source from github to your web root directory (html) with
git clone https://github.com/rembo10/headphones.git /var/hda/web-apps/headphones/html/
  • Open and modify the included Ubuntu init.d script
nano /var/hda/web-apps/headphones/html/init.ubuntu
Change APP_PATH line to read APP_PATH=/var/hda/web-apps/headphones/html
Ctrl + X then Y then Return to save and exit
  • Copy the file to the appropriate location and tell ubuntu to use use the script
sudo cp /var/hda/web-apps/headphones/html/init.ubuntu /etc/init.d/headphones
sudo chmod +x /etc/init.d/headphones
sudo update-rc.d headphones defaults

Test it is working by issuing the following command and checking http://headphones:8181 in your browser

sudo /etc/init.d/headphones start