audio_addict 0.4.5 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ce61de9768ce00fd9d96c2b8f2f66a87758987806cd34de7f576a75b9e2cd8d
4
- data.tar.gz: 605d0e3e92bb272a46350a7a557c8601ede972269790acb7d786f242da776771
3
+ metadata.gz: fa6aca6b2c17f49637c1047cec083c3734f15d6bcae20411d6d08ec948d76351
4
+ data.tar.gz: 882d4f3693907f19d7575c49d22e02bcb5d9f3bdc162d565545621ce32b9fff0
5
5
  SHA512:
6
- metadata.gz: 73b2810bf10f96ce2e7f09ffa4783e56c83d6200909b623f468f45fe5aa0cad1817168f7bafd443520dec7e5b2d2b94d00df2107817ce8da7055acf544684d7c
7
- data.tar.gz: 8bef5e3b79cf40c7005fca90159f67b6d0310431b0dc61cf7a0f55b4061c3ebdfd00d1e5edcfb0f1901c95e321b57956c9d58c60c1df4113f5d4a8488b4fcb50
6
+ metadata.gz: 2855e5450ee8968f8cfd2c078f8678632e470d4483dcc1e8a7c355bfb03e565d66d6808ba67e4eaaeb28c41475efb5cc01bc769804dce0d98cd4445d42238851
7
+ data.tar.gz: 00bbaabd475d435f9e5cca1121a338c4f75bc734c1d5dc92c98b21d244353bb9732ccd334cbba38ac8e7705f4521d95e092530d3189e0e99ef379c39cd9a6edd
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- AudioAddict Command Line
2
- ==================================================
1
+ # AudioAddict Command Line
3
2
 
