I regularly open HTTP URLs and play them directly in VLC media player, using the "Open Network..." option. Unfortunately, the URLs are behind HTTP basic authentication (they require a username and password) and VLC media player doesn't have a way to remember the credentials. Basically, it's a pain to type the password each time.
I'm on Mac OS X, so I tried to use Automator to create a text-based Service that runs a shell script like this:
user=USERNAME
pass=PASSWORD
if [[ "${f}" =~ \:\/\/ ]]; then
/Applications/VLC.app/Contents/MacOS/VLC -f \
$(echo $f | sed "s/\:\/\//\:\/\/$user\:$pass\@/")
fi
but when I right click on a link (browser agnostic), from what I can tell, it sends the service the display text, not the actual URL.
My other thought was just to create a Chrome extension with only a context menu item, but after googling around a bit, it seems Chrome can't run arbitrary shell scripts (probably for good reason).
How can I make it work?
*Like a way to get VLC media player to remember the password, but it doesn't use the Mac OS X keychain...