Skip to content

Installation

rocky4546 edited this page Jun 4, 2021 · 10 revisions

Unix:

NOTE: You do not have to have a subscription, but need to be in an area locast provides service. Just create the free account at locast.org and enter the data in the config.ini as indicated below:

  1. Grab the source zip file for the release at https://github.com/rocky4546/tvheadend-locast/releases
  2. Unzip it in a folder of your choosing
  3. Take the config_example.ini at the location ./lib/tvheadend/ and place it in the top level folder renamed to config.ini (Note, the config file can be located either at the top level or in the data folder to keep data in one place.)
  4. Edit the config.ini and and update the username and password lines with the login you created at locast.org.
  5. Before creating a service, try starting the app from the command line. It should run as a normal user. Type "python3 tvh_main.py" from the top level folder. (Note, most Linux system have python linked to python 2 and not python 3.)
  6. Start a browser on your network and hit the URL http://[IP]:6077/ That should bring up the website for the app.
  7. Click on XML/JSON Links
  8. This brings up the list of URLs available. If you have something like VLC installed, then clicking on the /playlist link should launch VLC with the list of channels you can play. You should be able to just click on one of the channels in VLC to get it to play.
  9. To make a service, go to ./lib/tvheadend/service/Unix/ Read the top of the locast.service file and follow the instructions. (Note, this file has been tested on Ubuntu OS.)

Once you have tested the installation, it is time to integrate it into tvheadend.

Windows

Download the windows installer in the release area. The installer can run as either a normal user or an administrator. Installing into the Program Files area and adding a service is only available using administration mode. The app has been upgraded and no longer requires ffmpeg to run. As part of the installation, the ffmpeg install can be skipped. Once installed, the service will be installed into the Windows OS, but not running. Go into Windows Services and find TVHeadend-Locast service to start it. (Note, during installation, you can set where the data files are located. This is to help with permission issues in the Program Files area.)

Docker

If you use "use_encryption", then you may need to reset the encrypted passwords each time you rebuild the docker image. See below for alternative solutions.

  1. Setup a data folder to hold the config.ini and all temporary files the app needs. This data file can be at the top level of the install or anywhere on your system. We will create a volume in docker for that folder to hold dynamic data.
  2. Create the config.ini file in the data folder with the base information. Either use the lib/tvheadend/config_example.ini file or use the minimum values below.
    [locast]
    locast_username = [your locast username (email)]
    locast_password = [your locast password]

    [locast_default]
    label = Locast Default
  1. Build the docker image with the command, where the tag to use can be 'tvh0.8.0-alpha01'
    • sudo docker build . -f Dockerfile_tvh_crypt.alpine -t [tag to use]
  2. Run cmd 'sudo docker image ls' and confirm the REPOSITORY lists the tag
  3. Launch the Docker container with the following command. 6077:6077 causes the port to be available from other computers. An example of the location of the data directory is '/usr/local/tvheadend-locast/data'
    • sudo docker run -p 6077:6077 -v [location of data directory on server]:/app/data --rm [tag used earlier]
  4. If you have 'use_encryption' = True, add an additional volume to have the home folder mounted. If you use sudo, then the root home folder should be mounted. The command would change to:
    • sudo docker run -p 6077:6077 -v [location of data directory on server]:/app/data -v/root:/root --rm [tag used earlier]
    1. If the program exits with 'Config file missing', check the path used with the -v option
    2. If encryption is used and fails, it is usually associated with the private key not being found. The error says 'Unable to decrypt password'
    3. If the password fails, an entry in the config.ini file 'login_invalid' will appear. To retry, remove this line.
  5. Check that the process is running
    • sudo docker ps

Other Useful Docker commands

  1. docker ps (list of running containers)
  2. docker exec -ti [containerid] bash (shell into a running container)
  3. docker restart|stop [containerid] (stop and start a running container)
  4. docker image ls (list of available images to run)
  5. docker image rm [tag or id] (remove an image from local storage)
  6. docker network ls (list of network connections)
  7. docker container ls (list of running containers. Same as docker ps)
  8. docker volumes ls (list of volumes)
  9. docker volumes create [vol tag] (create an empty volume)
  10. docker volumes rm [vol tag] (remove a volume)
Clone this wiki locally