fHDHR_IPTVorg-US/docs/Usage.md
deathbybandaid 8a798bcc05 test
2020-12-09 08:13:42 -05:00

130 lines
4.9 KiB
Markdown

<p align="center">fHDHR <img src="images/logo.ico" alt="Logo"/></p>
---
[Main](README.md) | [Setup and Usage](Usage.md) | [iptvorg-us](Origin.md) | [Credits/Related Projects](Related-Projects.md)
---
**f**un
**H**ome
**D**istribution
**H**iatus
**R**ecreation
---
[Basic Configuration](Config.md) | [Advanced Configuration](ADV_Config.md) | [WebUI](WebUI.md)
---
# Author Notes
* All Testing is currently done in Proxmox LXC, Ubuntu 20.04, Python 3.8
# Prerequisites
* A Linux or Mac "Server". Windows currently does not work. A "Server" is a computer that is typically always online.
* Python 3.7 or later.
* Consult [This Page](Origin.md) for additional setup specific to this variant of fHDHR.
# Optional Prerequisites
* If you intend to use Docker, [This Guide](https://docs.docker.com/get-started/) should help you get started. The author of fHDHR is not a docker user, but will still try to help.
fHDHR uses direct connections with video sources by default. Alternatively, you can install and update the [config](Config.md) accordingly. You will need to make these available to your systems PATH, or manually set their path via the config file.
* ffmpeg
* vlc
# Installation
## Linux
* Download the zip, or git clone
* Navigate into your script directory and run `pip3 install -r requirements.txt`
* Copy the included `config.example.ini` file to a known location. The script will not run without this. There is no default configuration file location. [Modify the configuration file to suit your needs.](Config.md)
* Run with `python3 main.py -c=` and the path to the config file.
## Docker
This portion of the guide assumes you are using a Linux system with both docker and docker-compose installed. This (or some variation thereof) may work on Mac or Windows, but has not been tested.
* this guide assumes we wish to use the `~/fhdhr` directory for our install (you can use whatever directory you like, just make the appropriate changes elsewhere in this guide) and that we are installing for iptvorg-us support
* run the following commands to clone the repo into `~/fhdhr/fHDHR_IPTVorg-US`
```
cd ~/fhdhr
git clone https://github.com/fHDHR/fHDHR_IPTVorg-US.git
```
* create your config.ini file (as described earlier in this guide) in the `~/fhdhr/fHDHR_IPTVorg-US` directory
* while still in the `~/fhdhr` directory, create the following `docker-compose.yml` file
```
version: '3'
services:
iptvorg-us:
build: ./fHDHR_IPTVorg-US
container_name: iptvorg-us
network_mode: host
volumes:
- ./fHDHR_IPTVorg-US/config.ini:/app/config/config.ini
```
* run the following command to build and launch the container
```
docker-compose up --build -d iptvorg-us
```
After a short period of time (during which docker will build your new fHDHR container), you should now have a working build of fHDHR running inside a docker container.
As the code changes and new versions / bug fixes are released, at any point you can pull the latest version of the code and rebuild your container with the following commands:
```
cd ~/fhdhr/fHDHR_IPTVorg-US
git checkout master
git pull
cd ~/fhdhr
docker-compose up --build -d iptvorg-us
```
<hr />
You can also run multiple instances of fHDHR to support additional sources by cloning the appropriate repo into your `~/fhdhr` directory and adding the necessary services to the docker-compose file we created above.
* for example, if we also wanted iptvorg-us support, you would clone the iptvorg-us repository:
```
cd ~/fhdhr
git clone https://github.com/fHDHR/fHDHR_IPTVorg-US.git
```
* **NOTE**: if you are running multiple services on the same machine, you must change the port in your config.ini file for each one. For example, if iptvorg-us was using the default port of 5004, iptvorg-us cannot also use that port. You must change the port in your iptvorg-us config.ini file to something else (5005, for example).
* add iptvorg-us as a service in your `docker-compose.yml` file
```
version: '3'
services:
iptvorg-us:
build: ./fHDHR_IPTVorg-US
container_name: iptvorg-us
network_mode: host
volumes:
- ./fHDHR_IPTVorg-US/config.ini:/app/config/config.ini
iptvorg-us:
build: ./fHDHR_IPTVorg-US
container_name: iptvorg-us
network_mode: host
volumes:
- ./fHDHR_IPTVorg-US/config.ini:/app/config/config.ini
```
* run the following command to build and launch the container
```
docker-compose up --build -d iptvorg-us
```
You can repeat these instructions for as many fHDHR containers as your system resources will allow.
# Setup
Now that you have fHDHR running, You can navigate (in a web browser) to the IP:Port from the configuration step above.
If you did not setup a `discovery_address` in your config, SSDP will be disabled. This is not a problem as clients like Plex can have the IP:Port entered manually!
You can copy the xmltv link from the webUI and use that in your client software to provide Channel Guide information.