A Crystal port of tvhProxy which is a program that translates the Tvheadend API to emulate a HDHomeRun API. This is particularly useful to connect Plex's DVR feature to Tvheadend.
Simplest way to get it running is to run it:
docker run -p 5004:5004 -e ANTENNAS_URL=http://192.168.0.2:5004 -e TVHEADEND_URL=http://user:pass@192.168.0.1:9981 thejf/antennas
Alternatively, you can set it with all the available environment variables:
docker create --name=antennas
-e ANTENNAS_URL=http://192.168.0.2:5004
-e TVHEADEND_URL=http://user:pass@192.168.0.1:9981
-e TVHEADEND_WEIGHT=300
-e TUNER_COUNT=6
-p 5004:5004
thejf/antennas
And then docker start antennas
Or, you can try by mounting a volume, set by yourself in path/to/config, that will need a config.yml to work. Example of a config.yml is available here, or below:
tvheadend_url: http://replace:me@x.x.x.x:9981
antennas_url: http://x.x.x.x:5004
tvheadend_weight: 300
tuner_count: 6
docker create --name=antennas -v <path/to/config>:/antennas/config -p 5004:5004 thejf/antennas
- Set up
config.yml
(see configuration instructions here) where you pointed the config volume (what you replaced<path/to/config>
with - Finally,
docker start antennas
- Create a directory to store antennas, i.e.
mkdir antennas
- Download a Linux release of antennas inside Antennas directory
- Untar Antennas
- Configure your server
- Run
./antennas
- Download a macOS release of antennas
- Extract from the zip
- Open your terminal and navigate to where Antennas was extracted
- Configure your server
- Run
./antennas
Because Crystal does not yet compile to Windows, and I haven't rewritten this once more in a language that does, to run an executable of this you need to setup Ubuntu on Windows and run it that way.
- (Setup Bash on Windows Subsystem for Linux)[https://msdn.microsoft.com/en-us/commandline/wsl/install_guide]
- Run
bash
in command prompt - Create a directory to store antennas, i.e.
mkdir antennas
- Download a Linux release of antennas inside Antennas directory
- Untar Antennas
- Configure your server
- Run
./antennas
Antennas can be configured either via the config.yml or environment variables. Environment variables take precedence over the config.yml.
Antennas will look for three values inside a config/config.yml
file. They are:
tvheadend_url
: This is the path to your Tvheadend setup, with username, password, and port. Plex doesn't likelocalhost
so it's best to find your own local IP and put this in if Tvheadend and Plex are running on the same network. For example:http://user:pass@192.168.0.1:9981
tvheadend_weight
: This is a subscripton weight. I have no idea what it's for to be honest.tuner_count
: This is for the number of tuners in Tvheadend.
If you want to set environment variables instead of modifying the config.yml, you can do so. The environment variable names are the same than the config.yml, except capitalized. So, TVHEADEND_URL
, TVHEADEND_WEIGHT
, and TUNER_COUNT
.
Docker instructions coming soon, along with Dockerfile, and the whole shebang.
- Install Crystal if you do not yet have it
- Run
shards install
- Run
crystal build ./src/antennas.cr
- Run
./antennas
In case you get these linking errors
/usr/bin/ld: cannot find -lz
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
please assure that you have libssl-dev
installed.
- Fork it ( https://github.com/thejf/antennas/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- TheJF Jean-Francois Arseneau - creator, maintainer