Update/Install VLC

jason_d
New Contributor III

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`
2 REPLIES 2

boberito
Valued Contributor

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.

cwaldrip
Valued Contributor

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"