mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-07-16 02:02:58 -07:00
commit
cadd613388
1 changed files with 8 additions and 1 deletions
|
@ -302,6 +302,11 @@ if [ "${KEEP}" != "yes" -o ! -f /tmp/kaka ] && [ "${PUBLIC}" == "no" ]; then
|
||||||
cat /tmp/failcause >&2
|
cat /tmp/failcause >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If the system got here, it means the login was successfull, so we set the TOKEN variable to the authToken from the response
|
||||||
|
# I use cut -c 14- to cut off the "authToken":" string from the grepped result, can probably be done in a different way
|
||||||
|
TOKEN=$(</tmp/failcause grep -ioe '"authToken":"[^"]*' | cut -c 14-)
|
||||||
|
|
||||||
# Remove this, since it contains more information than we should leave hanging around
|
# Remove this, since it contains more information than we should leave hanging around
|
||||||
rm /tmp/failcause
|
rm /tmp/failcause
|
||||||
|
|
||||||
|
@ -341,7 +346,9 @@ if [ "${CRON}" = "no" ]; then
|
||||||
echo -n "Finding download URL to download..."
|
echo -n "Finding download URL to download..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DOWNLOAD=$(wget --load-cookies /tmp/kaka --save-cookies /tmp/kaka --keep-session-cookies "${URL_DOWNLOAD}" -O - 2>/dev/null | grep -ioe '"label"[^}]*' | grep -i "\"distro\":\"${DISTRO}\"" | grep -i "\"build\":\"${BUILD}\"" | grep -m1 -ioe 'https://[^\"]*' )
|
# Set "X-Plex-Token" to the auth token, if no token is specified or it is invalid, the list will return public downloads by default
|
||||||
|
DOWNLOAD=$(wget --header "X-Plex-Token:"${TOKEN}"" --load-cookies /tmp/kaka --save-cookies /tmp/kaka --keep-session-cookies "${URL_DOWNLOAD}" -O - 2>/dev/null | grep -ioe '"label"[^}]*' | grep -i "\"distro\":\"${DISTRO}\"" | grep -i "\"build\":\"${BUILD}\"" | grep -m1 -ioe 'https://[^\"]*' )
|
||||||
|
|
||||||
if [ "${CRON}" = "no" ]; then
|
if [ "${CRON}" = "no" ]; then
|
||||||
echo -e "OK"
|
echo -e "OK"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue