mirror of
https://github.com/cooperhammond/irs.git
synced 2024-12-22 17:35:28 +00:00
Merge pull request #58 from cooperhammond/crystal-port
Updated to v1.0.0
This commit is contained in:
commit
a24703d7bf
0
.editorconfig
Normal file → Executable file
0
.editorconfig
Normal file → Executable file
6
.gitignore
vendored
Normal file → Executable file
6
.gitignore
vendored
Normal file → Executable file
|
@ -4,4 +4,8 @@
|
|||
/.shards/
|
||||
*.dwarf
|
||||
|
||||
*.mp3
|
||||
*.mp3
|
||||
.ripper.log
|
||||
ffmpeg
|
||||
ffprobe
|
||||
youtube-dl
|
0
.travis.yml
Normal file → Executable file
0
.travis.yml
Normal file → Executable file
10
README.md
Normal file → Executable file
10
README.md
Normal file → Executable file
|
@ -2,13 +2,19 @@
|
|||
|
||||
TODO: Write a description here
|
||||
|
||||
## Usage
|
||||
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/G783tKA.png" height="450" />
|
||||
</p>
|
||||
|
||||
TODO: Write usage instructions here
|
||||
|
||||
## Installation
|
||||
|
||||
TODO: Write installation instructions here
|
||||
|
||||
## Usage
|
||||
|
||||
TODO: Write usage instructions here
|
||||
|
||||
## Development
|
||||
|
||||
|
|
2
shard.lock
Normal file → Executable file
2
shard.lock
Normal file → Executable file
|
@ -2,5 +2,5 @@ version: 1.0
|
|||
shards:
|
||||
ydl_binaries:
|
||||
github: cooperhammond/ydl-binaries
|
||||
commit: 8a622bf9d2c0b848db8d8db2f46f09334a1f03f8
|
||||
commit: 3108c8ce9456bbde24baba64b2372b431a010558
|
||||
|
||||
|
|
4
shard.yml
Normal file → Executable file
4
shard.yml
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
name: irs
|
||||
version: 0.1.0
|
||||
version: 1.0.0
|
||||
|
||||
authors:
|
||||
- Cooper Hammond <kepoorh@gmail.com>
|
||||
|
@ -8,8 +8,6 @@ targets:
|
|||
irs:
|
||||
main: src/irs.cr
|
||||
|
||||
crystal: 0.28.0
|
||||
|
||||
license: MIT
|
||||
|
||||
dependencies:
|
||||
|
|
0
spec/irs_spec.cr
Normal file → Executable file
0
spec/irs_spec.cr
Normal file → Executable file
0
spec/spec_helper.cr
Normal file → Executable file
0
spec/spec_helper.cr
Normal file → Executable file
21
src/bottle/cli.cr
Normal file → Executable file
21
src/bottle/cli.cr
Normal file → Executable file
|
@ -1,5 +1,8 @@
|
|||
require "./version"
|
||||
require "ydl_binaries"
|
||||
|
||||
require "./config"
|
||||
require "./styles"
|
||||
require "./version"
|
||||
|
||||
require "../glue/song"
|
||||
|
||||
|
@ -11,6 +14,7 @@ class CLI
|
|||
@options = [
|
||||
[["-h", "--help"], "help", "bool"],
|
||||
[["-v", "--version"], "version", "bool"],
|
||||
[["-i", "--install"], "install", "bool"],
|
||||
[["-s", "--song"], "song", "string"],
|
||||
[["-a", "--artist"], "artist", "string"]
|
||||
]
|
||||
|
@ -28,22 +32,23 @@ class CLI
|
|||
|
||||
def help
|
||||
msg = <<-EOP
|
||||
#{Style.bold "Usage: irs [-h] [-v] [-s <song> -a <artist>]"}
|
||||
#{Style.bold "Usage: irs [-h] [-v] [-i] [-s <song> -a <artist>]"}
|
||||
|
||||
Arguments:
|
||||
#{Style.bold "Arguments:"}
|
||||
#{Style.blue "-h, --help"} Show this help message and exit
|
||||
#{Style.blue "-v, --version"} Show the program version and exit
|
||||
#{Style.blue "-i, --install"} Download ffmpeg and youtube_dl binaries to #{Style.green Config.binary_location}
|
||||
#{Style.blue "-s, --song <song>"} Specify song name for downloading
|
||||
#{Style.blue "-a, --artist <artist>"} Specify artist name for downloading
|
||||
|
||||
Examples:
|
||||
#{Style.bold "Examples:"}
|
||||
$ #{Style.green %(irs --song "Bohemian Rhapsody" --artist "Queen")}
|
||||
#{Style.dim %(# => downloads the song "Bohemian Rhapsody" by "Queen")}
|
||||
$ #{Style.green %(irs --album "Demon Days" --artist "Gorillaz")}
|
||||
#{Style.dim %(# => downloads the album "Demon Days" by "Gorillaz")}
|
||||
|
||||
This project is licensed under the GNU GPL.
|
||||
Project page: <github.com/cooperhammond/irs>
|
||||
#{Style.bold "This project is licensed under the MIT license."}
|
||||
#{Style.bold "Project page: <github.com/cooperhammond/irs>"}
|
||||
EOP
|
||||
|
||||
puts msg
|
||||
|
@ -56,10 +61,14 @@ class CLI
|
|||
elsif @args["version"]?
|
||||
version
|
||||
exit
|
||||
elsif @args["install"]?
|
||||
YdlBinaries.get_both(Config.binary_location)
|
||||
exit
|
||||
elsif @args["song"]? && @args["artist"]?
|
||||
s = Song.new(@args["song"], @args["artist"])
|
||||
s.provide_client_keys("e4198f6a3f7b48029366f22528b5dc66", "ba057d0621a5496bbb64edccf758bde5")
|
||||
s.grab_it()
|
||||
exit
|
||||
end
|
||||
end
|
||||
|
||||
|
|
9
src/bottle/config.cr
Normal file → Executable file
9
src/bottle/config.cr
Normal file → Executable file
|
@ -0,0 +1,9 @@
|
|||
module Config
|
||||
|
||||
extend self
|
||||
|
||||
def binary_location : String
|
||||
path = "~/.irs/bin"
|
||||
return Path[path].expand(home: true).to_s
|
||||
end
|
||||
end
|
0
src/bottle/styles.cr
Normal file → Executable file
0
src/bottle/styles.cr
Normal file → Executable file
0
src/bottle/version.cr
Normal file → Executable file
0
src/bottle/version.cr
Normal file → Executable file
2
src/glue/album.cr
Normal file → Executable file
2
src/glue/album.cr
Normal file → Executable file
|
@ -21,5 +21,3 @@ class Album < SpotifyList
|
|||
# pass
|
||||
end
|
||||
end
|
||||
|
||||
puts Album.new("A Night At The Opera", "Queen").find_it()
|
0
src/glue/list.cr
Normal file → Executable file
0
src/glue/list.cr
Normal file → Executable file
0
src/glue/song.cr
Normal file → Executable file
0
src/glue/song.cr
Normal file → Executable file
0
src/interact/logger.cr
Normal file → Executable file
0
src/interact/logger.cr
Normal file → Executable file
3
src/interact/ripper.cr
Normal file → Executable file
3
src/interact/ripper.cr
Normal file → Executable file
|
@ -1,10 +1,11 @@
|
|||
require "./logger"
|
||||
require "../bottle/config"
|
||||
|
||||
module Ripper
|
||||
|
||||
extend self
|
||||
|
||||
BIN_LOC = Path["~/.irs/bin".sub("~", Path.home)]
|
||||
BIN_LOC = Path[Config.binary_location]
|
||||
|
||||
# Downloads the video from the given *video_url* using the youtube-dl binary
|
||||
# Will create any directories that don't exist specified in *output_filename*
|
||||
|
|
0
src/interact/tagger.cr
Normal file → Executable file
0
src/interact/tagger.cr
Normal file → Executable file
0
src/irs.cr
Normal file → Executable file
0
src/irs.cr
Normal file → Executable file
22
src/search/spotify.cr
Normal file → Executable file
22
src/search/spotify.cr
Normal file → Executable file
|
@ -217,14 +217,14 @@ class SpotifySearcher
|
|||
end
|
||||
|
||||
|
||||
puts SpotifySearcher.new()
|
||||
.authorize("e4198f6a3f7b48029366f22528b5dc66",
|
||||
"ba057d0621a5496bbb64edccf758bde5")
|
||||
.find_item("playlist", {
|
||||
"name" => "Brain Food",
|
||||
"username" => "spotify"
|
||||
# "name " => "A Night At The Opera",
|
||||
# "artist" => "Queen"
|
||||
# "track" => "Bohemian Rhapsody",
|
||||
# "artist" => "Queen"
|
||||
})
|
||||
# puts SpotifySearcher.new()
|
||||
# .authorize("e4198f6a3f7b48029366f22528b5dc66",
|
||||
# "ba057d0621a5496bbb64edccf758bde5")
|
||||
# .find_item("playlist", {
|
||||
# "name" => "Brain Food",
|
||||
# "username" => "spotify"
|
||||
# # "name " => "A Night At The Opera",
|
||||
# # "artist" => "Queen"
|
||||
# # "track" => "Bohemian Rhapsody",
|
||||
# # "artist" => "Queen"
|
||||
# })
|
0
src/search/youtube.cr
Normal file → Executable file
0
src/search/youtube.cr
Normal file → Executable file
Loading…
Reference in a new issue