4
3
  [![Gem Version](https://badge.fury.io/rb/audio_addict.svg)](https://badge.fury.io/rb/audio_addict)
5
4
  [![Build Status](https://github.com/DannyBen/audio_addict/workflows/Test/badge.svg)](https://github.com/DannyBen/audio_addict/actions?query=workflow%3ATest)
@@ -14,14 +13,12 @@ radio network.
14
13
 
15
14
  ---
16
15
 
17
- Demo
18
- --------------------------------------------------
16
+ ## Demo
19
17
 
20
- ![Demo](https://raw.githubusercontent.com/DannyBen/audio_addict/master/demo/demo.gif)
18
+ ![demo](support/demo/cast.gif)
21
19
 
22
20
 
23
- Install
24
- --------------------------------------------------
21
+ ## Install
25
22
 
26
23
  Please note that in order to use this gem you need to have an AUdioAddict
27
24
  account (free or premium) at one of the AudioAddict networks.
@@ -31,8 +28,7 @@ $ gem install audio_addict
31
28
  ```
32
29
 
33
30
 
34
- Features
35
- --------------------------------------------------
31
+ ## Features
36
32
 
37
33
  - Easy to use command line interface
38
34
  - Support for all the networks on the [AudioAddict Platform]:
@@ -50,8 +46,7 @@ Features
50
46
  - Download songs from YouTube (requires [youtube-dl][youtube-dl])
51
47
 
52
48
 
53
- Usage
54
- --------------------------------------------------
49
+ ## Usage
55
50
 
56
51
  - Run the `radio` command to see a list of available subcommands.
57
52
  - To see additional help, run `radio <subcommand> --help`
@@ -75,8 +70,6 @@ Commands:
75
70
 
76
71
  ```
77
72
 
78
- ---
79
-
80
73
  [AudioAddict Platform]: http://www.audioaddict.com
81
74
  [Digitally Imported]: http://di.fm
82
75
  [RockRadio]: http://www.rockradio.com
@@ -84,4 +77,4 @@ Commands:
84
77
  [JazzRadio]: http://www.jazzradio.com
85
78
  [ClassicalRadio]: http://www.classicalradio.com
86
79
  [ZenRadio]: http://www.zenradio.com
87
- [youtube-dl]: https://github.com/ytdl-org/youtube-dl/
80
+ [youtube-dl]: https://github.com/yt-dlp/yt-dlp
data/bin/radio CHANGED
@@ -11,20 +11,20 @@ rescue Interrupt, AudioAddict::Interrupt, TTY::Reader::InputInterrupt
11
11
  say "\nGoodbye"
12
12
  exit 1
13
13
  rescue AudioAddict::ConfigError => e
14
- say '!undred!ERROR: Missing Configuration Values'
14
+ say 'ru`ERROR: Missing Configuration Values`'
15
15
  say "#{e.message}:"
16
16
  e.missing_keys.each do |key|
17
- say "- !txtblu!#{key}"
17
+ say "- b`#{key}`"
18
18
  end
19
19
  say ''
20
- say 'Run !txtpur!radio config guide!txtrst! for more information'
20
+ say 'Run m`radio config guide` for more information'
21
21
  exit 1
22
22
  rescue => e
23
23
  if ENV['DEBUG']
24
24
  puts e.backtrace.reverse
25
25
  say ''
26
26
  end
27
- say "!undred!ERROR: #{e.class}"
27
+ say "ru`ERROR: #{e.class}`"
28
28
  say e.message
29
29
  exit 1
30
30
  end
@@ -20,7 +20,7 @@ module AudioAddict
20
20
  def run
21
21
  needs :network
22
22
 
23
- say "!undgrn!#{radio.name}\n"
23
+ say "gu`#{radio.name}`\n"
24
24
 
25
25
  search = args['SEARCH']
26
26
 
@@ -39,7 +39,7 @@ module AudioAddict
39
39
  def show_verbose(channels)
40
40
  channels.each do |channel|
41
41
  say ''
42
- say "!txtgrn!#{channel.name.ljust 22} !txtrst!# #{channel.key}"
42
+ say "g`#{channel.name.ljust 22} `# #{channel.key}"
43
43
  say ''
44
44
  say word_wrap channel.description.to_s
45
45
  say ''
@@ -50,7 +50,7 @@ module AudioAddict
50
50
 
51
51
  say 'Similar Channels:'
52
52
  similar.each do |key, similar_channel|
53
- say "- !txtblu!#{similar_channel.name.ljust 20}!txtrst! # #{key}"
53
+ say "- b`#{similar_channel.name.ljust 20}` # #{key}"
54
54
  end
55
55
  say ''
56
56
  end
@@ -58,7 +58,7 @@ module AudioAddict
58
58
 
59
59
  def show_compact(channels)
60
60
  channels.each do |channel|
61
- say "!txtblu!#{channel.key.rjust 25} !txtgrn!#{channel.name.strip}"
61
+ say "b`#{channel.key.rjust 25}` g`#{channel.name.strip}`"
62
62
  end
63
63
  end
64
64
  end
@@ -36,7 +36,7 @@ module AudioAddict
36
36
  def get_command
37
37
  key = args['KEY'].to_sym
38
38
  value = Config.properties[key]
39
- say value ? "!txtgrn!#{value}" : '!txtred!<Unset>'
39
+ say value ? "g`#{value}`" : 'r`<Unset>`'
40
40
  end
41
41
 
42
42
  def set_command
@@ -44,22 +44,22 @@ module AudioAddict
44
44
  value = args['VALUE']
45
45
  Config.properties[key] = value
46
46
  Config.save
47
- say "!txtgrn!#{key}=#{value}"
47
+ say "g`#{key}=#{value}`"
48
48
  end
49
49
 
50
50
  def del_command
51
51
  key = args['KEY'].to_sym
52
52
  Config.delete key
53
53
  Config.save
54
- say '!txtgrn!Deleted'
54
+ say 'g`Deleted`'
55
55
  end
56
56
 
57
57
  def show_command
58
- say "!undpur!# #{Config.path}"
58
+ say "mu`# #{Config.path}`"
59
59
  if File.exist? Config.path
60
60
  puts File.read Config.path
61
61
  else
62
- say '!txtred!File Not Found'
62
+ say 'r`File Not Found`'
63
63
  end
64
64
  end
65
65
 
@@ -70,7 +70,7 @@ module AudioAddict
70
70
 
71
71
  def guide_command
72
72
  key_guide.each do |key, value|
73
- say "!txtgrn!#{key}"
73
+ say "g`#{key}`"
74
74
  say word_wrap " #{value}"
75
75
  say ''
76
76
  end
@@ -88,12 +88,12 @@ module AudioAddict
88
88
 
89
89
  def verify_and_show_keys(keys, critical: false)
90
90
  problems = 0
91
- prefix = critical ? '!txtred!Error !txtrst!' : '!txtylw!Warning!txtrst!'
91
+ prefix = critical ? 'r`Error `' : 'y`Warning`'
92
92
 
93
93
  keys.each do |key, command|
94
94
  unless Config.has_key? key
95
95
  problems += 1
96
- say "#{prefix} : Key !txtgrn!#{key}!txtrst! is not set. Fix with !txtpur!radio #{command}!txtrst!."
96
+ say "#{prefix} : Key g`#{key}` is not set. Fix with m`radio #{command}`."
97
97
  end
98
98
  end
99
99
 
@@ -102,11 +102,11 @@ module AudioAddict
102
102
 
103
103
  def key_guide
104
104
  {
105
- email: "Last email used for logging in.\nUsually set with !txtpur!radio login!txtrst!.",
106
- session_key: "Used for authentication.\nUsually set with !txtpur!radio login!txtrst!.",
107
- listen_key: "Used for generating playlists.\nUsually set with !txtpur!radio login!txtrst!.",
108
- network: "Specify the AudioAddict network you are currently listening to.\nUsually set with !txtpur!radio set!txtrst!.",
109
- channel: "Specify the AudioAddict channel you are currently listening to.\nUsually set with !txtpur!radio set!txtrst!.",
105
+ email: "Last email used for logging in.\nUsually set with m`radio login`.",
106
+ session_key: "Used for authentication.\nUsually set with m`radio login`.",
107
+ listen_key: "Used for generating playlists.\nUsually set with m`radio login`.",
108
+ network: "Specify the AudioAddict network you are currently listening to.\nUsually set with m`radio set`.",
109
+ channel: "Specify the AudioAddict channel you are currently listening to.\nUsually set with m`radio set`.",
110
110
  like_log: "Specify the path to store all your positive votes.\nIf this is not set, votes will only be sent to AudioAddict and not logged locally.",
111
111
  cache_dir: "Specify the path to store API response cache.\nDefault: ~/.audio_addict/cache",
112
112
  cache_life: "Specify the cache life period.\nDefault: 6h.",
@@ -30,12 +30,12 @@ module AudioAddict
30
30
  def current_command
31
31
  needs :network, :channel
32
32
 
33
- say '!txtblu!Downloading !txtrst!: ... '
33
+ say 'b`Downloading` : ... '
34
34
 
35
35
  track = current_channel.current_track
36
36
  query = track.search_string
37
37
 
38
- resay "!txtblu!Downloading !txtgrn!: #{query}"
38
+ say "b`Downloading` : g`#{query}`", replace: true
39
39
 
40
40
  Youtube.new(query).get count
41
41
  end
@@ -48,7 +48,7 @@ module AudioAddict
48
48
  data.each do |line|
49
49
  _network, _channel, artist, song = line.split(' :: ')
50
50
  query = "#{artist}, #{song}"
51
- say "\n!txtblu!Downloading !txtgrn!: #{query}"
51
+ say "\nb`Downloading` : g`#{query}`"
52
52
  Youtube.new(query).get count
53
53
  end
54
54
  end
@@ -56,7 +56,7 @@ module AudioAddict
56
56
  def search_command
57
57
  query = args['QUERY']
58
58
 
59
- say "\n!txtblu!Downloading !txtgrn!: #{query}"
59
+ say "\nb`Downloading` : g`#{query}`"
60
60
  Youtube.new(query).get count
61
61
  end
62
62
 
@@ -10,10 +10,10 @@ module AudioAddict
10
10
 
11
11
  def run
12
12
  needs :network, :channel
13
- say "!undgrn!#{radio.name} > #{current_channel.name}"
13
+ say "gu`#{radio.name} > #{current_channel.name}`"
14
14
  say ''
15
15
  tracks.each do |track|
16
- say "!txtgrn! #{track.artist.rjust max_artist_len}!txtrst! : !txtblu!#{track.title}"
16
+ say "g` #{track.artist.rjust max_artist_len}` : b`#{track.title}`"
17
17
  end
18
18
  end
19
19
 
@@ -45,7 +45,7 @@ module AudioAddict
45
45
  def sort_command
46
46
  needs :like_log
47
47
  log.sort
48
- say '!txtgrn!Sorted'
48
+ say 'g`Sorted`'
49
49
  end
50
50
 
51
51
  def browse_command
@@ -59,7 +59,7 @@ module AudioAddict
59
59
  per_page: page_size
60
60
 
61
61
  say 'Songs:'
62
- tree[network][channel][artist].each { |song| say "- !txtgrn!#{song}" }
62
+ tree[network][channel][artist].each { |song| say "- g`#{song}`" }
63
63
  say ''
64
64
 
65
65
  browse_command if prompt.yes?('Again?')
@@ -71,7 +71,7 @@ module AudioAddict
71
71
 
72
72
  if filename
73
73
  File.write filename, yaml
74
- say "!txtgrn!Saved #{filename}"
74
+ say "g`Saved #{filename}`"
75
75
  else
76
76
  puts yaml
77
77
  end
@@ -84,7 +84,7 @@ module AudioAddict
84
84
  end
85
85
 
86
86
  def page_size
87
- @page_size ||= detect_terminal_size[1] - 4
87
+ @page_size ||= terminal_height - 4
88
88
  end
89
89
  end
90
90
  end
@@ -12,7 +12,7 @@ module AudioAddict
12
12
  proceed = true
13
13
 
14
14
  if radio.api.logged_in?
15
- say "!txtylw!You are already logged in as !undylw!#{Config.email}"
15
+ say "y`You are already logged in as` yu`#{Config.email}`"
16
16
  proceed = prompt.yes? 'Login again?'
17
17
  end
18
18
 
@@ -28,9 +28,9 @@ module AudioAddict
28
28
  if user && pass
29
29
  say 'Logging in... '
30
30
  radio.api.login user, pass
31
- resay '!txtgrn!Saved'
31
+ say 'g`Saved`', replace: true
32
32
  else
33
- say '!txtred!Cancelled'
33
+ say 'r`Cancelled`'
34
34
  end
35
35
  end
36
36
  end
@@ -11,13 +11,13 @@ module AudioAddict
11
11
  def run
12
12
  needs :network, :channel
13
13
 
14
- say "!txtblu! Network !txtrst!: !txtgrn!#{radio.name}!txtrst! # #{radio.network}"
15
- say "!txtblu! Channel !txtrst!: !txtgrn!#{current_channel.name}!txtrst! # #{current_channel.key}"
16
- say '!txtblu! Track !txtrst!: ... '
14
+ say "b` Network `: g`#{radio.name}` # #{radio.network}"
15
+ say "b` Channel `: g`#{current_channel.name}` # #{current_channel.key}"
16
+ say 'b` Track `: ... '
17
17
 
18
18
  track = current_channel.current_track
19
- resay "!txtblu! Track !txtrst!: !txtgrn!#{track.title.strip}"
20
- say "!txtblu! By !txtrst!: !txtgrn!#{track.artist.strip}"
19
+ say "b` Track `: g`#{track.title.strip}`", replace: true
20
+ say "b` By `: g`#{track.artist.strip}`"
21
21
  end
22
22
  end
23
23
  end
@@ -26,7 +26,7 @@ module AudioAddict
26
26
  name = args['NAME']
27
27
  outfile = "#{name}.yml"
28
28
 
29
- say "!txtred!Warning!txtrst!: !txtgrn!#{outfile}!txtrst! already exists!" if File.exist? outfile
29
+ say "r`Warningr`: g`#{outfile}` already exists!" if File.exist? outfile
30
30
  proceed = prompt.yes? "Create #{outfile}?"
31
31
  return unless proceed
32
32
 
@@ -46,11 +46,11 @@ module AudioAddict
46
46
  outfile = "#{name}.pls"
47
47
 
48
48
  if File.exist? infile
49
- say "!txtred!Warning!txtrst!: !txtgrn!#{outfile}!txtrst! already exists!" if File.exist? outfile
49
+ say "r`Warning`: g`#{outfile}` already exists!" if File.exist? outfile
50
50
  proceed = prompt.yes? "Create #{outfile}?"
51
51
  generate_playlist infile, outfile if proceed
52
52
  else
53
- say "!txtred!Cannot find #{infile}"
53
+ say "r`Cannot find #{infile}`"
54
54
  end
55
55
  end
56
56
 
@@ -68,7 +68,7 @@ module AudioAddict
68
68
  data[:channels] = channels
69
69
 
70
70
  File.write outfile, data.to_yaml
71
- say "Saved !txtgrn!#{outfile}"
71
+ say "Saved g`#{outfile}`"
72
72
  end
73
73
 
74
74
  def generate_playlist(infile, outfile)
@@ -92,7 +92,7 @@ module AudioAddict
92
92
  output = "#{output.join("\n")}\n"
93
93
 
94
94
  File.write outfile, output
95
- say "Saved !txtgrn!#{outfile}"
95
+ say "Saved g`#{outfile}`"
96
96
  end
97
97
 
98
98
  def template_params(channel_key)
@@ -3,7 +3,7 @@ module AudioAddict
3
3
  class SetCmd < Base
4
4
  summary 'Set the radio network and channel'
5
5
 
6
- help 'This command provides both interactive and non-interactive means of storing the currenlty active channel and network in the configuration file.'
6
+ help 'This command provides both interactive and non-interactive means of storing the currently active channel and network in the configuration file.'
7
7
 
8
8
  usage 'radio set [CHANNEL NETWORK]'
9
9
  usage 'radio set --help'
@@ -59,7 +59,7 @@ module AudioAddict
59
59
  elsif radio.search(channel).any?
60
60
  channel_menu channel
61
61
  else
62
- say "!txtred!Invalid channel: #{radio.name} > #{channel}"
62
+ say "r`Invalid channel: #{radio.name} > #{channel}`"
63
63
  end
64
64
  end
65
65
 
@@ -100,13 +100,13 @@ module AudioAddict
100
100
  def save_channel(channel, echo: true)
101
101
  Config.channel = channel
102
102
  Config.save
103
- say "Channel : !txtgrn!#{radio.name} > #{current_channel.name}!txtrst! # #{channel}" if echo
103
+ say "Channel : g`#{radio.name} > #{current_channel.name}` # #{channel}" if echo
104
104
  end
105
105
 
106
106
  def save_network(network, echo: true)
107
107
  Config.network = network
108
108
  Config.save
109
- say "Network : !txtgrn!#{radio.name}!txtrst! # #{network}" if echo
109
+ say "Network : g`#{radio.name}` # #{network}" if echo
110
110
  end
111
111
  end
112
112
  end
@@ -42,7 +42,7 @@ module AudioAddict
42
42
  def send_vote(vote, track = nil)
43
43
  say 'Voting... '
44
44
  current_channel.vote vote, track: track
45
- resay '!txtgrn!Voted'
45
+ say 'g`Voted`', replace: true
46
46
  end
47
47
 
48
48
  def tracks
@@ -1,3 +1,3 @@
1
1
  module AudioAddict
2
- VERSION = '0.4.5'
2
+ VERSION = '0.4.7'
3
3
  end
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.5
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-20 00:00:00.000000000 Z
11
+ date: 2024-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.8.1
19
+ version: 1.0.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.8'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.8.1
26
+ version: 1.0.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: httparty
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +94,48 @@ dependencies:
100
94
  - - "~>"
101
95
  - !ruby/object:Gem::Version
102
96
  version: '0.19'
97
+ - !ruby/object:Gem::Dependency
98
+ name: base64
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: bigdecimal
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: csv
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
103
139
  description: Command line for playlist management and voting for AudioAddict radio
104
140
  networks
105
141
  email: db@dannyben.com
@@ -142,7 +178,7 @@ licenses:
142
178
  - MIT
143
179
  metadata:
144
180
  rubygems_mfa_required: 'true'
145
- post_install_message:
181
+ post_install_message:
146
182
  rdoc_options: []
147
183
  require_paths:
148
184
  - lib
@@ -150,15 +186,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
186
  requirements:
151
187
  - - ">="
152
188
  - !ruby/object:Gem::Version
153
- version: 2.7.0
189
+ version: 3.0.0
154
190
  required_rubygems_version: !ruby/object:Gem::Requirement
155
191
  requirements:
156
192
  - - ">="
157
193
  - !ruby/object:Gem::Version
158
194
  version: '0'
159
195
  requirements: []
160
- rubygems_version: 3.4.3
161
- signing_key:
196
+ rubygems_version: 3.5.6
197
+ signing_key:
162
198
  specification_version: 4
163
199
  summary: AudioAddict Command Line
164
200
  test_files: []