#!/usr/bin/ruby1.8 if ARGV[0].nil? or ARGV[0].empty? then at_exit { puts "No link as parameter."} exit else link = ARGV[0] end if link =~ /http[s]?:\/\/www\.youtube\.com\/watch.+/i exec "smplayer \"#{link}\"" else exec "x-www-browser \"#{link}\"" end