CouchPotato
I ran into a neat little program called CouchPotato. It is used for downloading movies off the internet. It works with either nzb or torrent files. Once you have it installed you can search for movies that you would like, and add them to your want list. When you add it to the want list you also specify the quality that you would like the movie to be. There are options to have it rename the files and put them in a different directory.
I am installing this on and Ubuntu 10.04 machine.
CouchPotato requires Python 2.6 or higher to run. You also need to make sure that you have git installed so that you can download the program. You may reinstall it by running the following command.
sudo apt-get install git-core |
Now lets move to the directory that we want to install CouchPotato to. I have selected this specific folder because that is where the default install is set. This will allow us to use the initd that was created for the program without having to modify it. A standard user will not have permissions to get the git repository so we will run it with sudo.
It is installed by default into CouchPotato, but the initd says couchpotato all lower case so we’ll move it.
cd /usr/local/sbin sudo git clone http://github.com/RuudBurger/CouchPotato.git sudo mv CouchPotato couchpotato |
Now if you want to get started playing right away you can get into the couchpotato directory and start up couchpotato. We add the -d to the end of the command to make it run as a deamon.
cd couchpotato sudo python CouchPotato.py -d |
By default the program runs on port 5000. This can be changed by going into the settings on the web application which is now located at http://localhost:5000, assuming that you just installed it on your local machine. You will have to substitute localhost with whatever IP you need to if you installed it on a remote machine.
Once you log into the webpage you will have to set up your copy of CouchPotato. Go to the settings on the page and go through all the items and fill them in as necessary.
No that you have CouchPotato up and running you probably want to make sure that it starts up everytime you restart your machine. This is where the initd comes in.
cd /usr/local/sbin/couchpotato sudo cp initd /etc/init.d/couchpotato sudo chmod a+x /etc/init.d/couchpotato |
Now you need to update-rc.d so that it will be added to the System Startup
sudo update-rc.d couchpotato defaults |
Which will look like the following
$ sudo update-rc.d couchpotato defaults Adding system startup for /etc/init.d/couchpotato ... /etc/rc0.d/K20couchpotato -> ../init.d/couchpotato /etc/rc1.d/K20couchpotato -> ../init.d/couchpotato /etc/rc6.d/K20couchpotato -> ../init.d/couchpotato /etc/rc2.d/S20couchpotato -> ../init.d/couchpotato /etc/rc3.d/S20couchpotato -> ../init.d/couchpotato /etc/rc4.d/S20couchpotato -> ../init.d/couchpotato /etc/rc5.d/S20couchpotato -> ../init.d/couchpotato |
Finally to start the program without the re-booting your machine you will need to run the following
sudo /etc/init.d/couchpotato start |
Here are some additional notes from the readme.
- If you want, change “RUN_AS=root” to another user.
- If your CP installation isn’t in “/usr/local/sbin/couchpotato/”, make sure to change the path in the initd script.
- Make executable “sudo chmod a+x /etc/init.d/couchpotato”
- Start “sudo /etc/init.d/couchpotato start”
I just updated the post with the missing information that was needed for couchpotato to start on boot. I realized there was missing information after reading the xbmc forum.
Thanks!, nice guide!
I can’t get non root user eg. same as loggin on Ubuntu 10.10 to work.
Guide to How to install and run as non root user wanted.
Pleas help noobs
I’m not exactly sure what you mean. Can you not install as root user, or do you just not want to run it as a root user?
You could download the files from https://github.com/RuudBurger/CouchPotato if you can’t install git. From there you extract to any directory you want, and run “python CouchPotato.py -d” on it.
@michael
I’m having the same problem, want to run it as a different user from root but when i change the initd script it wont access the page or acknowledge its even started
@TheFincher
I believe that your problem is that your user probably doesn’t have permission to write logs and save to the config file. You should run the following command, assuming your username you want to run it as is ‘michael’ and you installed the program to /user/local/sbin/couchpotato.
This will let you that user have permissions to write to the logs, and save settings to the .ini file.
there’s more you can do if you want to run this as a user, so the downloaded files have the correct permissions when moving and renaming files, etc.
you should also consider moving from /usr/local/sbin to your home directory if you’re going to run it with user persmissions,i.e. 1. close up couchpotato by running sudo /etc/init.d/couchpotato stop2. move the files from the public folder to your home directory i.e. mv /usr/local/sbin/couchpotato /home/michael/.CouchPotato/ 3. change the permissions for all the logs and configs and files so you don’t have security/permissions problems, i.e. cd ~/.CouchPotato && sudo chown -R michael:michael *4. change the existing init.d script so it uses the new location, using gedit or nano, i.e. sudo gedit /etc/init.d/couchpotato so the home directory is /home/michael/.CouchPotato and user=michael , save and close the editor.5. umm, what else, oh yes. delete the .git folder inside ~/.CouchPotato using rm -r ~/.CouchPotato/.git/, so you can use the new auto-update script inside the latest couchpotato 6. start CouchPotato up again using sudo /etc/init.d/couchpotato start, you can see if it’s running if you open CouchPotato as normal via the browser, or by running ps -ax|grep python, you should see any python apps like sickbeard, SABnzbd, and Couchpotato running
Thanks for the great post. I wasn’t sure how to start it at boot, all working now 🙂
There is a step missing to allow startup of the daemon on boot:
Copy “default.ubuntu” to /etc/default/couchpotato
sudo cp default.ubuntu /etc/default/couchpotato
The file /etc/default/couchpotato then needs to be modified before starting with:
sudo /etc/init.d/couchpotato start