diff --git a/config.all.ini b/config.all.ini deleted file mode 100644 index 259412b..0000000 --- a/config.all.ini +++ /dev/null @@ -1,62 +0,0 @@ -[main] -# uuid = -# cache_dir = -# servicename = NextPVR -# reponame = fHDHR_NextPVR - -[fhdhr] -# address = 0.0.0.0 -# discovery_address = 0.0.0.0 -# port = 5004 -# stream_type = direct -# tuner_count = 4 -# friendlyname = fHDHR-NextPVR -# reporting_firmware_name = fHDHR_NextPVR -# reporting_manufacturer = BoronDust -# reporting_model = fHDHR -# reporting_firmware_ver = 20201001 -# reporting_tuner_type = Antenna -# device_auth = fHDHR - -[epg] -# images = pass -# method = origin -# update_frequency = 43200 - -[ffmpeg] -# path = ffmpeg -# bytes_per_read = 1152000 - -[vlc] -# path = cvlc -# bytes_per_read = 1152000 - -[direct_stream] -# chunksize = 1048576 - -[logging] -# level = WARNING - -[database] -# type = sqlite -# driver = None - -[nextpvr] -# address = localhost -# port = 8866 -# ssl = -# pin = - -[zap2it] -# delay = 5 -# postalcode = None -# affiliate_id = gapzap -# country = USA -# device = - -# headendid = lineupId -# isoverride = True -# languagecode = en -# pref = -# timespan = 6 -# timezone = -# userid = - diff --git a/data/internal_config/fhdhr.json b/data/internal_config/fhdhr.json index 0319008..dad0ada 100644 --- a/data/internal_config/fhdhr.json +++ b/data/internal_config/fhdhr.json @@ -55,11 +55,6 @@ "config_file": true, "config_web": true }, - "stream_type":{ - "value": "direct", - "config_file": true, - "config_web": true - }, "tuner_count":{ "value": 4, "config_file": true, diff --git a/data/internal_config/streaming.json b/data/internal_config/streaming.json index f68edc0..83d83c6 100644 --- a/data/internal_config/streaming.json +++ b/data/internal_config/streaming.json @@ -9,6 +9,11 @@ "value": "none", "config_file": true, "config_web": true + }, + "method": { + "value": "direct", + "config_file": true, + "config_web": true } }, "ffmpeg":{ diff --git a/docs/ADV_Config.md b/docs/ADV_Config.md index 9461ece..fee001f 100644 --- a/docs/ADV_Config.md +++ b/docs/ADV_Config.md @@ -28,14 +28,28 @@ Here's the `main` section. # cache_dir = ```` +## streaming + +* `method` can be set to `ffmpeg`, `vlc` or `direct`. +* `bytes_per_read` determines how many bytes of the stream to read before sending the data to your client. Increasing this value may cause longer load times, and lowering it may effect `stuttering`. + + +```` +[streaming] +# method = direct +```` + + ## fhdhr The `fhdhr` contains all the configuration options for interfacing between this script and your media platform. * `address` and `port` are what we will allow the script to listen on. `0.0.0.0` is the default, and will respond to all. * `discovery_address` may be helpful for making SSDP work properly. If `address` is not `0.0.0.0`, we will use that. If this is not set to a real IP, we won't run SSDP. SSDP is only really helpful for discovering in Plex/Emby. It's a wasted resource since you can manually add the `ip:port` of the script to Plex. -* `tuner_count` is a limit of devices able to stream from the script. +* `tuner_count` is a limit of devices able to stream from the script. The default is 3, as per Locast's documentation. A 4th is possible, but is not reccomended. * `friendlyname` is to set the name that Plex sees the script as. -* `stream_type` can be set to `ffmpeg`, `vlc` or `direct`. +* `reporting_*` are settings that show how the script projects itself as a hardware device. +* `device_auth` and `require_auth` are for an unimplemented Authentication feature. +* `chanscan_on_start` Scans Origin for new channels at startup. ```` @@ -43,61 +57,56 @@ The `fhdhr` contains all the configuration options for interfacing between this # address = 0.0.0.0 # discovery_address = 0.0.0.0 # port = 5004 -# stream_type = direct # tuner_count = 4 -# friendlyname = fHDHR-NextPVR -# reporting_firmware_name = fHDHR_NextPVR +# friendlyname = fHDHR-Locast +# reporting_firmware_name = fHDHR_Locast # reporting_manufacturer = BoronDust # reporting_model = fHDHR # reporting_firmware_ver = 20201001 # reporting_tuner_type = Antenna # device_auth = fHDHR +# require_auth = False +# chanscan_on_start = True ```` # EPG * `images` can be set to `proxy` or `pass`. If you choose `proxy`, images will be reverse proxied through fHDHR. -* `method` defaults to `origin` and will pull the xmltv data from NextPVR. Other Options include `blocks` which is an hourly schedule with minimal channel information. Another option is `zap2it`, which is another source of EPG information. Channel Numbers may need to be manually mapped. -* `update_frequency` * `epg_update_frequency` determines how often we check for new scheduling information. In Seconds. +* `method` defaults to `origin` and will pull the xmltv data from Locast. Other Options include `blocks` which is an hourly schedule with minimal channel information. Another option is `zap2it`, which is another source of EPG information. Channel Numbers may need to be manually mapped. +* `update_frequency` determines how often we check for new scheduling information. In Seconds. +* `reverse_days` allows Blocks of EPG data to be created prior to the start of the EPG Source data. +* `forward_days` allows Blocks of EPG data to be created after the end of the EPG Source data. +* `block_size` in seconds, sets the default block size for data before, after and missing timeslots. +* `xmltv_offset` allows the final xmltv file to have an offset for users with timezone issues. ```` [epg] # images = pass # method = origin # update_frequency = 43200 +# reverse_days = -1 +# forward_days = 7 +# block_size = 1800 +# xmltv_offset = +0000 ```` ## ffmpeg The `ffmpeg` section includes: * `path` is useful if ffmpeg is not in your systems PATH, or you want to manually specify. -* `bytes_per_read` determines how many bytes of the stream to read before sending the data to your client. Increasing this value may cause longer load times, and lowering it may effect `stuttering`. ```` [ffmpeg] # path = ffmpeg -# bytes_per_read = 1152000 ```` ## vlc The `vlc` section includes: * `path` is useful if ffmpeg is not in your systems PATH, or you want to manually specify. -* `bytes_per_read` determines how many bytes of the stream to read before sending the data to your client. Increasing this value may cause longer load times, and lowering it may effect `stuttering`. ```` [vlc] -# path = ffmpeg -# bytes_per_read = 1152000 -```` - -## direct_stream - -The `direct_stream` section is for when you set the `[fhdhr]stream_type` to `direct` -* `chunksize` is how much data to read at a time. - -```` -[direct_stream] -# chunksize = 1024*1024 +# path = cvlc ```` # Logging @@ -117,6 +126,27 @@ TODO: improve documentation here. [database] # type = sqlite # driver = None +user = None +pass = None +host = None +port = None +name = None +```` + +## RMG + +```` +# enabled = True +```` + +## SSDP + +```` +# enabled = True +# max_age = 1800 +# proto = ipv6 +# iface = None +# multicast_address = None ```` ## NextPVR diff --git a/fHDHR/config/__init__.py b/fHDHR/config/__init__.py index 105ede3..5683537 100644 --- a/fHDHR/config/__init__.py +++ b/fHDHR/config/__init__.py @@ -103,7 +103,7 @@ class Config(): isdocker = is_docker() self.internal["versions"]["Docker"] = isdocker - if self.dict["fhdhr"]["stream_type"] == "ffmpeg": + if self.dict["streaming"]["method"] == "ffmpeg": try: ffmpeg_command = [self.dict["ffmpeg"]["path"], "-version", @@ -121,7 +121,7 @@ class Config(): print("Failed to find ffmpeg.") self.internal["versions"]["ffmpeg"] = ffmpeg_version - if self.dict["fhdhr"]["stream_type"] == "vlc": + if self.dict["streaming"]["method"] == "vlc": try: vlc_command = [self.dict["vlc"]["path"], "--version", @@ -310,7 +310,7 @@ class Config(): self.dict["database"]["path"] = pathlib.Path(cache_dir).joinpath('fhdhr.db') - if self.dict["fhdhr"]["stream_type"] not in ["direct", "ffmpeg", "vlc"]: + if self.dict["streaming"]["method"] not in ["direct", "ffmpeg", "vlc"]: raise fHDHR.exceptions.ConfigurationError("Invalid stream type. Exiting...") if not self.dict["fhdhr"]["discovery_address"] and self.dict["fhdhr"]["address"] != "0.0.0.0": diff --git a/fHDHR/device/channels/channel.py b/fHDHR/device/channels/channel.py index d9a66e2..debc7e8 100644 --- a/fHDHR/device/channels/channel.py +++ b/fHDHR/device/channels/channel.py @@ -190,7 +190,7 @@ class Channel(): @property def api_stream_url(self): - return '/api/tuners?method=%s&channel=%s' % (self.fhdhr.config.dict["fhdhr"]["stream_type"], self.number) + return '/api/tuners?method=%s&channel=%s' % (self.fhdhr.config.dict["streaming"]["method"], self.number) @property def m3u_url(self): diff --git a/fHDHR_web/api/tuners.py b/fHDHR_web/api/tuners.py index 24768c7..1dfdcb5 100644 --- a/fHDHR_web/api/tuners.py +++ b/fHDHR_web/api/tuners.py @@ -29,7 +29,7 @@ class Tuners(): accessed_url = request.args.get('accessed', default=request.url, type=str) - method = request.args.get('method', default=self.fhdhr.config.dict["fhdhr"]["stream_type"], type=str) + method = request.args.get('method', default=self.fhdhr.config.dict["streaming"]["method"], type=str) tuner_number = request.args.get('tuner', default=None, type=str) diff --git a/fHDHR_web/hdhr/auto.py b/fHDHR_web/hdhr/auto.py index 63e4664..26062aa 100644 --- a/fHDHR_web/hdhr/auto.py +++ b/fHDHR_web/hdhr/auto.py @@ -14,7 +14,7 @@ class Auto(): def get(self, channel, *args): - method = request.args.get('method', default=self.fhdhr.config.dict["fhdhr"]["stream_type"], type=str) + method = request.args.get('method', default=self.fhdhr.config.dict["streaming"]["method"], type=str) redirect_url = "/api/tuners?method=%s" % (method) diff --git a/fHDHR_web/hdhr/tuner.py b/fHDHR_web/hdhr/tuner.py index 072b79b..a4812ff 100644 --- a/fHDHR_web/hdhr/tuner.py +++ b/fHDHR_web/hdhr/tuner.py @@ -14,7 +14,7 @@ class Tuner(): def get(self, tuner_number, channel, *args): - method = request.args.get('method', default=self.fhdhr.config.dict["fhdhr"]["stream_type"], type=str) + method = request.args.get('method', default=self.fhdhr.config.dict["streaming"]["method"], type=str) redirect_url = "/api/tuners?method=%s" % (method) diff --git a/fHDHR_web/rmg/devices_devicekey_media.py b/fHDHR_web/rmg/devices_devicekey_media.py index 6cf7c7b..9e91ebe 100644 --- a/fHDHR_web/rmg/devices_devicekey_media.py +++ b/fHDHR_web/rmg/devices_devicekey_media.py @@ -18,7 +18,7 @@ class RMG_Devices_DeviceKey_Media(): param = request.args.get('method', default=None, type=str) self.fhdhr.logger.debug("param:%s" % param) - method = self.fhdhr.config.dict["fhdhr"]["stream_type"] + method = self.fhdhr.config.dict["streaming"]["method"] redirect_url = "/api/tuners?method=%s" % (method)