module VkMusic::Utility::LinkDecoder
Link decoding utilities
Constants
- JS_CODE
JS code which creates function to unmask audio URL.
Public Class Methods
call(link, client_id)
click to toggle source
Unmask audio download URL @param link [String] encoded link to audio. Usually looks like
"https://m.vk.com/mp3/audio_api_unavailable.mp3?extra=...".
@param client_id [Integer] ID of user which got this link. ID is required for decoding. @return [String?] audio download URL, which can be used only from current IP.
# File lib/vk_music/utility/link_decoder.rb, line 98 def self.call(link, client_id) VkMusic.log.debug('LinkDecoder') { "Unmasking link `#{link}` with client id #{client_id}" } @@js_context.call('vk_unmask_link', link, client_id) rescue StandardError => e VkMusic.log.warn('LinkDecoder') { "Failed to decode link `#{link}`: #{e.full_message}" } nil end