vk_music 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +15 -0
- data/lib/vk_music/audio.rb +4 -2
- data/lib/vk_music/client.rb +2 -2
- data/lib/vk_music/utility.rb +5 -4
- data/vk_music.gemspec +1 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 260184187c9b0486ebb183a0aaaeda341adf1017ea45575d58848bfe6cebd394
|
4
|
+
data.tar.gz: f5bdc041b5ff217b80e4524b5b2c30d3c415d2e1c52372899de12bdc9f83e3af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ce26605b1521b0fe3370093eb323019e032311760600446666f355968174c6f35ae681c6a679530c504b78a941055996c6d13e9007f2ff02a2636ce8ec08de0
|
7
|
+
data.tar.gz: cd8cd0e489137db182319d21d956bb9782762f7573031095ab6e0207ddc4e90df3127c0e4051a493501fcbdec8cf580df1ed32a8a52e9065ce6d73ec4115c57a
|
data/Rakefile
CHANGED
@@ -3,6 +3,16 @@ task :build do
|
|
3
3
|
puts `gem build vk_music.gemspec`
|
4
4
|
end
|
5
5
|
|
6
|
+
desc "Uninstall gem"
|
7
|
+
task :uninstall do
|
8
|
+
puts `gem uninstall vk_music`
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Build and install gem"
|
12
|
+
task :install_local => :build do
|
13
|
+
puts `gem install ./vk_music-*.gem`
|
14
|
+
end
|
15
|
+
|
6
16
|
desc "Run tests"
|
7
17
|
task :test do
|
8
18
|
puts "Running tests require login credetionals (NOTICE: they won't be hidden in anyway)"
|
@@ -14,6 +24,11 @@ task :test do
|
|
14
24
|
password = STDIN.gets.chomp
|
15
25
|
puts
|
16
26
|
|
27
|
+
print "Path to SSL certificate (leave empty if there is no troubles with SSL):"
|
28
|
+
ssl_cert_path = STDIN.gets.chomp
|
29
|
+
puts
|
30
|
+
ENV["SSL_CERT_FILE"] = ssl_cert_path
|
31
|
+
|
17
32
|
Dir[ "test/test*.rb" ].each do |file|
|
18
33
|
puts "\n\nRunning #{file}:"
|
19
34
|
ruby "-w #{file} '#{username}' '#{password}'"
|
data/lib/vk_music/audio.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "cgi"
|
2
|
+
|
1
3
|
module VkMusic
|
2
4
|
|
3
5
|
class Audio
|
@@ -48,8 +50,8 @@ module VkMusic
|
|
48
50
|
new({
|
49
51
|
:id => data[0],
|
50
52
|
:owner_id => data[1],
|
51
|
-
:artist => data[4],
|
52
|
-
:title => data[3],
|
53
|
+
:artist => CGI.unescapeHTML(data[4]),
|
54
|
+
:title => CGI.unescapeHTML(data[3]),
|
53
55
|
:duration => data[5],
|
54
56
|
:url_encoded => url_encoded,
|
55
57
|
:url => url_encoded ? VkMusic.unmask_link(url_encoded, client_id) : nil,
|
data/lib/vk_music/client.rb
CHANGED
@@ -105,8 +105,8 @@ module VkMusic
|
|
105
105
|
:id => first_data["id"],
|
106
106
|
:owner_id => first_data["owner_id"],
|
107
107
|
:access_hash => first_data["access_hash"],
|
108
|
-
:title => first_data["title"],
|
109
|
-
:subtitle => first_data["subtitle"],
|
108
|
+
:title => CGI.unescapeHTML(first_data["title"].to_s),
|
109
|
+
:subtitle => CGI.unescapeHTML(first_data["subtitle"].to_s),
|
110
110
|
})
|
111
111
|
end
|
112
112
|
|
data/lib/vk_music/utility.rb
CHANGED
@@ -9,10 +9,11 @@ module VkMusic
|
|
9
9
|
|
10
10
|
def self.guess_request_type(str)
|
11
11
|
# Guess what type of request is this. Returns Symbol: :find, :playlist, :audios
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
case str
|
13
|
+
when PLAYLIST_URL_REGEX
|
14
|
+
:playlist
|
15
|
+
when VK_URL_REGEX
|
16
|
+
:audios
|
16
17
|
else
|
17
18
|
:find
|
18
19
|
end
|
data/vk_music.gemspec
CHANGED
@@ -2,7 +2,7 @@ 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 = "1.0.
|
5
|
+
s.version = "1.0.1"
|
6
6
|
s.author = "Kuznetsov Vladislav"
|
7
7
|
s.email = "fizvlad@mail.ru"
|
8
8
|
s.homepage = "https://github.com/fizvlad/vk-music-rb"
|
metadata
CHANGED
@@ -1,66 +1,66 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vk_music
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kuznetsov Vladislav
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
name: mechanize
|
14
15
|
requirement: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
17
|
- - "~>"
|
17
18
|
- !ruby/object:Gem::Version
|
18
19
|
version: '2.7'
|
19
|
-
name: mechanize
|
20
|
-
prerelease: false
|
21
20
|
type: :runtime
|
21
|
+
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
+
name: execjs
|
28
29
|
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
31
|
- - "~>"
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: '2.7'
|
33
|
-
name: execjs
|
34
|
-
prerelease: false
|
35
34
|
type: :runtime
|
35
|
+
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
+
name: json
|
42
43
|
requirement: !ruby/object:Gem::Requirement
|
43
44
|
requirements:
|
44
45
|
- - "~>"
|
45
46
|
- !ruby/object:Gem::Version
|
46
47
|
version: '2.0'
|
47
|
-
name: json
|
48
|
-
prerelease: false
|
49
48
|
type: :runtime
|
49
|
+
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
56
57
|
requirement: !ruby/object:Gem::Requirement
|
57
58
|
requirements:
|
58
59
|
- - "~>"
|
59
60
|
- !ruby/object:Gem::Version
|
60
61
|
version: '12.3'
|
61
|
-
name: rake
|
62
|
-
prerelease: false
|
63
62
|
type: :runtime
|
63
|
+
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
@@ -94,7 +94,7 @@ homepage: https://github.com/fizvlad/vk-music-rb
|
|
94
94
|
licenses:
|
95
95
|
- MIT
|
96
96
|
metadata: {}
|
97
|
-
post_install_message:
|
97
|
+
post_install_message:
|
98
98
|
rdoc_options: []
|
99
99
|
require_paths:
|
100
100
|
- lib
|
@@ -109,9 +109,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
|
-
rubyforge_project:
|
113
|
-
rubygems_version: 2.7.
|
114
|
-
signing_key:
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.7.6.2
|
114
|
+
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Provides interface to work with VK music via HTTP requests
|
117
117
|
test_files:
|