fizvlad/vk-music-rb

Add SOCKS4/5, HTTPS proxy support

uenro opened this issue · 2 comments

uenro commented

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.

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 :)

Mechanize#set_proxy

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