audio_addict 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 426a2b37a0f6f0d2f7a0bc151aeb481630ea6c2449065e1d154e87d39af3af36
4
- data.tar.gz: 42ef3f68930178372a1bbcc2c9694bce20da72ee65672421c14b672821afa24d
3
+ metadata.gz: 0b9ee1765ac530791d434e0ae9166dcbbd6c78af0331e6744b798b042a4855cc
4
+ data.tar.gz: 36572839fec8085f9cdd3e55c0bf092319dac42f707c404097123454fd3f8a59
5
5
  SHA512:
6
- metadata.gz: 656a86ab1ff70b214af607befecf191bba4de6fc33e74f8c674c938f8732525e9cba98827962f1a86c0fb0ede9340e9b8e78f3f546dc367f6a89d2594f51b9e8
7
- data.tar.gz: 33a50eac62b23ad09ed0cf8e5a5d6afa93a082765f44a377050d8105d50501c39788ae7e28b1e7963132589df31ac5539e0f5e7618a207ea30becd35a2a3a09a
6
+ metadata.gz: 44e14f1f07236555a67735e407c6aa9ae2849fb7db87b67168f9c1ddb233ee8007cfcd0e77c7462fe26df2a92c2cc4e780513e7a2ab4f522e9aa28f9d3886370
7
+ data.tar.gz: c5ae90ef4ae1304a684f92679e62f66e8adaf75e65a94410b4259cbefec4aba7983e829dde112f2192564c9ce5fd242eeb0ee1fccb0185dd634e4f14e8a2398d
data/README.md CHANGED
@@ -47,7 +47,7 @@ Features
47
47
  - Vote on the currently playing track
48
48
  - Save a log of a all your liked tracks
49
49
  - Generate playlists (requires a premium account)
50
- - Download songs from Youtube (using youtube-dl)
50
+ - Download songs from YouTube (requires [youtube-dl][youtube-dl])
51
51
 
52
52
 
53
53
  Usage
@@ -84,3 +84,4 @@ Commands:
84
84
  [JazzRadio]: http://www.jazzradio.com
85
85
  [ClassicalRadio]: http://www.classicalradio.com
86
86
  [ZenRadio]: http://www.zenradio.com
87
+ [youtube-dl]: https://github.com/ytdl-org/youtube-dl/
data/bin/radio CHANGED
@@ -8,7 +8,7 @@ router = AudioAddict::CLI.router
8
8
  begin
9
9
  exit router.run ARGV
10
10
 
11
- rescue AudioAddict::Interrupt, TTY::Reader::InputInterrupt
11
+ rescue Interrupt, AudioAddict::Interrupt, TTY::Reader::InputInterrupt
12
12
  say "\nGoodbye"
13
13
  exit 1
14
14
 
@@ -30,4 +30,5 @@ rescue => e
30
30
  say "!undred!ERROR: #{e.class}"
31
31
  say e.message
32
32
  exit 1
33
+
33
34
  end
@@ -11,7 +11,7 @@ module AudioAddict
11
11
  usage "radio download --help"
12
12
 
13
13
  option "-l --lines N", "Number of log lines to download [default: 1]"
14
- option "-c --count N", "Number of YouTube search results to download [default: 1]"
14
+ option "-c --count N", "Number of YouTube search results to download\nDefaults to the value of the AUDIO_ADDICT_DOWNLOAD_COUNT environment variable, or 1"
15
15
 
16
16
  param "QUERY", "YouTube search query"
17
17
 
@@ -19,6 +19,8 @@ module AudioAddict
19
19
  command "log", "Download the last N songs from the like-log"
20
20
  command "search", "Download any song matching the Youtube search query"
21
21
 
22
+ environment "AUDIO_ADDICT_DOWNLOAD_COUNT", "Set the default download count (--count)"
23
+
22
24
  example "radio download current"
23
25
  example "radio download current --count 3"
24
26
  example "radio download log --lines 2 --count 3"
@@ -26,7 +28,6 @@ module AudioAddict
26
28
 
27
29
  def current_command
28
30
  needs :network, :channel
29
- count = args['--count']
30
31
 
31
32
  say "!txtblu!Downloading !txtrst!: ... "
32
33
 
@@ -40,7 +41,6 @@ module AudioAddict
40
41
 
41
42
  def log_command
42
43
  needs :like_log
43
- count = args['--count']
44
44
  lines = args['--lines']&.to_i
45
45
 
46
46
  data = log.data[-lines..-1]
@@ -54,7 +54,6 @@ module AudioAddict
54
54
 
55
55
  def search_command
56
56
  query = args['QUERY']
57
- count = args['--count']
58
57
 
59
58
  say "\n!txtblu!Downloading !txtgrn!: #{query}"
60
59
  Youtube.new(query).get count
@@ -62,6 +61,10 @@ module AudioAddict
62
61
 
63
62
  private
64
63
 
64
+ def count
65
+ args['--count']&.to_i || ENV['AUDIO_ADDICT_DOWNLOAD_COUNT']&.to_i || 1
66
+ end
67
+
65
68
  def log
66
69
  @log ||= Log.new
67
70
  end
@@ -1,3 +1,3 @@
1
1
  module AudioAddict
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -26,7 +26,7 @@ module AudioAddict
26
26
  private
27
27
 
28
28
  def execute(command)
29
- if ENV['YOUTUBE_DL_DRY_RUN']
29
+ if ENV['AUDIO_ADDICT_DOWNLOAD_DRY_RUN']
30
30
  puts "DRY RUN: #{command}"
31
31
  true
32
32
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audio_addict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-27 00:00:00.000000000 Z
11
+ date: 2021-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole