Help to setup tvhproxy please

Status
Not open for further replies.

ancstorer

Cadet
Joined
Sep 2, 2018
Messages
8
I have a HP microserver gen8 running 9.10.2 - u6

I am a relative noob but have managed to follow guides to successfully setup Plex, Sickrage, transmission and couchpotato.

I have started following a guide to get IPTV through Plex and have made it as far as getting tvheadend working but am having trouble with tvhproxy. Does anyone have an idiots guide to setting it up please?

Thanks
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
I'm not sure it will work on 9.10 as some packages are broken for warden jails. If you upgrade to 11.1 and use iocage jails this will work.
Inside the jail run these commands to install the script:

Code:
pkg install -y git python py27-pip nano

git clone https://github.com/jkaberg/tvhProxy.git

cd /root/tvhProxy && pip install -r requirements.txt


Lets edit the script settings:

Code:
nano /root/tvhProxy/tvhProxy.py


The bind address is the jails IP,
the tvhURL is the ip of the tvheadend server with login credentials,
tvhProxyURL is the ip of the tvheadend server. Once edited the lines should look like this (with your ip's ofcourse):

'bindAddr': os.environ.get('TVH_BINDADDR') or '192.168.1.36',
'tvhURL': os.environ.get('TVH_URL') or 'http://user:password@192.168.1.15:9981',
'tvhProxyURL': os.environ.get('TVH_PROXY_URL') or 'http://192.168.1.15'

Exit it out of the editor and run the script with

Code:
python tvhProxy.py


Go on plex and add the ip manually with the port so jailIP:5004.
Click connect, even if a picture doesn't show up, the continue button will be enabled, that means it works. Cancel out of the plex setup now that you know it works.
Back in the jail lets hit ctrl + c to stop the script.
To get it running on reboot do this

Code:
setenv VISUAL /usr/local/bin/nano
setenv EDITOR /usr/local/bin/nano


Edit the crontab:

Code:
crontab -e


Paste this in and save it:

Code:
@reboot python /root/tvhProxy/tvhProxy.py &


Restart the jail and go on plex to set it up.
Note: After adding it the first time on plex, the tuner will say Not found on plex, dont worry it works. After you restart plex once the message will go away.
 
Last edited:

ancstorer

Cadet
Joined
Sep 2, 2018
Messages
8
It got as far as the cd line. it told me that there is no such file or directory. is there any other path it could be?
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
Yes ofcourse, where did you run the git clone command from ? The folder "tvhProxy" will be wherever you ran that command from, if you just log into the jail you will be in /root, thats why I used that location but its arbitrary.
 

ancstorer

Cadet
Joined
Sep 2, 2018
Messages
8
it's ok, solved it now, just removed the word root from the line as I was already in as root. Cheers
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
ctrl + o to save, it will ask (at the bottom) to confirm file name, press enter.
ctrl + x to close
 

ancstorer

Cadet
Joined
Sep 2, 2018
Messages
8
yeah thats fine. those commands won't work in the shell on chrome, did it in putty eventually.

Moved on to the next step and now getting this:

root@tvhproxy:/ # python tvhProxy.py
python: can't open file 'tvhProxy.py': [Errno 2] No such file or directory
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
You are not in the directory of the file. Use the 'ls' command to see the files in the directory you are in.
 

ancstorer

Cadet
Joined
Sep 2, 2018
Messages
8
upload_2018-9-6_18-13-36.png
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
Ok so the you see the folder tvhProxy in your picture? 'cd tvhProxy' to go into the folder and then run the python command.
If you didnt know where the .py script was how did you edit it o_O ?
Also I would recommend watching a YouTube video on USING shell in a unix / linux environment, the basics are important because then you can understand what the commands actually do and you can adapt them to YOUR setup. You almost have it, just keep trying..
 
Last edited:

ancstorer

Cadet
Joined
Sep 2, 2018
Messages
8
thanks for all your help. Got it up and running. just took some tweaking to the file names.

Only thing that doesn't work is the restart script. Any ideas?
 

Nick_ND

Cadet
Joined
Sep 6, 2018
Messages
2
I'm having a problem with my jails IP and tvheadend server IP being the same IP
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
Try this, The path is wrong so change it to where your script file is, I believe you have it in /
@Reboot python /tvhProxy/tvhProxy.py &
 
Status
Not open for further replies.
Top