Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Add SOCKS4/5, HTTPS proxy support #5

Closed
uenro opened this issue Nov 8, 2019 · 2 comments
Closed

Add SOCKS4/5, HTTPS proxy support #5

uenro opened this issue Nov 8, 2019 · 2 comments

Comments

@uenro
Copy link

uenro commented Nov 8, 2019

Is there a way to download audios using proxy?
For example I want to download audios from several posts:
audios1 = client.post("https://vk.com/wall-4790861_5453")
audios1 = client.post("https://vk.com/wall-4790861_5458")
Can I add parameters for proxy for every post? This way for example:
audios = client.post("https://vk.com/wall-4790861_5453", type: "socks5", url: "192.168.0.3")

Or is it neccessary to specify proxy here?
client = VkMusic::Client.new(username: "+71234567890", password: "password", type: "socks5", url: "192.168.0.3")

P.S. I heard that VK audio urls are linked with clients IP but there is no confirmation that audio url is linked with certain user.

@fizvlad
Copy link
Owner

fizvlad commented Nov 8, 2019

Yeah, some audios might be blocked in several regions (it seems that it is best to use Moscow IP)

Mechanize library is used to send requests, so it is possible to use HTTP proxy by calling set_proxy method after creating of Mechanize agent.

Honestly, I currently spend most of my time on university, so you are welcome to create pull requests :)

@fizvlad
Copy link
Owner

fizvlad commented Nov 27, 2020

Mechanize#set_proxy

client = VkMusic::Client.new(username: "+79991234567", password: "password")
client.agent.set_proxy(address, port, user, password)

@fizvlad fizvlad closed this as completed Nov 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants