Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fetch-latest-widevine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ case `uname -m` in
ARCH="x64"
;;
esac
[[ -z ${ARCH} ]] && echo "Architecture not supported" 1>&2 && exit 1
[ -z ${ARCH} ] && echo "Architecture not supported" 1>&2 && exit 1

# Detect wget/curl
DLTOOL=""
which wget && DLTOOL="wget -O -"
which curl && DLTOOL="curl -L"
[[ -z ${DLTOOL} ]] && echo "No download tool found on this system" 1>&2 && exit 1
[ -z "${DLTOOL}" ] && echo "No download tool found on this system" 1>&2 && exit 1

# Begin download
VERSION=$(${DLTOOL} https://dl.google.com/widevine-cdm/versions.txt | tail -n1)
# Fix download argument for wget
DARG=${@}
[[ ${DLTOOL} == "wget -O -" ]] && DARG=`echo ${DARG} | sed 's/\-o /\-O /'` && DLTOOL="wget"
[ "${DLTOOL}" = "wget -O -" ] && DARG=`echo ${DARG} | sed 's/\-o /\-O /'` && DLTOOL="wget"
${DLTOOL} ${DARG} "https://dl.google.com/widevine-cdm/${VERSION}-linux-${ARCH}.zip"