Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Oct 14, 2023. It is now read-only.
/vk-music-rbPublic archive

Ruby library to work with popular Russian network audios. VK stands for Very Kool btw

License

NotificationsYou must be signed in to change notification settings

fizvlad/vk-music-rb

Repository files navigation

GemGitHub Workflow StatusLines of codeGem

VkMusic

vk_music gem is a library to work with audios on popular Russian social network

Installation

Add this line to your application's Gemfile:

gem'vk_music'

And then execute:

$ bundle

Or install it usinggem:

$ gem install vk_music

Usage

You can take a look on documentation atrubydoc.

Logging in

Firstly, it is required to create newVkMusic::Client instance and provide login credentials:

client=VkMusic::Client.new(username:"+79991234567",password:"password")

Search

You can search audios usingClient#find:

audios=client.find("Acid Spit - Mega Drive")

You can also search for playlists using same method:

playlists=client.find("Jazz",type::playlist)

Playlists

You can load playlist audios withClient#playlist

playlist=client.playlist(url:"link")

User or group audios

You can load profile audios withClient#audios

playlist=client.audios(owner_id:8024985)

Wall audios

You can load audios from profile wall withClient#wall

playlist=client.wall(owner_id:8024985)

Audios from post

You can load up to 10 audios attached to some post. Those audios will be returned as array:

audios=client.post(url:"link")

Artist audios

You can get up to 50 top audios of particular artist:

audios=client.artist(url:"link")

Getting audio URL

To get audio URL you should go through following chain:

  1. Get audio ID
  2. Get audio encrypted URL
  3. Get audio decrypted URL

Usually most of audios already go with ID. Getting encrypted URL requires additional request to web, so it is performed withClient#update_urls, which will mutate provided array of audios:

client.update_urls(audios_array)

After this you can get decrypted URL usingAudio#url

Development

Feel free to add features. However, please make sure all your code is covered with tests.

Testing

This gem usesrspec andvcr for easy testing.Be careful, though, runningrspec in clean repo may result in lot of requests to web and rate limiting or ban

Contributing

Bug reports and pull requests are welcome on GitHub athttps://github.com/fizvlad/vk-music-rb/issues.

License

The gem is available as open source under the terms of theMIT License.

About

Ruby library to work with popular Russian network audios. VK stands for Very Kool btw

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp