mirror of
https://github.com/cooperhammond/irs.git
synced 2025-01-17 21:17:07 +00:00
logging for individual song done!
This commit is contained in:
parent
80cb034ce1
commit
8cfb59a368
|
@ -58,26 +58,29 @@ class Song
|
||||||
"Check your input and try again.")
|
"Check your input and try again.")
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "Downloading video ..."
|
puts "Downloading video:"
|
||||||
Ripper.download_mp3(url.as(String), filename)
|
Ripper.download_mp3(url.as(String), filename)
|
||||||
|
|
||||||
# temp_albumart_filename = ".tempalbumart.jpg"
|
temp_albumart_filename = ".tempalbumart.jpg"
|
||||||
# HTTP::Client.get(data["album"]["images"][0]["url"].to_s) do |response|
|
HTTP::Client.get(data["album"]["images"][0]["url"].to_s) do |response|
|
||||||
# File.write(temp_albumart_filename, response.body_io)
|
File.write(temp_albumart_filename, response.body_io)
|
||||||
# end
|
end
|
||||||
|
|
||||||
# tagger = Tags.new(filename)
|
tagger = Tags.new(filename)
|
||||||
# tagger.add_album_art(temp_albumart_filename)
|
tagger.add_album_art(temp_albumart_filename)
|
||||||
# tagger.add_text_tag("title", data["name"].to_s)
|
tagger.add_text_tag("title", data["name"].to_s)
|
||||||
# tagger.add_text_tag("artist", data["artists"][0]["name"].to_s)
|
tagger.add_text_tag("artist", data["artists"][0]["name"].to_s)
|
||||||
# tagger.add_text_tag("album", data["album"]["name"].to_s)
|
tagger.add_text_tag("album", data["album"]["name"].to_s)
|
||||||
# tagger.add_text_tag("genre",
|
tagger.add_text_tag("genre",
|
||||||
# @spotify_searcher.find_genre(data["artists"][0]["id"].to_s))
|
@spotify_searcher.find_genre(data["artists"][0]["id"].to_s))
|
||||||
# tagger.add_text_tag("track", data["track_number"].to_s)
|
tagger.add_text_tag("track", data["track_number"].to_s)
|
||||||
# tagger.add_text_tag("disc", data["disc_number"].to_s)
|
tagger.add_text_tag("disc", data["disc_number"].to_s)
|
||||||
|
|
||||||
# tagger.save()
|
puts "Tagging metadata ..."
|
||||||
# File.delete(temp_albumart_filename)
|
tagger.save()
|
||||||
|
File.delete(temp_albumart_filename)
|
||||||
|
|
||||||
|
puts %("#{data["name"].to_s}" by "#{data["artists"][0]["name"].to_s}" downloaded.)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,12 @@ module Ripper
|
||||||
print "\e[1A"
|
print "\e[1A"
|
||||||
print "\e[0K\r"
|
print "\e[0K\r"
|
||||||
end
|
end
|
||||||
puts line
|
puts line.sub("[download]", " ")
|
||||||
@dl_status_index += 1
|
@dl_status_index += 1
|
||||||
|
|
||||||
|
if line.includes? "100%"
|
||||||
|
puts "Converting to mp3 ..."
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,10 @@ class Tags
|
||||||
def save : Nil
|
def save : Nil
|
||||||
@query_args.push(%("_#{@filename}"))
|
@query_args.push(%("_#{@filename}"))
|
||||||
command = @BIN_LOC.to_s + "/ffmpeg " + @query_args.join(" ")
|
command = @BIN_LOC.to_s + "/ffmpeg " + @query_args.join(" ")
|
||||||
system(command)
|
|
||||||
|
|
||||||
|
l = Logger.new(command, ".tagger.log")
|
||||||
|
l.start { |line, start| }
|
||||||
|
|
||||||
File.delete(@filename)
|
File.delete(@filename)
|
||||||
File.rename("_" + @filename, @filename)
|
File.rename("_" + @filename, @filename)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue