vk_music 2.1.0 → 2.1.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 +4 -4
- data/lib/vk_music/constants.rb +1 -1
- data/test/test_playlist.rb +11 -3
- data/vk_music.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 40fe252314af6fe66fe807cee91c7f8cb82c590947e7a773ecb36b19942953de
|
|
4
|
+
data.tar.gz: f1a9aa1189bc179b3a068f88fda05df8551ae05e148c02bea9ac51cc7d924a82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c1a3ce11b31f306948a6ac5f695eecbca111627dc482857820184304b1992be3de6f8794332596af73af2bba0010cfc899f89c538f1d73baf2afdf6e21bc7924
|
|
7
|
+
data.tar.gz: 4eaa3bcb54614e8295d36a703bb40c841067b5b04a81cb0eea7dec1786c290525d8ec225a694c0afd0d2138a319027fcb81f548b92238a9eaf75417e3d56519c
|
data/lib/vk_music/constants.rb
CHANGED
|
@@ -64,7 +64,7 @@ module VkMusic
|
|
|
64
64
|
|
|
65
65
|
##
|
|
66
66
|
# Playlist URL regular expression.
|
|
67
|
-
VK_PLAYLIST_URL_POSTFIX = /.*audio_playlist(-?\d+)_(\d+)(?:(?:(?:.*(?=&access_hash=)&access_hash=)|\/|%2F)([\da-z]+))?/
|
|
67
|
+
VK_PLAYLIST_URL_POSTFIX = /.*(?:audio_playlist|album\/)(-?\d+)_(\d+)(?:(?:(?:.*(?=&access_hash=)&access_hash=)|\/|%2F)([\da-z]+))?/
|
|
68
68
|
|
|
69
69
|
##
|
|
70
70
|
# Post URL regular expression #1.
|
data/test/test_playlist.rb
CHANGED
|
@@ -10,7 +10,7 @@ end
|
|
|
10
10
|
|
|
11
11
|
class TestVkMusic < MiniTest::Test
|
|
12
12
|
|
|
13
|
-
def
|
|
13
|
+
def test_playlist_small_1
|
|
14
14
|
pl = CLIENT.playlist("https://vk.com/audio?z=audio_playlist-37661843_1/0e420c32c8b69e6637")
|
|
15
15
|
refute_empty(pl, "This playlist must not be empty")
|
|
16
16
|
assert_instance_of(VkMusic::Audio, pl[0], "Playlist members must be of class Audio")
|
|
@@ -18,6 +18,14 @@ class TestVkMusic < MiniTest::Test
|
|
|
18
18
|
refute_empty(pl[-1].url, "Audio must have download url")
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
+
def test_playlist_small_2
|
|
22
|
+
pl = CLIENT.playlist("https://vk.com/music/album/-121725065_1")
|
|
23
|
+
refute_empty(pl, "This playlist must not be empty")
|
|
24
|
+
assert_instance_of(VkMusic::Audio, pl[0], "Playlist members must be of class Audio")
|
|
25
|
+
refute_empty(pl[0].url, "Audio must have download url")
|
|
26
|
+
refute_empty(pl[-1].url, "Audio must have download url")
|
|
27
|
+
end
|
|
28
|
+
|
|
21
29
|
def test_big_url
|
|
22
30
|
pl = CLIENT.playlist("https://m.vk.com/audio?act=audio_playlist256492540_83617715&from=search_owned_playlist&access_hash=b8d408241bcfb60583&back_url=%2Faudios-39786657%3Fq%3Dmashup%26tab%3Downed&back_hash=76ef9186ac6f248a27")
|
|
23
31
|
refute_empty(pl, "This playlist must not be empty")
|
|
@@ -63,8 +71,8 @@ class TestVkMusic < MiniTest::Test
|
|
|
63
71
|
end
|
|
64
72
|
|
|
65
73
|
def test_playlist_with_upper_limit
|
|
66
|
-
pl = CLIENT.playlist("https://vk.com/audio?z=
|
|
67
|
-
assert_equal(
|
|
74
|
+
pl = CLIENT.playlist("https://vk.com/audio?z=audio_playlist-66223223_77503494", up_to: 105, with_url: true)
|
|
75
|
+
assert_equal(105, pl.length, "Size of result must match given limit") # This playlist got more audios
|
|
68
76
|
refute_empty(pl[0].url, "Audio must have download url")
|
|
69
77
|
refute_empty(pl[-1].url, "Audio must have download url")
|
|
70
78
|
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 = "2.1.
|
|
5
|
+
s.version = "2.1.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,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.
|
|
4
|
+
version: 2.1.1
|
|
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-
|
|
11
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mechanize
|