You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
604 B
27 lines
604 B
#!/usr/bin/ruby
|
|
|
|
if ARGV[0].nil? or ARGV[0].empty? or ARGV[1].nil? or ARGV[1].empty? then
|
|
$stderr.puts "Missing parameter(s). 2 parameters expected, " + ARGV.length.to_s + " was given."
|
|
exit 127
|
|
end
|
|
|
|
link = "#{ARGV[0]}"
|
|
player = "#{ARGV[1]}"
|
|
|
|
if link =~ /http:\/\/.*\.apcdn\.com\/.+\.webm/i
|
|
|
|
fork {
|
|
exec("#{player} -no-close-at-end -actions \"repeat false\" \"#{link}\"")
|
|
}
|
|
exit 0
|
|
elsif link =~ /http[s]?:\/\/apina\.biz\/(.+)\.webm/i
|
|
|
|
link = "http://termite.apcdn.com/full/#{$1}.webm"
|
|
fork {
|
|
exec("#{player} -no-close-at-end -actions \"repeat false\" \"#{link}\"")
|
|
}
|
|
exit 0
|
|
else
|
|
exit 1
|
|
end
|