Skip to content

Commit

Permalink
fix: attemping to fix plex update again (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorbourne authored Nov 30, 2021
1 parent 190cc66 commit 7d7ef67
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions root/cronjob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ sleep 1
if [ "$use_xTeveAPI" = "yes" ]; then
echo "Updating xTeVe..."
curl -s -X POST -d '{"cmd":"update.m3u"}' http://127.0.0.1:$XTEVE_PORT/api/
# sleep 1
curl -s -X POST -d '{"cmd":"update.xmltv"}' http://$127.0.0.1:$XTEVE_PORT/api/
sleep 1
curl -s -X POST -d '{"cmd":"update.xmltv"}' http://127.0.0.1:$XTEVE_PORT/api/
sleep 1
curl -s -X POST -d '{"cmd":"update.xepg"}' http://127.0.0.1:$XTEVE_PORT/api/
sleep 1
curl -s -X POST -d '{"cmd":"update.xepg"}' http://$127.0.0.1:$XTEVE_PORT/api/
sleep 30
fi

# update Emby via API
Expand All @@ -108,11 +108,19 @@ fi

# update Plex via API
if [ "$use_plexAPI" = "yes" ]; then

# get protocol
proto="$(echo $plexUpdateURL | grep :// | sed -e's,^\(.*://\).*,\1,g')"
# remove the protocol
url="$(echo ${plexUpdateURL/$proto/})"
# extract the host
plexHostPort="$(echo ${url/} | cut -d/ -f1)"

echo "Updating Plex..."
if [ -z "$plexUpdateURL" ]; then
echo "no Plex credentials provided"
else
curl -s -X POST "$plexUpdateURL"
curl --location --request POST "$plexUpdateURL" -H "authority: $plexHostPort" -H "content-length: 0" -H "pragma: no-cache" -H "cache-control: no-cache" -H "sec-ch-ua: 'Google Chrome';v='95', 'Chromium';v='95', ';Not A Brand';v='99'" -H "accept: text/plain, */*; q=0.01" -H "x-requested-with: XMLHttpRequest" -H "accept-language: en" -H "sec-ch-ua-mobile: ?0" -H "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36" -H "sec-ch-ua-platform: 'macOS'" -H "origin: http://$plexHostPort" -H "sec-fetch-site: same-origin" -H "sec-fetch-mode: cors" -H "sec-fetch-dest: empty" -H "referer: http://$plexHostPort/web/index.html"
sleep 1
fi
fi
Expand Down

0 comments on commit 7d7ef67

Please sign in to comment.