vk_music 2.2.0 → 2.2.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: 6a40ac2ba500bdf24f6ccb6e645216bd4716458d5c795c8a65acc82887dd37a0
4
- data.tar.gz: 0ad38527b6a893916a904d3eca60f55aac5d534255cdcff1a0ff0f60ba0794e7
3
+ metadata.gz: 79ce8368cee1e94e3f1351753ba42167f2310148d22c96d274fa0056cda2e06d
4
+ data.tar.gz: ff35c242aaf9eecdc529eb478346a6e7883d1eb437d7f4fe163d36ebc893092a
5
5
  SHA512:
6
- metadata.gz: 408afa4efb6f4ca2b4deb6f7670775bd8569cebab42d6d825f7cd4f60a3503ebc53b415b5046ad69254ca4d4ffb526858428a23f4fde4ba2cdb81eee05c245db
7
- data.tar.gz: 64ee9349066a69fbef74d3b84cf03bea651bc30504eef7a009e243e5889bcf28be7281bbbfb8b20b491c2d748c2961531461c98a8c7966d0b0e3e8957b1eea97
6
+ metadata.gz: c08525601176055fb0c94f666f28a654cea22f196db413d4e9bd0a425e716bcc1752e1f4f9e6de87772d105db41629aa5bb149de5b8cfaa42f020f57038a4d4a
7
+ data.tar.gz: 7ccd31000b153925a63b69c6d796bfa9d58adf2c8b2fc1ed86c99024f913590bfcba32bb29b27c89c61cb630d6a540f55a4417051d8145601c2d7a5e732e4d9c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vk_music (2.2.0)
4
+ vk_music (2.2.1)
5
5
  execjs (~> 2.7)
6
6
  json (~> 2.0)
7
7
  logger (~> 1.4)
@@ -32,6 +32,7 @@ module VkMusic
32
32
  #
33
33
  # @option options [String] :username usually telephone number or email.
34
34
  # @option options [String] :password
35
+ # @option options [String] :user_agent (Constants::DEFAULT_USER_AGENT)
35
36
  def initialize(options = {})
36
37
  # Arguments check
37
38
  raise ArgumentError, "Options hash must be provided", caller unless options.class == Hash
@@ -40,6 +41,7 @@ module VkMusic
40
41
 
41
42
  # Setting up client
42
43
  @agent = Mechanize.new
44
+ @agent.user_agent = options[:user_agent] || Constants::DEFAULT_USER_AGENT
43
45
  login(options[:username], options[:password])
44
46
  end
45
47
 
@@ -704,7 +706,7 @@ module VkMusic
704
706
  def login(username, password)
705
707
  Utility.debug("Logging in.")
706
708
  # Loading login page
707
- homepage = load__page(Constants::URL::VK[:home])
709
+ homepage = load__page(Constants::URL::VK[:login])
708
710
  # Submitting login form
709
711
  login_form = homepage.forms.find { |form| form.action.start_with?(Constants::URL::VK[:login_action]) }
710
712
  login_form[Constants::VK_LOGIN_FORM_NAMES[:username]] = username.to_s
@@ -6,7 +6,7 @@ module VkMusic
6
6
 
7
7
  ##
8
8
  # Web user agent.
9
- # DEFAULT_USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1636.0 Safari/537.36"
9
+ DEFAULT_USER_AGENT = "Mozilla/5.0 (Linux; Android 5.1.1; Redmi 3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36 OPR/54.2.2672.49907"
10
10
 
11
11
  ##
12
12
  # Different URLs
@@ -2,6 +2,6 @@ module VkMusic
2
2
 
3
3
  ##
4
4
  # Library version.
5
- VERSION = "2.2.0"
5
+ VERSION = "2.2.1"
6
6
 
7
7
  end
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.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fizvlad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-15 00:00:00.000000000 Z
11
+ date: 2019-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler