vk_music 2.1.2 → 2.1.3

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: 6efa2ab0abdb49d6cf5abf20aa20771f60539cd2d7c23abdb7d0aedf56cde42f
4
- data.tar.gz: 283ca779eba1b54ed4ba2adb14e37d8479957bf1bbd15a3e48263da05fd97055
3
+ metadata.gz: c65c2dafcb344531e327c5267a64646f191cba83480ce03b1b90c96e164bd44d
4
+ data.tar.gz: 6c2b7f6ef866a5e7acd97bd681f2af96cc5f8d21e5468ae7e1fea0f2ba2c8557
5
5
  SHA512:
6
- metadata.gz: 40046f3b1034d944bc2aeb0c8ab4b7ca467992ec426aaa614dbf8c4cda1c8e1ed53745b9c22fceaca6eb46f5498dbb7b9fa0442d3287fdfbef52d9afa1fd1fed
7
- data.tar.gz: 1b9d7cd5d63bdb7ba78cd1b315957d4c1cce2eaea96e8bf5569ca5cc0841ee55e4247db83eb97d773514df91fd31cd870c3878566ded05d70908e591cb976350
6
+ metadata.gz: '0878bec095d953a51fc5cda8f429e101c6294c8577c988874cb4a84fb05abd25ba63d33d0f46778657bfeac131302c7ab52dbf61769160a19dc65ecc608693d1'
7
+ data.tar.gz: 2ba4c82fbfc3eaa01ad96df984aec5af016929bea6c4774bd35870d0c95cfc8b83c162bac8ee340fb4ee878b5865ee1da539284260818cab84d0b52ee8d5180d
data/bin/console ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../lib/vk_music.rb"
4
+ require "irb"
5
+
6
+ IRB.start(__FILE__)
@@ -159,7 +159,7 @@ module VkMusic
159
159
  # @return [Audio]
160
160
  def self.from_node(node, client_id)
161
161
  url_encoded = node.at_css("input").attribute("value").to_s
162
- url_encoded = nil if url_encoded == Constants::URL::VK[:audio_unavailable]
162
+ url_encoded = nil if url_encoded == Constants::URL::VK[:audio_unavailable] || url_encoded.empty?
163
163
  id_array = node.attribute("data-id").to_s.split("_")
164
164
 
165
165
  new({
@@ -168,7 +168,7 @@ module VkMusic
168
168
  :artist => node.at_css(".ai_artist").text.strip,
169
169
  :title => node.at_css(".ai_title").text.strip,
170
170
  :duration => node.at_css(".ai_dur").attribute("data-dur").to_s.to_i,
171
- :url_encoded => url_encoded.to_s,
171
+ :url_encoded => url_encoded,
172
172
  :url => nil,
173
173
  :client_id => client_id
174
174
  })
@@ -183,6 +183,7 @@ module VkMusic
183
183
  # @return [Audio]
184
184
  def self.from_data(data, client_id)
185
185
  url_encoded = data[2].to_s
186
+ url_encoded = nil if url_encoded.empty?
186
187
 
187
188
  secrets = data[13].to_s.split("/")
188
189
 
@@ -219,6 +219,8 @@ module VkMusic
219
219
  #
220
220
  # @note this method is only able to load up to 91 audios from wall.
221
221
  #
222
+ # @todo this method breaks when club got fixed post with attached audios.
223
+ #
222
224
  # @overload wall(url, options)
223
225
  # Load last audios from wall.
224
226
  # @param url [String] URL to user/group page.
data/vk_music.gemspec CHANGED
@@ -2,13 +2,13 @@ Gem::Specification.new do |s|
2
2
  s.name = "vk_music"
3
3
  s.summary = "Provides interface to work with VK music via HTTP requests"
4
4
  s.description = "Library to work with audios on popular Russian social network vk.com. VK disabled their public API for audios, so it is now necessary to use parsers instead."
5
- s.version = "2.1.2"
5
+ s.version = "2.1.3"
6
6
  s.author = "Kuznetsov Vladislav"
7
7
  s.email = "fizvlad@mail.ru"
8
8
  s.homepage = "https://github.com/fizvlad/vk-music-rb"
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.required_ruby_version = ">=2.3.1"
11
- s.files = Dir[ "lib/**/**", "test/**/**", "LICENSE", "Rakefile", "README.md", "vk_music.gemspec" ]
11
+ s.files = Dir[ "bin/**/**", "lib/**/**", "test/**/**", "LICENSE", "Rakefile", "README.md", "vk_music.gemspec" ]
12
12
  s.test_files = Dir[ "test/test*.rb" ]
13
13
  s.license = "MIT"
14
14
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vk_music
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kuznetsov Vladislav
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-20 00:00:00.000000000 Z
11
+ date: 2019-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -104,6 +104,7 @@ files:
104
104
  - LICENSE
105
105
  - README.md
106
106
  - Rakefile
107
+ - bin/console
107
108
  - lib/vk_music.rb
108
109
  - lib/vk_music/audio.rb
109
110
  - lib/vk_music/client.rb