From cbbb2f77861dfa4f7f42da844bf853f06ee58658 Mon Sep 17 00:00:00 2001 From: taylorbourne Date: Mon, 1 Nov 2021 14:51:39 -0700 Subject: [PATCH 1/2] fix: fix plex update request (#70) * run raw plex curl request * update sample env file * parse raw chrome curl req * update cronjob * use post request to update plex * oops --- root/cronjob.sh | 2 +- sample.env | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/root/cronjob.sh b/root/cronjob.sh index 947ae39..cace7b1 100755 --- a/root/cronjob.sh +++ b/root/cronjob.sh @@ -107,7 +107,7 @@ if [ "$use_plexAPI" = "yes" ]; then if [ -z "$plexUpdateURL" ]; then echo "no Plex credentials provided" else - curl -s -X POST "$plexUpdateURL" + curl --location --request POST "$plexUpdateURL" sleep 1 fi fi diff --git a/sample.env b/sample.env index 6301658..f0e78e0 100644 --- a/sample.env +++ b/sample.env @@ -41,7 +41,8 @@ YamlList="CBLguide.yaml SATguide.yaml SATSport.yaml" ### Emby # Only necessary if xTeVe API is active # API Key, https://github.com/MediaBrowser/Emby/wiki/Api-Key-Authentication -# embyID, settings, scroll down click API, Scheduled Task Service, GET /ScheduledTasks, Try, Execute, look for "Refresh Guide" ID, sample here 9492d30c70f7f1bec3757c9d0a4feb45 +# embyID, settings, scroll down click API, Scheduled Task Service, GET /ScheduledTasks, Try, Execute, +# look for "Refresh Guide" ID, sample here 9492d30c70f7f1bec3757c9d0a4feb45 use_embyAPI=no embyIP= embyPORT=8096 @@ -51,10 +52,10 @@ embyID= ### Plex # Only necessary if xTeVe API is active # To find your Plex Update URL navigate to your plex server in chrome (eg, 192.168.1.1:32400/web/), -# and open chrome developer tools (press F12). Once developer tools is open find and click the "Refresh -# Guide" link in Plex and then look at the developer tools window. The first request listed should start -# with "reloadGuide?". Right click the line and go to copy -> Copy link address. Paste the result below as -# plexUpdateURL. +# and open chrome developer tools (press F12). Once developer tools is open, press (Ctrl/Cmd)+Shift+P, +# type "network" and press enter. Then, find and click the "Refresh Guide" link in Plex. Over in the +# developer tools window/pane, the first request listed should start with "reloadGuide?". Right click +# the line and go to copy -> Copy link address. Paste the result below as plexUpdateURL. use_plexAPI=no plexUpdateURL= From 1e6334d7bd55698cea6a8e257edc8465057919b7 Mon Sep 17 00:00:00 2001 From: taylorbourne Date: Wed, 3 Nov 2021 17:03:49 -0700 Subject: [PATCH 2/2] feat: make lazy stream host name configurable (#72) * run raw plex curl request * update sample env file * parse raw chrome curl req * update cronjob * use post request to update plex * oops * feat: make lazystream host configurable * feat: update xml template * fix: revert plex update changes for now (needs more testing) * feat: update readme --- README.md | 4 ++++ root/etc/cont-init.d/50-update-hosts | 2 +- xteve_lazystream.xml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5fc26c9..0eca016 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,10 @@ or see [docker-compose.yml](docker-compose.yml) for an example docker-compose se Defaults & behavior can be changed through environment variables. `sample.env` should be renamed to `.env` and supplied through the `--env-file` docker run option. The `.env` file can also be picked up if using this in a `docker compose` setup. +### IMPORTANT + +You _MUST_ set the environment variable `lazyStreamHost` otherwise LazyStream will _not_ work. + ## Cron schedule By default, the cron job is scheduled to run every hour. A custom cron schedule can be specified by renaming the `sample_cron.txt` file in the `/config` volume to `cron.txt` and editing the schedule. Make sure to restart your container to take effect. diff --git a/root/etc/cont-init.d/50-update-hosts b/root/etc/cont-init.d/50-update-hosts index 9919717..8615ae4 100644 --- a/root/etc/cont-init.d/50-update-hosts +++ b/root/etc/cont-init.d/50-update-hosts @@ -10,7 +10,7 @@ exec 1> >(prepend "[update-hosts] ") # Update hosts file -export IP=$(getent ahostsv4 freesports.ddns.net | awk '{ print $1 }' | head -1) +export IP=$(getent ahostsv4 "$lazyStreamHost" | awk '{ print $1 }' | head -1) echo $IP playback.svcs.mlb.com >> /etc/hosts echo $IP mf.svc.nhl.com >> /etc/hosts diff --git a/xteve_lazystream.xml b/xteve_lazystream.xml index 1b5e4c8..a3ecabf 100644 --- a/xteve_lazystream.xml +++ b/xteve_lazystream.xml @@ -172,6 +172,7 @@ /mnt/user/appdata/xteve/playlists/ yes yes + yes yes yes