vk_music 3.1.7 → 4.1.0

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.env.example +3 -0
  3. data/.github/workflows/ruby.yml +35 -0
  4. data/.gitignore +6 -0
  5. data/.rspec +1 -0
  6. data/.rubocop.yml +56 -0
  7. data/Gemfile +38 -10
  8. data/Gemfile.lock +124 -70
  9. data/LICENSE.txt +0 -0
  10. data/README.md +121 -94
  11. data/Rakefile +15 -22
  12. data/bin/console +18 -24
  13. data/lib/vk_music.rb +32 -18
  14. data/lib/vk_music/audio.rb +112 -187
  15. data/lib/vk_music/client.rb +193 -677
  16. data/lib/vk_music/playlist.rb +44 -97
  17. data/lib/vk_music/request.rb +13 -0
  18. data/lib/vk_music/request/artist.rb +24 -0
  19. data/lib/vk_music/request/audios_reload.rb +29 -0
  20. data/lib/vk_music/request/base.rb +75 -0
  21. data/lib/vk_music/request/login.rb +35 -0
  22. data/lib/vk_music/request/my_page.rb +21 -0
  23. data/lib/vk_music/request/playlist.rb +31 -0
  24. data/lib/vk_music/request/playlist_section.rb +35 -0
  25. data/lib/vk_music/request/post.rb +22 -0
  26. data/lib/vk_music/request/profile.rb +24 -0
  27. data/lib/vk_music/request/search.rb +34 -0
  28. data/lib/vk_music/request/wall_section.rb +34 -0
  29. data/lib/vk_music/utility.rb +8 -78
  30. data/lib/vk_music/utility/artist_loader.rb +17 -0
  31. data/lib/vk_music/utility/artist_url_parser.rb +22 -0
  32. data/lib/vk_music/utility/audio_data_parser.rb +37 -0
  33. data/lib/vk_music/utility/audio_items_parser.rb +18 -0
  34. data/lib/vk_music/utility/audio_node_parser.rb +59 -0
  35. data/lib/vk_music/utility/audios_from_ids_loader.rb +21 -0
  36. data/lib/vk_music/utility/audios_ids_getter.rb +25 -0
  37. data/lib/vk_music/utility/audios_loader.rb +37 -0
  38. data/lib/vk_music/utility/data_type_guesser.rb +48 -0
  39. data/lib/vk_music/utility/duration_parser.rb +17 -0
  40. data/lib/vk_music/utility/last_profile_post_loader.rb +26 -0
  41. data/lib/vk_music/utility/link_decoder.rb +107 -0
  42. data/lib/vk_music/utility/node_text_children_reader.rb +14 -0
  43. data/lib/vk_music/utility/playlist_loader.rb +30 -0
  44. data/lib/vk_music/utility/playlist_node_parser.rb +21 -0
  45. data/lib/vk_music/utility/playlist_section_loader.rb +29 -0
  46. data/lib/vk_music/utility/playlist_url_parser.rb +32 -0
  47. data/lib/vk_music/utility/post_loader.rb +23 -0
  48. data/lib/vk_music/utility/post_url_parser.rb +24 -0
  49. data/lib/vk_music/utility/profile_id_resolver.rb +58 -0
  50. data/lib/vk_music/utility/wall_loader.rb +25 -0
  51. data/lib/vk_music/version.rb +7 -5
  52. data/lib/vk_music/web_parser.rb +9 -0
  53. data/lib/vk_music/web_parser/artist.rb +16 -0
  54. data/lib/vk_music/web_parser/audios_reload.rb +20 -0
  55. data/lib/vk_music/web_parser/base.rb +27 -0
  56. data/lib/vk_music/web_parser/login.rb +13 -0
  57. data/lib/vk_music/web_parser/my_page.rb +19 -0
  58. data/lib/vk_music/web_parser/playlist.rb +33 -0
  59. data/lib/vk_music/web_parser/playlist_section.rb +53 -0
  60. data/lib/vk_music/web_parser/post.rb +15 -0
  61. data/lib/vk_music/web_parser/profile.rb +33 -0
  62. data/lib/vk_music/web_parser/search.rb +56 -0
  63. data/lib/vk_music/web_parser/wall_section.rb +53 -0
  64. data/vk_music.gemspec +36 -40
  65. metadata +63 -77
  66. data/.travis.yml +0 -7
  67. data/bin/setup +0 -8
  68. data/lib/vk_music/constants.rb +0 -78
  69. data/lib/vk_music/exceptions.rb +0 -21
  70. data/lib/vk_music/link_decoder.rb +0 -102
  71. data/lib/vk_music/utility/log.rb +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49d94fb81d001d5d050d274f14ab6a3931467097adb46aa84601444fba4ac312
4
- data.tar.gz: b8b6433c2373a1229bf5e27e31d8bc5c7d4ae01840b0620f99e715707ddc665e
3
+ metadata.gz: 175777250336a247babea9660fef9e8b2dd070afb304bf4943f5a5f5706d4961
4
+ data.tar.gz: fb2421372d37fefc25dadb6823f06c4c7cb4b55cf961830dc3738435a0a758af
5
5
  SHA512:
6
- metadata.gz: ee9d28c4ef87b6fc12865ec267aeca8ddb24a9275c6c231f42fc68c6390b8fb9bfa8759f3d0f3b6f17e1d8e4ba8880b32976f987c0bde5edb4c1c3856a0a2ab1
7
- data.tar.gz: 48451ee22f080a93a0d8fea4fbb468f1c45b97bc089dc87675663d602092ba2fb255826ef3b127129b7d6fe8855751ee6bc3869e0c59ccc8e5e4c413eb9be45d
6
+ metadata.gz: a3aa8fe59c41de35155c0111cf2ff54cd3bcbc101490a2ae614ac54920773f3bed658a197f2bce829f95634475c0698272f3efbf806c5f0c422b08a33d5ef607
7
+ data.tar.gz: a3e462914a5123ed99aa9eb23f0e13b011b9dd7593a4046c139d0d399ff33a9051efb09def9d6940545ab293c6e7e1e6a798d78b4976b7359b7f3f7aafae5b10
@@ -0,0 +1,3 @@
1
+ # VkMusic spcification loads ENV variables from .env files
2
+ VK_LOGIN=+79991234567
3
+ VK_PASSWORD=password
@@ -0,0 +1,35 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - name: Set up Ruby
24
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
25
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
26
+ # uses: ruby/setup-ruby@v1
27
+ uses: ruby/setup-ruby@v1.52.0
28
+ with:
29
+ ruby-version: 2.7.2
30
+ - name: Install dependencies
31
+ run: bundle install
32
+ - name: Run rubocop
33
+ run: bundle exec rake rubocop
34
+ - name: Run yarddoc
35
+ run: bundle exec rake yard
data/.gitignore CHANGED
@@ -1,8 +1,14 @@
1
+ /.env
2
+ /.byebug_history
1
3
  /.bundle/
4
+ /.legacy/
2
5
  /.yardoc
3
6
  /_yardoc/
4
7
  /coverage/
5
8
  /doc/
6
9
  /pkg/
7
10
  /spec/reports/
11
+ /spec/.cookies
12
+ /spec/cassetes/*
13
+ !/spec/cassetes/README.md
8
14
  /tmp/
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
@@ -0,0 +1,56 @@
1
+ # The behavior of RuboCop can be controlled via the .rubocop.yml
2
+ # configuration file. It makes it possible to enable/disable
3
+ # certain cops (checks) and to alter their behavior if they accept
4
+ # any parameters. The file can be placed either in your home
5
+ # directory or in some project directory.
6
+ #
7
+ # RuboCop will start looking for the configuration file in the directory
8
+ # where the inspected file is and continue its way up to the root directory.
9
+ #
10
+ # See https://docs.rubocop.org/rubocop/configuration
11
+
12
+ AllCops:
13
+ TargetRubyVersion: 2.7
14
+ EnabledByDefault: true
15
+
16
+ Layout/FirstMethodParameterLineBreak:
17
+ Enabled: false
18
+ Layout/FirstMethodArgumentLineBreak:
19
+ Enabled: false
20
+ Layout/MultilineMethodArgumentLineBreaks:
21
+ Enabled: false
22
+ Layout/EndOfLine:
23
+ Enabled: false
24
+ Layout/EndAlignment:
25
+ EnforcedStyleAlignWith: variable
26
+ Layout/FirstHashElementIndentation:
27
+ Enabled: false
28
+ Layout/MultilineAssignmentLayout:
29
+ EnforcedStyle: same_line
30
+ Layout/CaseIndentation:
31
+ EnforcedStyle: end
32
+ Lint/ConstantResolution:
33
+ Enabled: false
34
+ Metrics/ParameterLists:
35
+ Enabled: false
36
+ Metrics/BlockLength:
37
+ Exclude:
38
+ - 'spec/**/*_spec.rb'
39
+ Style/MethodCallWithArgsParentheses:
40
+ Enabled: false
41
+ Style/Copyright:
42
+ Enabled: false
43
+ Style/ClassVars:
44
+ Enabled: false
45
+ Style/MissingElse:
46
+ Enabled: false
47
+ Style/StringHashKeys:
48
+ Enabled: false
49
+ Style/ImplicitRuntimeError:
50
+ Enabled: false
51
+ Style/NumericLiterals:
52
+ Enabled: false
53
+ Style/DisableCopsWithinSourceCodeDirective:
54
+ Enabled: false
55
+ Layout/MultilineHashKeyLineBreaks:
56
+ Enabled: false
data/Gemfile CHANGED
@@ -1,10 +1,38 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in vk_music.gemspec
4
- gemspec
5
-
6
- gem "logger", "~> 1.4"
7
-
8
- gem "mechanize", "~> 2.7"
9
-
10
- gem "pry", "~> 0.12.2"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in vk_music.gemspec
6
+ gemspec
7
+
8
+ group :test, :development do
9
+ # Debugging console
10
+ gem 'pry'
11
+
12
+ # Another debugging console
13
+ gem 'byebug'
14
+
15
+ # The thing, forcing you to write good code
16
+ gem 'rubocop', require: false
17
+
18
+ # Rake tasks
19
+ gem 'rake', require: false
20
+
21
+ # Testing
22
+ gem 'rspec', require: false
23
+
24
+ # Docs
25
+ gem 'yard', require: false
26
+
27
+ # .env support
28
+ gem 'dotenv'
29
+
30
+ # Save web requests for fast and reliable testing
31
+ gem 'vcr'
32
+
33
+ # Stub web requests
34
+ gem 'webmock'
35
+
36
+ # Test coverage
37
+ gem 'simplecov', require: false, group: :test
38
+ end
@@ -1,70 +1,124 @@
1
- PATH
2
- remote: .
3
- specs:
4
- vk_music (3.1.7)
5
- execjs (~> 2.7)
6
- json (~> 2.0)
7
- logger (~> 1.4)
8
- mechanize (~> 2.7)
9
- net-http-persistent (= 2.9.4)
10
-
11
- GEM
12
- remote: https://rubygems.org/
13
- specs:
14
- coderay (1.1.3)
15
- domain_name (0.5.20190701)
16
- unf (>= 0.0.5, < 1.0.0)
17
- execjs (2.7.0)
18
- http-cookie (1.0.3)
19
- domain_name (~> 0.5)
20
- json (2.3.1)
21
- logger (1.4.2)
22
- mechanize (2.7.6)
23
- domain_name (~> 0.5, >= 0.5.1)
24
- http-cookie (~> 1.0)
25
- mime-types (>= 1.17.2)
26
- net-http-digest_auth (~> 1.1, >= 1.1.1)
27
- net-http-persistent (>= 2.5.2)
28
- nokogiri (~> 1.6)
29
- ntlm-http (~> 0.1, >= 0.1.1)
30
- webrobots (>= 0.0.9, < 0.2)
31
- method_source (0.9.2)
32
- mime-types (3.3.1)
33
- mime-types-data (~> 3.2015)
34
- mime-types-data (3.2020.0512)
35
- mini_portile2 (2.4.0)
36
- minitest (5.14.1)
37
- net-http-digest_auth (1.4.1)
38
- net-http-persistent (2.9.4)
39
- nokogiri (1.10.10)
40
- mini_portile2 (~> 2.4.0)
41
- nokogiri (1.10.10-x64-mingw32)
42
- mini_portile2 (~> 2.4.0)
43
- ntlm-http (0.1.1)
44
- pry (0.12.2)
45
- coderay (~> 1.1.0)
46
- method_source (~> 0.9.0)
47
- rake (13.0.1)
48
- unf (0.1.4)
49
- unf_ext
50
- unf_ext (0.0.7.7)
51
- unf_ext (0.0.7.7-x64-mingw32)
52
- webrobots (0.1.2)
53
- yard (0.9.25)
54
-
55
- PLATFORMS
56
- ruby
57
- x64-mingw32
58
-
59
- DEPENDENCIES
60
- bundler (~> 2.0)
61
- logger (~> 1.4)
62
- mechanize (~> 2.7)
63
- minitest (~> 5.0)
64
- pry (~> 0.12.2)
65
- rake (~> 13.0)
66
- vk_music!
67
- yard (~> 0.9)
68
-
69
- BUNDLED WITH
70
- 2.1.4
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ vk_music (4.1.0)
5
+ execjs (~> 2.7)
6
+ json (~> 2.3)
7
+ logger (~> 1.4)
8
+ mechanize (~> 2.7)
9
+ net-http-persistent (= 2.9.4)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ addressable (2.7.0)
15
+ public_suffix (>= 2.0.2, < 5.0)
16
+ ast (2.4.1)
17
+ byebug (11.1.3)
18
+ coderay (1.1.3)
19
+ crack (0.4.5)
20
+ rexml
21
+ diff-lcs (1.4.4)
22
+ docile (1.3.4)
23
+ domain_name (0.5.20190701)
24
+ unf (>= 0.0.5, < 1.0.0)
25
+ dotenv (2.7.6)
26
+ execjs (2.7.0)
27
+ hashdiff (1.0.1)
28
+ http-cookie (1.0.3)
29
+ domain_name (~> 0.5)
30
+ json (2.5.1)
31
+ logger (1.4.3)
32
+ mechanize (2.7.6)
33
+ domain_name (~> 0.5, >= 0.5.1)
34
+ http-cookie (~> 1.0)
35
+ mime-types (>= 1.17.2)
36
+ net-http-digest_auth (~> 1.1, >= 1.1.1)
37
+ net-http-persistent (>= 2.5.2)
38
+ nokogiri (~> 1.6)
39
+ ntlm-http (~> 0.1, >= 0.1.1)
40
+ webrobots (>= 0.0.9, < 0.2)
41
+ method_source (1.0.0)
42
+ mime-types (3.3.1)
43
+ mime-types-data (~> 3.2015)
44
+ mime-types-data (3.2020.1104)
45
+ mini_portile2 (2.5.0)
46
+ net-http-digest_auth (1.4.1)
47
+ net-http-persistent (2.9.4)
48
+ nokogiri (1.11.0)
49
+ mini_portile2 (~> 2.5.0)
50
+ racc (~> 1.4)
51
+ ntlm-http (0.1.1)
52
+ parallel (1.20.1)
53
+ parser (3.0.0.0)
54
+ ast (~> 2.4.1)
55
+ pry (0.13.1)
56
+ coderay (~> 1.1)
57
+ method_source (~> 1.0)
58
+ public_suffix (4.0.6)
59
+ racc (1.5.2)
60
+ rainbow (3.0.0)
61
+ rake (13.0.3)
62
+ regexp_parser (2.0.3)
63
+ rexml (3.2.4)
64
+ rspec (3.10.0)
65
+ rspec-core (~> 3.10.0)
66
+ rspec-expectations (~> 3.10.0)
67
+ rspec-mocks (~> 3.10.0)
68
+ rspec-core (3.10.1)
69
+ rspec-support (~> 3.10.0)
70
+ rspec-expectations (3.10.1)
71
+ diff-lcs (>= 1.2.0, < 2.0)
72
+ rspec-support (~> 3.10.0)
73
+ rspec-mocks (3.10.1)
74
+ diff-lcs (>= 1.2.0, < 2.0)
75
+ rspec-support (~> 3.10.0)
76
+ rspec-support (3.10.1)
77
+ rubocop (1.7.0)
78
+ parallel (~> 1.10)
79
+ parser (>= 2.7.1.5)
80
+ rainbow (>= 2.2.2, < 4.0)
81
+ regexp_parser (>= 1.8, < 3.0)
82
+ rexml
83
+ rubocop-ast (>= 1.2.0, < 2.0)
84
+ ruby-progressbar (~> 1.7)
85
+ unicode-display_width (>= 1.4.0, < 2.0)
86
+ rubocop-ast (1.4.0)
87
+ parser (>= 2.7.1.5)
88
+ ruby-progressbar (1.11.0)
89
+ simplecov (0.21.1)
90
+ docile (~> 1.1)
91
+ simplecov-html (~> 0.11)
92
+ simplecov_json_formatter (~> 0.1)
93
+ simplecov-html (0.12.3)
94
+ simplecov_json_formatter (0.1.2)
95
+ unf (0.1.4)
96
+ unf_ext
97
+ unf_ext (0.0.7.7)
98
+ unicode-display_width (1.7.0)
99
+ vcr (6.0.0)
100
+ webmock (3.11.0)
101
+ addressable (>= 2.3.6)
102
+ crack (>= 0.3.2)
103
+ hashdiff (>= 0.4.0, < 2.0.0)
104
+ webrobots (0.1.2)
105
+ yard (0.9.26)
106
+
107
+ PLATFORMS
108
+ ruby
109
+
110
+ DEPENDENCIES
111
+ byebug
112
+ dotenv
113
+ pry
114
+ rake
115
+ rspec
116
+ rubocop
117
+ simplecov
118
+ vcr
119
+ vk_music!
120
+ webmock
121
+ yard
122
+
123
+ BUNDLED WITH
124
+ 2.1.4
File without changes
data/README.md CHANGED
@@ -1,94 +1,121 @@
1
- # VkMusic
2
-
3
- *vk_music* gem is a library to work with audios on popular Russian social network [vk.com](https://www.vk.com "vk.com"). VK disabled their public API for audios, so it is now necessary to use parsers instead.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'vk_music'
11
- ```
12
-
13
- And then execute:
14
-
15
- $ bundle
16
-
17
- Or install it yourself as:
18
-
19
- $ gem install vk_music
20
-
21
- ## Usage
22
-
23
- You can take a look on documentation [here](https://www.rubydoc.info/gems/vk_music/).
24
-
25
- ### Logging in
26
- Firstly, it is required to create new *VkMusic::Client* and provide login credentials:
27
-
28
- ```ruby
29
- client = VkMusic::Client.new(username: "+71234567890", password: "password")
30
- ```
31
-
32
- ### Searching for audios
33
- You can search audios by name with following method:
34
-
35
- ```ruby
36
- audios = client.find("Acid Spit - Mega Drive")
37
- puts audios[0] # Basic information about audio
38
- puts audios[0].url # URL to access audio. Notice that it is only accessible from your IP
39
- ```
40
-
41
- ### Parsing playlists
42
- You can load all the audios from playlist using following method:
43
-
44
- ```ruby
45
- playlist = client.playlist(url: "https://vk.com/audio?z=audio_playlist-37661843_1/0e420c32c8b69e6637")
46
- last_audios = playlist.first(10) # => Array<Audio>
47
- client.update_urls(last_audios) # We have to manually retrieve URLs for playlists
48
- urls = last_audios.map(&:url) # URLs for every audio
49
- ```
50
-
51
- ### User or group audios
52
- You can load audios from user or group page. Those audios will be returned as playlist. To do it simply pass user or group id:
53
-
54
- ```ruby
55
- playlist = client.audios(owner_id: 8024985)
56
- last_audios = playlist.first(10) # => Array<Audio>
57
- client.update_urls(last_audios) # We have to manually retrieve URLs for playlists
58
- urls = last_audios.map(&:url) # URLs for every audio
59
- ```
60
- You can set how many audios you actually need as well:
61
-
62
- ```ruby
63
- user_playlist = client.audios(url: "vk.com/id8024985", up_to: 10)
64
- ```
65
-
66
- ### Audios from post
67
- You can load up to 10 audios attached to some post. Those audios will be returned as array:
68
-
69
- ```ruby
70
- audios = client.post(url: "https://vk.com/wall-4790861_5453")
71
- urls = audios.map(&:url) # URLs for every audio
72
- ```
73
-
74
- ### Recommended audios and etc
75
- You can load audios from recommended sections, novices and VK charts:
76
-
77
- ```ruby
78
- audios = client.block(url: "https://m.vk.com/audio?act=block&block=PUlQVA8GR0R3W0tMF2teRGpJUVQPGVpfdF1YRwMGXUpkXktMF2tYUWRHS0IXDlpKZFpcVA8FFg")
79
- ```
80
-
81
-
82
- ## Development
83
-
84
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
85
-
86
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
87
-
88
- ## Contributing
89
-
90
- Bug reports and pull requests are welcome on GitHub at https://github.com/fizvlad/vk-music-rb/issues.
91
-
92
- ## License
93
-
94
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
1
+ ![Gem](https://img.shields.io/gem/v/vk_music) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/fizvlad/vk-music-rb/Ruby) ![Lines of code](https://img.shields.io/tokei/lines/github/fizvlad/vk-music-rb) ![Gem](https://img.shields.io/gem/dtv/vk_music)
2
+
3
+ # VkMusic
4
+
5
+ *vk_music* gem is a library to work with audios on popular Russian social network
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'vk_music'
13
+ ```
14
+
15
+ And then execute:
16
+ ```
17
+ $ bundle
18
+ ```
19
+
20
+ Or install it using `gem`:
21
+
22
+ ```
23
+ $ gem install vk_music
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ You can take a look on documentation at [rubydoc](https://www.rubydoc.info/gems/vk_music/).
29
+
30
+ ### Logging in
31
+
32
+ Firstly, it is required to create new `VkMusic::Client` instance and provide login credentials:
33
+
34
+ ```ruby
35
+ client = VkMusic::Client.new(username: "+79991234567", password: "password")
36
+ ```
37
+
38
+ ### Search
39
+
40
+ You can search audios using `Client#find`:
41
+
42
+ ```ruby
43
+ audios = client.find("Acid Spit - Mega Drive")
44
+ ```
45
+
46
+ You can also search for playlists using same method:
47
+
48
+ ```ruby
49
+ playlists = client.find("Jazz", type: :playlist)
50
+ ```
51
+
52
+ ### Playlists
53
+
54
+ You can load playlist audios with `Client#playlist`
55
+
56
+ ```ruby
57
+ playlist = client.playlist(url: "link")
58
+ ```
59
+
60
+ ### User or group audios
61
+
62
+ You can load profile audios with `Client#audios`
63
+
64
+ ```ruby
65
+ playlist = client.audios(owner_id: 8024985)
66
+ ```
67
+
68
+ ### Wall audios
69
+
70
+ You can load audios from profile wall with `Client#wall`
71
+
72
+ ```ruby
73
+ playlist = client.wall(owner_id: 8024985)
74
+ ```
75
+
76
+ ### Audios from post
77
+
78
+ You can load up to 10 audios attached to some post. Those audios will be returned as array:
79
+
80
+ ```ruby
81
+ audios = client.post(url: "link")
82
+ ```
83
+
84
+ ### Artist audios
85
+
86
+ You can get up to 50 top audios of particular artist:
87
+
88
+ ```ruby
89
+ audios = client.artist(url: "link")
90
+ ```
91
+
92
+ ### Getting audio URL
93
+
94
+ To get audio URL you should go through following chain:
95
+ 1. Get audio ID
96
+ 2. Get audio encrypted URL
97
+ 3. Get audio decrypted URL
98
+
99
+ Usually most of audios already go with ID. Getting encrypted URL requires additional request to web, so it is performed with `Client#update_urls`, which will mutate provided array of audios:
100
+
101
+ ```ruby
102
+ client.update_urls(audios_array)
103
+ ```
104
+
105
+ After this you can get decrypted URL using `Audio#url`
106
+
107
+ ## Development
108
+
109
+ Feel free to add features. However, please make sure all your code is covered with tests.
110
+
111
+ ### Testing
112
+
113
+ This gem uses `rspec` and `vcr` for easy testing. *Be careful*, though, running `rspec` in clean repo may result in lot of requests to web and rate limiting or ban
114
+
115
+ ## Contributing
116
+
117
+ Bug reports and pull requests are welcome on GitHub at https://github.com/fizvlad/vk-music-rb/issues.
118
+
119
+ ## License
120
+
121
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).