vk_music 2.1.0 → 2.1.1

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: c25c28560c85999aeffe7b23070762fe875600eb32fde5758c5d02041a9d079b
4
- data.tar.gz: 64b80f5fe01c1e8bf19ef95c6660ccbb5043b5fb07257c8590bb93f08af2b7e1
3
+ metadata.gz: 40fe252314af6fe66fe807cee91c7f8cb82c590947e7a773ecb36b19942953de
4
+ data.tar.gz: f1a9aa1189bc179b3a068f88fda05df8551ae05e148c02bea9ac51cc7d924a82
5
5
  SHA512:
6
- metadata.gz: 4bb0b4d69ad1699d760ab30e3e6149b3440318ab7edf2c42e2e17172d18c564f4922fde227089e2dc828658c34689599f93759fa5ea954af350f35747ba32cd2
7
- data.tar.gz: 4cb018f20a3cae069616cb1f339703b9f9975f7939a1924225d1840562f30c9f759a21386f00729a499193bd11a3af7339e9b9860ed148cb6f6f3bdae834c0ae
6
+ metadata.gz: c1a3ce11b31f306948a6ac5f695eecbca111627dc482857820184304b1992be3de6f8794332596af73af2bba0010cfc899f89c538f1d73baf2afdf6e21bc7924
7
+ data.tar.gz: 4eaa3bcb54614e8295d36a703bb40c841067b5b04a81cb0eea7dec1786c290525d8ec225a694c0afd0d2138a319027fcb81f548b92238a9eaf75417e3d56519c
@@ -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.
@@ -10,7 +10,7 @@ end
10
10
 
11
11
  class TestVkMusic < MiniTest::Test
12
12
 
13
- def test_playlist_small
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=audio_playlist121570739_7", up_to: 113)
67
- assert_equal(113, pl.length, "Size of result must match given limit") # This playlist got more audios
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
@@ -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.0"
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.0
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-12 00:00:00.000000000 Z
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize