mirror of
https://github.com/cooperhammond/irs.git
synced 2025-01-02 19:15:26 +00:00
fix --url ignoring argument on song.cr
This commit is contained in:
parent
289f1d8c63
commit
bdc63b4c35
|
@ -50,9 +50,9 @@ class CLI
|
||||||
#{Style.blue "-s, --song <song>"} Specify song name to download
|
#{Style.blue "-s, --song <song>"} Specify song name to download
|
||||||
#{Style.blue "-A, --album <album>"} Specify the album name to download
|
#{Style.blue "-A, --album <album>"} Specify the album name to download
|
||||||
#{Style.blue "-p, --playlist <playlist>"} Specify the playlist name to download
|
#{Style.blue "-p, --playlist <playlist>"} Specify the playlist name to download
|
||||||
#{Style.blue "-u, --url [<url>]"} Specify the youtube url to download from
|
#{Style.blue "-u, --url <url>"} Specify the youtube url to download from
|
||||||
#{Style.blue " "} (for single songs, include as an command-line
|
#{Style.blue " "} (for albums and playlists, the command-line
|
||||||
#{Style.blue " "} argument, for albums or playlists do not)
|
#{Style.blue " "} argument is ignored, and it should be '')
|
||||||
#{Style.blue "-S, --select"} Use a menu to choose each song's video source
|
#{Style.blue "-S, --select"} Use a menu to choose each song's video source
|
||||||
|
|
||||||
#{Style.bold "Examples:"}
|
#{Style.bold "Examples:"}
|
||||||
|
|
|
@ -58,7 +58,7 @@ class Song
|
||||||
# Song.new("Bohemian Rhapsody", "Queen").grab_it
|
# Song.new("Bohemian Rhapsody", "Queen").grab_it
|
||||||
# ```
|
# ```
|
||||||
def grab_it(url : (String | Nil) = nil, flags = {} of String => String)
|
def grab_it(url : (String | Nil) = nil, flags = {} of String => String)
|
||||||
ask_url = flags["url"]?
|
passed_url : (String | Nil) = flags["url"]
|
||||||
select_link = flags["select"]?
|
select_link = flags["select"]?
|
||||||
|
|
||||||
outputter("intro", 0)
|
outputter("intro", 0)
|
||||||
|
@ -92,13 +92,17 @@ class Song
|
||||||
@artist_name = data["artists"][0]["name"].as_s
|
@artist_name = data["artists"][0]["name"].as_s
|
||||||
@filename = "#{Pattern.parse(Config.filename_pattern, data)}.mp3"
|
@filename = "#{Pattern.parse(Config.filename_pattern, data)}.mp3"
|
||||||
|
|
||||||
if ask_url
|
if passed_url
|
||||||
|
if passed_url.strip != ""
|
||||||
|
url = passed_url
|
||||||
|
else
|
||||||
outputter("url", 4)
|
outputter("url", 4)
|
||||||
url = gets
|
url = gets
|
||||||
if !url.nil? && url.strip == ""
|
if !url.nil? && url.strip == ""
|
||||||
url = nil
|
url = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if !url
|
if !url
|
||||||
outputter("url", 0)
|
outputter("url", 0)
|
||||||
|
|
Loading…
Reference in a new issue