vk_music 4.1.5 → 4.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/console +1 -1
- data/lib/vk_music/utility/authorizer.rb +6 -6
- data/lib/vk_music/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 337cb0c1fa139bd4b9872dad678a25690ea46f8ef4f3699f5cc23917216e4bbd
|
4
|
+
data.tar.gz: 7aff1c6a20c69b353e3944016fab1023090d8f8976d887c9fb90bd675d19af3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 859f932430130e9951b62861c10e3c7930dc0bcaa0249f3531609a235ea07004c9a4caa1e89c69b648ce26abc01d55f82a320cc4a7a759541cbfe07e607cb1cd
|
7
|
+
data.tar.gz: 13974cec16d21151b9462a400984f491a071a6cfb40861b9242e1d7557f370d4b0c65355055b9371a1bc4c308e39da589e1592b6923bc62f201b239ecf961691
|
data/Gemfile.lock
CHANGED
data/bin/console
CHANGED
@@ -13,7 +13,7 @@ Dotenv.load
|
|
13
13
|
# Path to file where development cookies will be stored
|
14
14
|
AGENT_COOKIES_PATH = '.cookies'
|
15
15
|
|
16
|
-
agent = VkMusic::Utility::Authorizer.call(AGENT_COOKIES_PATH)
|
16
|
+
agent = VkMusic::Utility::Authorizer.call(ENV['VK_LOGIN'], ENV['VK_PASSWORD'], AGENT_COOKIES_PATH)
|
17
17
|
@client = VkMusic::Client.new(agent: agent)
|
18
18
|
|
19
19
|
IRB.start
|
@@ -7,12 +7,12 @@ module VkMusic
|
|
7
7
|
class << self
|
8
8
|
# @param cookie_path [string]
|
9
9
|
# @return [Mechanize] logged in Mechanize client
|
10
|
-
def call(cookie_path)
|
10
|
+
def call(login, password, cookie_path)
|
11
11
|
agent = Mechanize.new
|
12
12
|
if File.exist?(cookie_path)
|
13
13
|
load_cookie_jar(agent.cookie_jar, cookie_path)
|
14
14
|
else
|
15
|
-
login_agent(agent)
|
15
|
+
login_agent(agent, login, password)
|
16
16
|
end
|
17
17
|
agent.cookie_jar.save(cookie_path, session: true)
|
18
18
|
agent
|
@@ -34,10 +34,10 @@ module VkMusic
|
|
34
34
|
end
|
35
35
|
|
36
36
|
# Logs in provided agent
|
37
|
-
def login_agent(agent)
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
def login_agent(agent, login, password)
|
38
|
+
login_request = VkMusic::Request::Login.new
|
39
|
+
login_request.call(agent)
|
40
|
+
login_request.send_form(login, password, agent)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
data/lib/vk_music/version.rb
CHANGED