Posted on 05-29-2017 12:43 PM
I've been using a script posted by @abaumgarner to install the most recent version of VLC that can be found here which has been working great for me until recently.
The variable that looks for the current version started returning ../ instead of the current version number. I made a couple of small changes to get the proper version number in case anyone else has run into the same issue.
Here's the line from the original script:
#!/bin/sh
vlc_version=`/usr/bin/curl --silent http://mirror.wdc1.us.leaseweb.net/videolan/vlc/last/macosx/ | grep vlc- | cut -d " -f 2 | awk '{printf("%s",$0); exit}' | cut -d . -f 1-3`
Which had to be modified to:
#!/bin/sh
vlc_version=`/usr/bin/curl --silent http://mirror.wdc1.us.leaseweb.net/videolan/vlc/last/macosx/ | grep vlc- | cut -d " -f 2 | awk '{printf("%s",$0);}' | cut -d . -f 1-6 | cut -c4-15`
Posted on 05-29-2017 02:19 PM
Here's the script I use/created
#!/bin/bash
mkdir /tmp/downloads
cd /tmp/downloads
# Installing VLC Player
CurrentVLC=$(curl "http://get.videolan.org/vlc/last/macosx/" | grep .dmg | grep -v webplugin | grep -v md5 | grep -v sha1 | grep -v sha256 | awk '{print $2}' | awk -F ">" '{print $2}' | tr -d "</a")
curl -L -o vlc.dmg http://get.videolan.org/vlc/last/macosx/$CurrentVLC
hdiutil mount -nobrowse vlc.dmg -mountpoint /Volumes/vlc
rsync -vaz /Volumes/vlc/VLC.app/ /Applications/VLC.app
hdiutil unmount "/Volumes/vlc"
rm vlc.dmg
rm -rf /tmp/downloads
#Inspired from GetMacApps.com
It didn't need to be changed, so it MAY survive future changes. Also, I'm sure there's a way to do things than continuing to pipe those commands together.
Posted on 08-31-2018 01:20 PM
There's an additional file format available - asc. So the CurrentVLC line needs to be updated like this...
curl "http://get.videolan.org/vlc/last/macosx/" | grep .dmg | grep -v webplugin | grep -v md5 | grep -v sha1 | grep -v sha256 | grep -v asc | awk '{print $2}' | awk -F ">" '{print $2}' | tr -d "</a"