reset git history

This commit is contained in:
Noah Masur
2020-06-03 08:31:58 -06:00
commit a368fda34d
37 changed files with 8031 additions and 0 deletions

25
bin/youtube Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env ruby
require "uri"
module Clipboard
class << self
def paste
`pbpaste`.chomp
end
end
end
def parse_params(url)
url.query.split("&").each_with_object({}) do |param, acc|
key, value = *param.split("=", 2)
acc[key] = value
end
end
url = URI.parse Clipboard.paste
params = parse_params url
id = params.fetch("v") { raise "Probably not a youtube URL" }
clean_url = "https://www.youtube.com/watch?v=#{id}"
system "(cd ~/Downloads && youtube-dl -f best \"#{clean_url}\")"