DaddyLive, PlutoTV, XUMO, M3U/XMLTV, SamsungTV, Plex, TVGuide interfaces (appliance)
Added by G Kazaroth almost 4 years ago
Cabernet for (Cable Network) version 0.9.12 (4/13/2023)
TVGuide, DaddyLive, PlutoTV, XUMO, M3U/XMLTV, SamsungTV, Plex¶
Provides a configurable interface from providers to TVHeadend.
- Direct streaming plugins for DaddyLive, PlutoTV, XUMO
- EPG supplemented using TVGuide.com data
- M3U Plugin provides channels for: SamsungTVPlus, Plex, PBS, Stirr, and others
- From: https://i.mjh.nz/
- Import your own M3U file
https://github.com/cabernetwork/cabernet/releases
Purpose is to get a service that will take the DaddyLive, PlutoTV or XUMO server stream, clean it and feed it into TVHeadend and other DVRs (Also tested on Emby, JellyFin and Plex). Also it runs on Linux, Windows as a service and Docker. Windows has a installer. Once installed, setup is easy with TVHeadend. Also includes a TVGuide.com plugin to obtain TVGuide data.
1) Setup the automatic IPTV network (recommend new URL is http://[host]:6077/PlutoTV/channels.m3u)
Make sure to set the "Maximum # input streams". PlutoTV is set to a max of 4 and tvheadend uses 2 per tuner during initial screening. Doing a force scan will create the mux and service values. Also, turn View level to Advanced and set the Re-fetch period (mins) to a very large number. TVheadend has a tenancy to cause issues when channels change (Changed Services will not be mapped to channels). The Maximum Timeout is used to wait for a reply during a Forced scan. Recommend keep this low, like 15-20 seconds. Some of the channels may fail, but it is faster than having a high setting and waiting for all channels to scan. Just individually rescan those that failed by setting each mux back to PEND from IDLE.
2) Next you can setup the grabber. I use a URL grabber written in Unix bash and is an extremely small file. It can be found in the github repo at
https://github.com/cabernetwork/cabernet/tree/master/lib/tvheadend/service/Unix called tv_grab_url
Place the grabber file in the same location as the other TVHeadend tv_grab* files, change the permissions to executable and restart TVHeadend. This should allow TVHeadend to pickup the new grabber. While in the grabber list, make sure and disable any OTA grabbers. Stations no longer send this information and will only cause TVHeadend to use a tuner for scanning. Displaying the log window by clicking the three ^ in the bottom right is helpful at this time.
Have the grabber run and populate the EPG data into the EPG Grabber Channels tab. The log should show a quantity of channels were detected.
Pop over to the EPG Grabber tab and disable the OTA grabber cron. Also, update/replace the Internal grabber cron schedule using something like below. The example will pull the TV guide at 6:04am and 5:52pm. Add more if you need. It is recommended to use static cron times.
4 6 * * * 52 17 * * *
3) In the Channel view, select Map all channels.
This will tie the services, EPG and channels together, automatically. After this, re-grab the EPG data. This will populate the EPG tab with shows. For TVH version 4.3, the Number column will auto-populate. For TVH 4.2, you will need to manually add channel numbers.
4) Display the TVGUIDE. This appliance has special features which maps the tvheadend genre, giving colors on tvguides. It also has enhanced guide descriptions and optional additional channel notations if you use many streams. Below is the Kodi tvguide using the pvr.hts plugin.
For Kodi, go to the settings for PVR and turn on the General setting "Use channel numbers from backend".
Replies (960)
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
When I entered the telnet command at the box I got:
CoreELEC:~ # telnet localhost 6077
telnet: can't connect to remote host (127.0.0.1): Connection refused
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by G Kazaroth about 3 years ago
ok, its not up... Edit the config.ini file. Change the level to DEBUG and restart cabernet. It should have more info.
[handler_loghandler]
level = DEBUG
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
Something is happening. This is what my config.ini looked like before I changed the level to debug:
[plutotv_default]
label = PlutoTV Instance
[loggers]
keys = root
[logger_root]
level = DEBUG
handlers = loghandler
[handlers]
keys = loghandler, filehandler
[formatters]
keys = extend,simple
[handler_filehandler]
enabled = False
level = INFO
formatter = extend
class = lib.common.log_handlers.MPRotatingFileHandler
args = (os.getenv('LOGS_DIR','data/logs')+'/cabernet.log', 'a', 10000000, 10)
[handler_loghandler]
enabled = True
level = WARNING
class = StreamHandler
formatter = extend
args = (sys.stdout,)
[formatter_extend]
format = s-(levelname)s:%(module)s %(message)s
[formatter_simple]
format = s:(module)s %(message)s
[main]
uuid = 18E127B7-3DB8-11EC-B85B-D05F64D13909
[hdhomerun]
hdhr_id = 105B10E9
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by G Kazaroth about 3 years ago
looks perfect. Just change the line requested and restart Cabernet
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
Below is what I got when I did the python3 tvh_main.py command:
CoreELEC:~ # cd tvheadend-locast
CoreELEC:~/tvheadend-locast # python3 tvh_main.py
2021-11-04 17:14:38,779-INFO:user_config Loading Configuration File: /storage/tv headend-locast/data/config.ini
2021-11-04 17:14:39,113-WARNING:main #########################################
2021-11-04 17:14:39,114-WARNING:main MIT License, Copyright (C) 2021 ROCKY4546
2021-11-04 17:14:39,114-NOTICE:main Cabernet v0.9.6.0-RC08
2021-11-04 17:14:39,116-INFO:main Getting Plugins...
2021-11-04 17:14:39,118-DEBUG:plugin_handler Plugin Defn file loaded
2021-11-04 17:14:39,123-DEBUG:plugin Plugin Config Defn file loaded at plugins.p rovider_video_xumo
2021-11-04 17:14:39,181-DEBUG:db config_defn database closed for thread:54831137 0160
2021-11-04 17:14:39,181-DEBUG:config_defn Database terminated for thread:5483113 70160
2021-11-04 17:14:39,189-DEBUG:plugin Plugin Manifest file loaded at plugins.prov ider_video_xumo
2021-11-04 17:14:39,207-INFO:plugin No instances found, disabling plugin XUMO
2021-11-04 17:14:39,207-NOTICE:plugin Plugin created for XUMO
2021-11-04 17:14:39,209-DEBUG:plugin Plugin Config Defn file loaded at plugins.p rovider_video_plutotv
2021-11-04 17:14:39,252-DEBUG:db config_defn database closed for thread:54831137 0160
2021-11-04 17:14:39,253-DEBUG:config_defn Database terminated for thread:5483113 70160
2021-11-04 17:14:39,263-DEBUG:plugin Plugin Manifest file loaded at plugins.prov ider_video_plutotv
2021-11-04 17:14:39,313-NOTICE:plugin Plugin created for PlutoTV
2021-11-04 17:14:39,315-DEBUG:plugin Plugin Config Defn file loaded at plugins.p rovider_video_ustvgo
2021-11-04 17:14:39,360-DEBUG:db config_defn database closed for thread:54831137 0160
2021-11-04 17:14:39,361-DEBUG:config_defn Database terminated for thread:5483113 70160
2021-11-04 17:14:39,370-DEBUG:plugin Plugin Manifest file loaded at plugins.prov ider_video_ustvgo
2021-11-04 17:14:39,388-INFO:plugin No instances found, disabling plugin USTVGO
2021-11-04 17:14:39,389-NOTICE:plugin Plugin created for USTVGO
2021-11-04 17:14:39,390-DEBUG:plugin Plugin Config Defn file loaded at plugins.p rovider_video_m3u
2021-11-04 17:14:39,434-DEBUG:db config_defn database closed for thread:54831137 0160
2021-11-04 17:14:39,435-DEBUG:config_defn Database terminated for thread:5483113 70160
2021-11-04 17:14:39,443-DEBUG:plugin Plugin Manifest file loaded at plugins.prov ider_video_m3u
2021-11-04 17:14:39,459-INFO:plugin No instances found, disabling plugin M3U
2021-11-04 17:14:39,459-NOTICE:plugin Plugin created for M3U
2021-11-04 17:14:39,461-INFO:plugin_handler Plugin XUMO is disabled in config.in i
2021-11-04 17:14:39,479-DEBUG:plugin_obj Initializing plugin PlutoTV
2021-11-04 17:14:39,481-INFO:plugin_handler Plugin USTVGO is disabled in config. ini
2021-11-04 17:14:39,482-INFO:plugin_handler Plugin M3U is disabled in config.ini
2021-11-04 17:14:39,511-NOTICE:main Starting admin website on 192.168.1.83:6077
2021-11-04 17:14:39,524-DEBUG:decorators Registering GET URL: /api/data_mgmt
2021-11-04 17:14:39,525-DEBUG:decorators Registering GET URL: /background
2021-11-04 17:14:39,526-DEBUG:decorators Registering GET URL: /api/index.js
2021-11-04 17:14:39,526-DEBUG:decorators Registering GET URL: /html/index.html
2021-11-04 17:14:39,527-DEBUG:decorators Registering GET URL: /
2021-11-04 17:14:39,527-DEBUG:decorators Registering GET URL: /favicon.ico
2021-11-04 17:14:39,527-DEBUG:decorators Registering GET URL: /api/dashstatus.js on
2021-11-04 17:14:39,528-DEBUG:decorators Registering GET URL: /xmltv.xml
2021-11-04 17:14:39,528-DEBUG:decorators Registering GET URL: /playlist
2021-11-04 17:14:39,529-DEBUG:decorators Registering GET URL: /channels.m3u
2021-11-04 17:14:39,529-DEBUG:decorators Registering GET URL: /lineup.xml
2021-11-04 17:14:39,529-DEBUG:decorators Registering GET URL: /lineup.json
2021-11-04 17:14:39,529-DEBUG:decorators Registering GET URL: /api/channels
2021-11-04 17:14:39,530-DEBUG:decorators Registering GET URL: /api/channels_form
2021-11-04 17:14:39,530-DEBUG:decorators Registering GET URL: /discover.json
2021-11-04 17:14:39,530-DEBUG:decorators Registering GET URL: /device.xml
2021-11-04 17:14:39,531-DEBUG:decorators Registering GET URL: /lineup_status.jso n
2021-11-04 17:14:39,531-DEBUG:decorators Registering GET URL: /api/configform
2021-11-04 17:14:39,531-DEBUG:decorators Registering GET URL: /tunerstatus
2021-11-04 17:14:39,532-DEBUG:decorators Registering GET URL: /api/upgrade
2021-11-04 17:14:39,532-DEBUG:decorators Registering GET URL: /api/schedulehtml
2021-11-04 17:14:39,533-DEBUG:decorators Registering GET URL: /api/scheduler
2021-11-04 17:14:39,533-DEBUG:decorators Registering GET URL: /config.json
2021-11-04 17:14:39,533-DEBUG:decorators Registering GET URL: /api/restart
2021-11-04 17:14:39,534-DEBUG:decorators Registering POST URL: /api/data_mgmt
2021-11-04 17:14:39,534-DEBUG:decorators Registering POST URL: /api/channels_for m
2021-11-04 17:14:39,535-DEBUG:decorators Registering POST URL: /lineup.post
2021-11-04 17:14:39,535-DEBUG:decorators Registering POST URL: /api/configform
2021-11-04 17:14:39,535-DEBUG:decorators Registering POST URL: /api/schedulehtml
2021-11-04 17:14:39,536-DEBUG:decorators Registering GET URL: /html/
2021-11-04 17:14:39,536-DEBUG:decorators Registering GET URL: /images/
2021-11-04 17:14:39,537-DEBUG:decorators Registering GET URL: /modules/
2021-11-04 17:14:39,537-DEBUG:decorators Registering GET URL: /temp/
2021-11-04 17:14:39,537-DEBUG:web_handler Now listening for requests. Number of listeners=8
2021-11-04 17:14:39,616-NOTICE:main Starting streaming tuner website on 192.168. 1.83:5004
2021-11-04 17:14:39,624-DEBUG:web_tuner TunerHttpHandler Implementing 3 tuners f or XUMO
2021-11-04 17:14:39,626-DEBUG:web_tuner TunerHttpHandler Implementing 3 tuners f or PlutoTV
2021-11-04 17:14:39,626-DEBUG:web_tuner TunerHttpHandler Implementing 4 tuners f or USTVGO
2021-11-04 17:14:39,627-DEBUG:web_tuner TunerHttpHandler Implementing 3 tuners f or M3U
2021-11-04 17:14:39,644-DEBUG:web_handler Now listening for requests. Number of listeners=13
2021-11-04 17:14:39,753-NOTICE:scheduler Running inline task Channels:Refresh Pl utoTV Channels
2021-11-04 17:14:39,755-DEBUG:plugin_instance_obj PlutoTV:default Plugin instanc e disabled, not refreshing Channels
2021-11-04 17:14:39,837-NOTICE:main Cabernet is now online.
2021-11-04 17:14:39,967-NOTICE:scheduler Running threaded task Applications:Chec k for Updates
2021-11-04 17:14:39,980-NOTICE:scheduler Running threaded task EPG:Refresh Pluto TV EPG
2021-11-04 17:14:39,985-DEBUG:plugin_instance_obj PlutoTV:default Plugin instanc e disabled, not refreshing EPG
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
Well, Cabernet came up this time when I did the 6077 command.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by G Kazaroth about 3 years ago
I was going to say, the log looks perfect. Would have no clue why it had an issue. Next step is to enable Pluto.
For the instance, we recommend enable URL Filter if you want to remove most ads. Also, enable XMLTV if not enabled. Then restart cabernet to initialize the plugin. (NOTE: you can restart the app from the Scheduled Tasks menu item under Applications.)
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by C Island about 3 years ago
I remember back about 5 months ago you wrote a CoreELEC autostart.sh script that automatically started tvheadend-locast 10 seconds after CoreELEC starts up. I wonder if that script is now starting cabernet plus you are also trying to manually start cabernet via the command line and the two invocations are conflicting (ie you are effectively starting two instances of cabernet). Here is the message you sent after you got tvheadend-locast to autostart:
Sterling Rorden wrote:
G Kazaroth wrote:
0.8.6b has the updated script written in Bourne Shell. Give it a try and let me know.
That appears to have worked! No errors and a list of updated channels when I forced a re-run of the internal grabbers.
Also, for any CoreELEC user that comes across this thread in the future, the following autostart.sh script seems to work when put in the /storage/.config folder (I unzipped cabernet to a folder called tvheadend-locast in storage):
#!/bin/sh
(
sleep 10
python3 /storage/tvheadend-locast/tvh_main.py
) &
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
OK, next challenge.
I did the setup of Pluto TV IPTV Automatic Network and tried to do a force scan. But nothing happened.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by G Kazaroth about 3 years ago
Did you restart cabernet after enabling the plugin and instance? Try the URL you put into TVH and see what you get as a response in your browser.
What URL did you provide?
If you go to the Channel Editor and click on the PlutoTV tab, do you get channels?
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
I did restart Cabernet. If I try the URL in my browser I get a option to save the file.
But I discovered another problem. If I close my PuTTY window I can no longer reach Cabernet on 6077. I think I had this problem previously but I don't remember how I fixed it.
I'll try some more things tomorrow, thanks for your help!
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by G Kazaroth about 3 years ago
When you close the putty window and cabernet ends means you are still running cabernet from the window and not as a service.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
For some reason my autostart.sh no longer starts Cabernet when my system is rebooted and when I issue the command "python3 /storage/tvheadend-locast/tvh_main.py" from the PuTTY window Cabernet only stays running as long as the window remains open.
I did install the full Python3 package (I believe) and updated pip to get the cryptography working so perhaps I broke some dependencies.
Any suggestions to get Cabernet running as a service?
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by G Kazaroth about 3 years ago
The objective would be to get output to tell you what the issue is... To do this, you need to change the script to output to a file. Try this:
#!/bin/sh ( sleep 10 python3 /storage/tvheadend-locast/tvh_main.py ) 2>&1 > /storage/tvheadend-locast/out.log
Also, make sure the script is executable, otherwise, no log file will be generated.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by C Island about 3 years ago
If you run this command in putty on your CoreELEC system it will show you the status of your autostart.sh script
systemctl status kodi-autostart.service -l --no-pager
For example, on mine it shows that my autostart script ran successfully
CoreELEC:~/.config # systemctl status kodi-autostart.service -l --no-pager ● kodi-autostart.service - Kodi user autostart script Loaded: loaded (/usr/lib/systemd/system/kodi-autostart.service; disabled; vendor preset: disabled) Active: active (exited) since Fri 2021-11-05 10:24:40 PDT; 4min 20s ago Process: 4841 ExecStart=/bin/sh -c . /etc/profile; exec /bin/sh /storage/.config/autostart.sh (code=exited, status=0/SUCCESS) Main PID: 4841 (code=exited, status=0/SUCCESS) Nov 05 10:24:30 CoreELEC systemd[1]: Starting Kodi user autostart script... Nov 05 10:24:40 CoreELEC systemd[1]: Finished Kodi user autostart script.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
Below is what I get when I issue the "systemctl status kodi-autostart.service -l --no-pager" command:
CoreELEC:~/.config # systemctl status kodi-autostart.service -l --no-pager
● kodi-autostart.service - Kodi user autostart script
Loaded: loaded (/usr/lib/systemd/system/kodi-autostart.service; disabled; v endor preset: disabled)
Active: active (exited) since Fri 2021-11-05 07:05:55 PDT; 8h ago
Process: 5186 ExecStart=/bin/sh -c . /etc/profile; exec /bin/sh /storage/.co nfig/autostart.sh (code=exited, status=0/SUCCESS)
Main PID: 5186 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 1735)
Memory: 2.6M
CGroup: /system.slice/kodi-autostart.service
Nov 05 07:06:07 CoreELEC sh5264: Traceback (most recent call last):
Nov 05 07:06:07 CoreELEC sh5264: File "/storage/tvheadend-locast/tvh_main.py ", line 10, in <module>
Nov 05 07:06:07 CoreELEC sh5264: from lib import main
Nov 05 07:06:07 CoreELEC sh5264: File "/storage/tvheadend-locast/lib/main.py ", line 29, in <module>
Nov 05 07:06:07 CoreELEC sh5264: import lib.clients.web_tuner as web_tuner
Nov 05 07:06:07 CoreELEC sh5264: File "/storage/tvheadend-locast/lib/clients /web_tuner.py", line 34, in <module>
Nov 05 07:06:07 CoreELEC sh5264: from lib.streams.internal_proxy import In ternalProxy
Nov 05 07:06:07 CoreELEC sh5264: File "/storage/tvheadend-locast/lib/streams /internal_proxy.py", line 30, in <module>
Nov 05 07:06:07 CoreELEC sh5264: from cryptography.hazmat.primitives.ciphe rs import Cipher, algorithms, modes
Nov 05 07:06:07 CoreELEC sh5264: ModuleNotFoundError: No module named 'cryptog raphy'
So it looks like it can't find the cryptography module. But when I issue the "pip list" command I get:
CoreELEC:~/.config # pip list
Package Version
------------ -------
cffi 1.15.0
cryptography 35.0.0
pip 21.3.1
pycparser 2.20
setuptools 56.0.0
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
I put the command "2>&1 > /storage/tvheadend-locast/out.log" in the autostart.sh file and rebooted.
The out.log file was created but there is nothing in it.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by C Island about 3 years ago
- you need to cd to the tvheadend-locast directory in your autostart.sh like you do when you run it from putty
- you may need to set your PATH or PYTHONPATH in autostart.sh
1) Add the following to your autostart.sh after your 'sleep 10' command but before your python3 command
cd /storage/tvheadend-locast
2) if the cd command does not help then you may have a PATH or PYTHONPATH environment variable problem. Run the following commands from a putty session and post the results here so we can see where you installed cryptography and the values of PATH and PYTHONPATH
pip show cryptography set
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
CoreELEC:~ # pip show cryptography
Name: cryptography
Version: 35.0.0
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
Author: The Python Cryptographic Authority and individual contributors
Author-email: [email protected]
License: BSD or Apache License, Version 2.0
Location: /storage/.opt/lib/python3.9/site-packages
Requires: cffi
Required-by:
CoreELEC:~ # set
CHECK_OPT_PATH='0'
EDITOR='nano'
HISTFILE='/storage/.ash_history'
HISTFILESIZE='200'
HOME='/storage'
HOSTNAME='CoreELEC'
IFS='
'
LANG='en_US.UTF-8'
LC_ALL='en_US.UTF-8'
LD_LIBRARY_PATH=':/storage/.kodi/addons/script.module.certifi/lib:/storage/.kodi/addons/script.module.chardet/lib:/storage/.kodi/addons/script.module.dateutil/lib:/storage/.kodi/addons/script.module.dropbox/lib:/storage/.kodi/addons/script.module.future/lib:/storage/.kodi/addons/script.module.idna/lib:/storage/.kodi/addons/script.module.inputstreamhelper/lib:/storage/.kodi/addons/script.module.pyqrcode/lib:/storage/.kodi/addons/script.module.pytz/lib:/storage/.kodi/addons/script.module.requests/lib:/storage/.kodi/addons/script.module.routing/lib:/storage/.kodi/addons/script.module.simplecache/lib:/storage/.kodi/addons/script.module.six/lib:/storage/.kodi/addons/script.module.tzlocal/lib:/storage/.kodi/addons/script.module.urllib3/lib:/storage/.kodi/addons/script.module.xbmcswift2/lib:/storage/.kodi/addons/service.system.docker/lib:/usr/lib/pulseaudio'
LINENO=''
LOCPATH='/storage/.cache/locpath'
LOGNAME='root'
MAIL='/var/mail/root'
OPTIND='1'
PATH='/opt/bin:/opt/sbin:/usr/bin:/usr/sbin:/storage/.kodi/addons/docker.linuxserver.portainer/bin:/storage/.kodi/addons/docker.linuxserver.updater/bin:/storage/.kodi/addons/script.module.zap2epg/bin:/storage/.kodi/addons/service.system.docker/bin:/storage/.kodi/addons/service.tvheadend42/bin'
PPID='5706'
PS1='\[\e[1;32m\]\h\[\e[1;32m\]:\[\e[1;34m\]\w \[\e[0m\]\$ '
PS2='> '
PS4='+ '
PWD='/storage'
SHELL='/bin/sh'
SHLVL='1'
SSH_CLIENT='192.168.1.74 62078 22'
SSH_CONNECTION='192.168.1.74 62078 192.168.1.83 22'
SSH_TTY='/dev/pts/0'
SYSTEMD_COLORS='0'
TEMP='/opt/tmp'
TERM='xterm'
TERMINFO='/opt/share/terminfo'
TMP='/opt/tmp'
USER='root'
_='cryptography'
addon='/usr/lib/kodi/addons/*/lib'
arg='systemd.show_status=auto'
config='/etc/profile.d/99-pulseaudio.conf'
Cabernet ran OK with the current autostart.sh before I updated Cabernet and Python; and and I've run "python3 /storage/tvheadend-locast/tvh_main.py" from putty and Cabernet still stops when I close the window so I don't think that is the problem. But I'll give it a try.
Edit: I added the CD command but still have same results.
Edit #2: I notice:
USER='root'
_='cryptography'
Perhaps I put it in the wrong place. I did get a warning about recommending to install from a virtual environment but didn't understand it.
At this point I wouldn't mind uninstalling my current Python3 and installing the whole Python3 package from scratch. But I don't want to hose my CoreELEC installation by removing something I shouldn't.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by C Island about 3 years ago
It definitely looks like something is not set correctly in your autostart.sh that is properly set when you have an open putty session. One of the two options below might help.
I don't know if the is the best way to fix this but give this a try for now. Add the following to your autostart.sh after the 'sleep 10' command
export PYTHONPATH='/storage/.opt/lib/python3.9/site-packages'
Another thing you could try is setting your PATH variable to match what you have in putty (again this would go into autostart.sh after 'sleep 10')
export PATH='/opt/bin:/opt/sbin:/usr/bin:/usr/sbin:/storage/.kodi/addons/docker.linuxserver.portainer/bin:/storage/.kodi/addons/docker.linuxserver.updater/bin:/storage/.kodi/addons/script.module.zap2epg/bin:/storage/.kodi/addons/service.system.docker/bin:/storage/.kodi/addons/service.tvheadend42/bin'
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by Sterling Rorden about 3 years ago
Thanks, I'll give this a try tomorrow. Keep in mind that even when I run Cabernet from PuTTY there are still problems. I don't get any results when I do a forced scan of Pluto TV. And Cabernet worked correctly with Locast before I updated Cabernet and tried to update Python3 to include cryptography.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by C Island about 3 years ago
ok.
I suggest you try the setting the PATH first in autostart.sh and if that doesn't work ALSO set PYTHONPATH in autostart.sh. (My messages orginally suggested trying PYTHONPATH first and PATH second).
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by G Kazaroth about 3 years ago
Thanks for all the work. I have a few comments. First, python modules are by default stored in a user's home area (although you can request it be added to the main python library area during the pip install). If the service runs as a different user, that could be why the service does not pick up the module. Second, most of the environment variables in a service are not set, so using absolute paths are normally required, as well as, setting library paths. Looks like Island is on the right track, so will let you two keep going...
I released 0.9.6.2 to help with the cryptography module not found. This version will try to install the module if not found for the user running the script. If it is not looking in the normal places, this might fix the module issue.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by C Island about 3 years ago
- The CoreELEC builtin version of python3 which is /usr/bin/python3 and does not include cryptography
- His self installed version of python3 which is /opt/bin/python3 and includes cryptography
CoreELEC sets up the PATH variable for terminal sessions (e.g. putty sessions) so that an unqualified call to python3 invokes the one with cryptography.
However for non terminal/putty sessions an unqualified call to python3 will invoke the builtin python3 which does not have cryptography. This includes autostart.sh
This is easy to fix by adding 'source /opt/etc/profile' to autostart.sh
The following autostart.sh will update the PATH variable prior to running python3 and thus should invoke the python3 with cryptography.
To be doubly sure I explicity qualified python3 to call the one you installed that includes cryptography
#!/bin/sh ( sleep 10 . /opt/etc/profile cd /storage/tvheadend-locast /opt/bin/python3 /storage/tvheadend-locast/tvh_main.py ) 2>&1 > /storage/tvheadend-locast/out.log &
Give this a try. This is cleaner and you should not have to manually mess with PATH or PYTHONPATH like I previously suggested.
RE: PlutoTV, USTVGO, XUMO, M3U/XMLTV, SamsungTV, Plex interfaces (appliance) - Added by G Kazaroth about 3 years ago
I am an old bourne shell guy, so forgive me if I git this wrong in today's shells. The source command was used with CSH and TCSH while bourne shell used the ". ./.profile" dot type command to execute profiles.