Vk Media Downloader

Download music, video from vk.com (Vkontakte) without any external service

< Feedback on Vk Media Downloader

Review: Good - script works

§
Posted: 2020-11-19
Edited: 2020-12-03
UPDATE: v3.4.1 appears to have fixed it, great work and thanks so much for the swift response!

This script has been amazingly useful and works perfectly most of the time, but in recent versions, some songs on VK will fail to show tooltip information or begin downloading. (Attached an image of the blank tooltip) It seems to happen with specific songs and not others, there is no way to tell in advance which ones won't work. The songs are definitely available and not blocked, as they can be played in the browser (have also tried this on more than one different browser; have tried with different region proxies too).

Debug log from an example of mousing over the download button on one such song:

debug: [2020-11-19T22:53:17.334Z] [observer] enter audio -2001426247_57426247 , data = {}
debug: [2020-11-19T22:53:17.338Z] EVENT ["audio_data_request","-2001426247_57426247"]
debug: [2020-11-19T22:53:17.340Z] fetch audio data ["-2001426247_57426247"] ["-2001426247_57426247_454b11e9443d72ef3b_306dd4f9be4f3ac791"]
debug: [2020-11-19T22:53:17.343Z] makeRequest options {"method":"POST","url":"https://vk.com/al_audio.php","headers":{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},"data":"al=1&act=reload_audio&ids=-2001426247_57426247_454b11e9443d72ef3b_306dd4f9be4f3ac791"} {"useGM":false}
debug: [2020-11-19T22:53:17.356Z] createTip -2001426247_57426247 {"full_id":"-2001426247_57426247","hash_id":"-2001426247_57426247_454b11e9443d72ef3b_306dd4f9be4f3ac791","fetching":true}
debug: [2020-11-19T22:53:17.377Z] mediaObserver unhandled node: [HTMLElement:
]
debug: [2020-11-19T22:53:17.496Z] makeRequest response: {"ok":true,"headers":{"access-control-expose-headers":"X-Frontend","cache-control":"no-store","content-encoding":"gzip","content-length":"1301","content-type":"application/json; charset=windows-1251","date":"Thu, 19 Nov 2020 225319 GMT","server":"kittenx","status":"200","strict-transport-security":"max-age=15768000","x-frontend":"front623305","x-powered-by":"KPHP/7.4.27256"},"status":200,"data":{"payload":[0,[[[57426247,-2001426247,"https://vk.com/mp3/audio_api_unavailable.mp3?extra=zwfmowncExP5mujynJq6C3u5zOK3C2TYztLfDhHVAtmWB1DInJ9NnMrgm1i4luT0Eue4ms1UDc8WmuTHowvPB3rMx3HNngrVmtnJDKLWAwTZtJLOjMf6vM5SnKDTqKv1B1G4uxPIzty3ofvZnvzXAhjZm2qWDxvrD2rPvgSXxZfKl2vAtKv4vMO4B1G5txnZlZrTyI9tCMfwz1z1sfGXlLHUDM9WmdjMyuj0ttKTB2W3ztfJlZnnrJrMt18YmeuOmxrZmw9sDtjzAu1AEM49utj5mJbxu1LYtJHntwzMngrllOOWvs5pohPingLKAgGUlOfpALiWrOOZq29Ol2u9rvzmmMrWBNvjmW#AqS4odi","[track name]","[artist name]",162,-1,0,"",0,98,"","[]","6a54dd93f73809a9f2//454b11e9443d72ef3b///306dd4f9be4f3ac791/","https://sun9-45.userapi.com/c851420/v851420374/1ee6be/e154xUwdais.jpg,https://sun9-23.userapi.com/c851420/v851420374/1ee6bb/Igt80zp-azs.jpg",{"duration":162,"content_id":"-2001426247_57426247","puid22":14,"account_age_type":3,"_SITEID":276,"vk_id":265979399,"ver":251116},"Original Mix",[{"id":"1390689834950734681","name":"[artist name]"}],"",[-2000899277,5899277,"e74aa38758584b19da"],"808fc6c23tQaWgVPKF48XCz_qhh1HqS1w6U",0,0,true,"37c4c4cd9cafaf1493",false]],{"265979399":1},"26bba5980be0f89d70",[]]],"statsMeta":{"platform":"web2","st":false,"time":1605826399,"hash":"RjVg5JuKPa0kzG3MgSaxwV2tn06WIu14XjxHkuQtUuc"},"loaderVersion":"12130065","langPack":3,"langVersion":"4402","langKeys":{"global":[],"local":{"audio_delete_audio":"Delete track","audio_dont_show":"Stop suggesting","audio_performers_only":"by artist","audio_open_album":"Open album","audio_titles_search":"by title","audio_global_search_found":["","%s audio file found","%s audio files found"],"audio_site_rules_violation_warning":"{audio} has been removed from public access for violating the VK Terms of Service.","audio_site_rules_violation_header":"Prohibited audio file"}},"templates":{"_":"_","audio_bits_to_cls":"{\"1\":\"audio_has_lyrics\",\"2\":\"audio_can_add\",\"4\":\"audio_claimed\",\"8\":\"audio_from_queue\",\"16\":\"audio_hq\",\"1024\":\"audio_explicit\",\"32\":\"audio_lpb\",\"64\":\"audio_has_thumb\",\"256\":\"audio_moder_claimed\",\"2048\":\"audio_focus\",\"4096\":\"audio_module_wide\"}"}},"finalUrl":"https://vk.com/al_audio.php","rawData":"{\"payload\":[0,[[[57426247,-2001426247,\"https:\\/\\/vk.com\\/mp3\\/audio_api_unavailable.mp3?extra=zwfmowncExP5mujynJq6C3u5zOK3C2TYztLfDhHVAtmWB1DInJ9NnMrgm1i4luT0Eue4ms1UDc8WmuTHowvPB3rMx3HNngrVmtnJDKLWAwTZtJLOjMf6vM5SnKDTqKv1B1G4uxPIzty3ofvZnvzXAhjZm2qWDxvrD2rPvgSXxZfKl2vAtKv4vMO4B1G5txnZlZrTyI9tCMfwz1z1sfGXlLHUDM9WmdjMyuj0ttKTB2W3ztfJlZnnrJrMt18YmeuOmxrZmw9sDtjzAu1AEM49utj5mJbxu1LYtJHntwzMngrllOOWvs5pohPingLKAgGUlOfpALiWrOOZq29Ol2u9rvzmmMrWBNvjmW#AqS4odi\",\"[track name]\",\"[artist name]\",162,-1,0,\"\",0,98,\"\",\"[]\",\"6a54dd93f73809a9f2\\/\\/454b11e9443d72ef3b\\/\\/\\/306dd4f9be4f3ac791\\/\",\"https:\\/\\/sun9-45.userapi.com\\/c851420\\/v851420374\\/1ee6be\\/e154xUwdais.jpg,https:\\/\\/sun9-23.userapi.com\\/c851420\\/v851420374\\/1ee6bb\\/Igt80zp-azs.jpg\",{\"duration\":162,\"content_id\":\"-2001426247_57426247\",\"puid22\":14,\"account_age_type\":3,\"_SITEID\":276,\"vk_id\":265979399,\"ver\":251116},\"Original Mix\",[{\"id\":\"1390689834950734681\",\"name\":\"[artist name]\"}],\"\",[-2000899277,5899277,\"e74aa38758584b19da\"],\"808fc6c23tQaWgVPKF48XCz_qhh1HqS1w6U\",0,0,true,\"37c4c4cd9cafaf1493\",false]],{\"265979399\":1},\"26bba5980be0f89d70\",[]]],\"statsMeta\":{\"platform\":\"web2\",\"st\":false,\"time\":1605826399,\"hash\":\"RjVg5JuKPa0kzG3MgSaxwV2tn06WIu14XjxHkuQtUuc\"},\"loaderVersion\":\"12130065\",\"langPack\":3,\"langVersion\":\"4402\",\"langKeys\":{\"global\":[],\"local\":{\"audio_delete_audio\":\"Delete track\",\"audio_dont_show\":\"Stop suggesting\",\"audio_performers_only\":\"by artist\",\"audio_open_album\":\"Open album\",\"audio_titles_search\":\"by title\",\"audio_global_search_found\":[\"\",\"%s audio file found\",\"%s audio files found\"],\"audio_site_rules_violation_warning\":\"{audio} has been removed from public access for violating the VK Terms of Service.\",\"audio_site_rules_violation_header\":\"Prohibited audio file\"}},\"templates\":{\"_\":\"_\",\"audio_bits_to_cls\":\"{\\\"1\\\":\\\"audio_has_lyrics\\\",\\\"2\\\":\\\"audio_can_add\\\",\\\"4\\\":\\\"audio_claimed\\\",\\\"8\\\":\\\"audio_from_queue\\\",\\\"16\\\":\\\"audio_hq\\\",\\\"1024\\\":\\\"audio_explicit\\\",\\\"32\\\":\\\"audio_lpb\\\",\\\"64\\\":\\\"audio_has_thumb\\\",\\\"256\\\":\\\"audio_moder_claimed\\\",\\\"2048\\\":\\\"audio_focus\\\",\\\"4096\\\":\\\"audio_module_wide\\\"}\"}}"} {"method":"POST","headers":{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},"url":"https://vk.com/al_audio.php","data":"al=1&act=reload_audio&ids=-2001426247_57426247_454b11e9443d72ef3b_306dd4f9be4f3ac791"}
info : [2020-11-19T22:53:17.502Z] name: [artist name] - [track name]
debug: [2020-11-19T22:53:17.563Z] hls fragments 9 [2,4,20,20,20,20,20,20,36.429]
debug: [2020-11-19T22:53:17.565Z] hls duration 162.429
debug: [2020-11-19T22:53:17.566Z] makeRequest options {"method":"GET","url":"https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/audios/f9fedabb832e/51c2hsIj0qaz0.ts?extra=10AXmxUQmi12qWQM3hdRVXBI1d5zS82-0Ndgysdwo0VOB8zEM2hjL8RsCYiMiBN-lOz_foro7z7IKF3EoZ2gOVy1bMtMGBKsRW90yXg-ZGHMM_TXNAVUL44sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1","responseType":"arraybuffer"} {"useGM":false}
debug: [2020-11-19T22:53:17.592Z] makeRequest response: {"ok":true,"headers":{"cache-control":"max-age=604800","content-length":"174840","content-type":"video/MP2T","expires":"Thu, 26 Nov 2020 223838 GMT","x-frontend":"front632906"},"status":200,"data":"[ArrayBuffer: [bytes:174840]]","finalUrl":"https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/audios/f9fedabb832e/51c2hsIj0qaz0.ts?extra=10AXmxUQmi12qWQM3hdRVXBI1d5zS82-0Ndgysdwo0VOB8zEM2hjL8RsCYiMiBN-lOz_foro7z7IKF3EoZ2gOVy1bMtMGBKsRW90yXg-ZGHMM_TXNAVUL44sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1","rawData":"[ArrayBuffer: [bytes:174840]]"} {"method":"GET","headers":{},"url":"https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/audios/f9fedabb832e/51c2hsIj0qaz0.ts?extra=10AXmxUQmi12qWQM3hdRVXBI1d5zS82-0Ndgysdwo0VOB8zEM2hjL8RsCYiMiBN-lOz_foro7z7IKF3EoZ2gOVy1bMtMGBKsRW90yXg-ZGHMM_TXNAVUL44sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1","responseType":"arraybuffer"}
debug: [2020-11-19T22:53:17.593Z] hls size 5.8 MiB
debug: [2020-11-19T22:53:17.597Z] makeRequest options {"method":"HEAD","url":"https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/f9fedabb832e.mp3?extra=10AXmxUQmi12qWQM3hdRVXBI1d5zS82-0Ndgysdwo0VOB8zEM2hjL8RsCYiMiBN-lOz_foro7z7IKF3EoZ2gOVy1bMtMGBKsRW90yXg-ZGHMM_TXNAVUL44sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1","headers":{"X-Requested-With":"XMLHttpRequest","Referer":"https://vk.com/search?c%5Bper_page%5D=200&c%5Bq%5D=bell%27s%20worth&c%5Bqid%5D=3972139546960463111&c%5Bsection%5D=audio"}} {"useGM":true}
debug: [2020-11-19T22:53:17.806Z] makeRequest response: {"ok":false,"headers":{"access-control-expose-headers":"X-Frontend","content-length":"408","content-type":"text/html","date":"Thu, 19 Nov 2020 225319 GMT","etag":"\"5f6a5ec9-198\"","server":"kittenx","status":"404","strict-transport-security":"max-age=15768000","x-frontend":"front632906"},"status":404,"data":{"location":null},"finalUrl":"https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/f9fedabb832e.mp3?extra=10AXmxUQmi12qWQM3hdRVXBI1d5zS82-0Ndgysdwo0VOB8zEM2hjL8RsCYiMiBN-lOz_foro7z7IKF3EoZ2gOVy1bMtMGBKsRW90yXg-ZGHMM_TXNAVUL44sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1"} {"method":"HEAD","headers":{"X-Requested-With":"XMLHttpRequest","Referer":"https://vk.com/search?c%5Bper_page%5D=200&c%5Bq%5D=bell%27s%20worth&c%5Bqid%5D=3972139546960463111&c%5Bsection%5D=audio"},"url":"https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/f9fedabb832e.mp3?extra=10AXmxUQmi12qWQM3hdRVXBI1d5zS82-0Ndgysdwo0VOB8zEM2hjL8RsCYiMiBN-lOz_foro7z7IKF3EoZ2gOVy1bMtMGBKsRW90yXg-ZGHMM_TXNAVUL44sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1"}
debug: [2020-11-19T22:53:17.807Z] iframeChannel event = 360280-audio_size {"event":"audio_size","url":"https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/f9fedabb832e.mp3?extra=10AXmxUQmi12qWQM3hdRVXBI1d5zS82-0Ndgysdwo0VOB8zEM2hjL8RsCYiMiBN-lOz_foro7z7IKF3EoZ2gOVy1bMtMGBKsRW90yXg-ZGHMM_TXNAVUL44sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1","id":360280}
debug: [2020-11-19T22:53:17.873Z] mediaObserver unhandled node: [HTMLElement:
]

The script finds the length and size of the hls but then doesn't go any further. (Clicking the button here just repeats the process, still with no result.)
When looking into the browser console (Edge in this case, the problem also occurs on Firefox) I found at this point an error kicks in:

[2020-11-19T22:53:17.873Z]
Failed to load resource: the server responded with a status of 404 ()
[2020-11-19T22:53:18.490Z] iframe onmessage: https://vk.com queue_connection_events_queue265979399:{"__client":"OTAyMDEw","__act":"check_ok","__rnd":0.45037474382518816}
[2020-11-19T22:53:18.822Z] child: https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/f9fedabb832e.mp…C%22id%22%3A360280%2C%22iframeId%22%3A%22iframe_psv4_vkuseraudio_net%22%7D
[Violation] '2P_78e996a4-6571-43b1-9af3-4e539ebf4db7' handler took 281ms
DevTools failed to load SourceMap: Could not load content for chrome-extension://iikmkjmpaadaobahmlepeloendndfphd/ffmpeg.min.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
[2020-11-19T22:53:18.841Z] iframe getSize https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/f9fedabb832e.mp…sRW90yXg-ZGHMM_TXNAVUL44sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1#
[2020-11-19T22:53:18.891Z] makeRequest options
{method: "HEAD", url: "https://psv4.vkuseraudio.net/c813638/u474499266/10…sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1"}

{useGM: false}
[2020-11-19T22:53:18.905Z] iframe sending..
{iframeId: "iframe_psv4_vkuseraudio_net", event: "iframe-ready"}
HEAD https://psv4.vkuseraudio.net/c813638/u474499266/106e4c96f00/f9fedabb832e.mp…KsRW90yXg-ZGHMM_TXNAVUL44sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1 404
[2020-11-19T22:53:19.032Z] makeRequest response:
{ok: false, problem: undefined, headers: {…}, status: 404, data: document, …}

{method: "HEAD", headers: {…}, url: "https://psv4.vkuseraudio.net/c813638/u474499266/10…sV3rkhtpMYFVzHn9aSX9yQuIo110oK1fEEoE&long_chunk=1"}
[2020-11-19T22:53:19.034Z] iframe sending..
{ok: false, problem: undefined, headers: {…}, status: 404, data: document, …}
[2020-11-19T22:53:19.035Z] iframe error: DOMException: Blocked a frame with origin "https://psv4.vkuseraudio.net" from accessing a cross-origin frame.
at console.debug ()
at Object.acc. [as debug] (chrome-extension://iikmkjmpaadaobahmlepeloendndfphd/userscript.html?name=Vk…dia%2520Downloader.user.js&id=058ff367-dc99-42b7-b9ea-38def5347af9:1194:27)
at Logger.debug (chrome-extension://iikmkjmpaadaobahmlepeloendndfphd/userscript.html?name=Vk…dia%2520Downloader.user.js&id=058ff367-dc99-42b7-b9ea-38def5347af9:1249:28)
at Object.sendMessage (chrome-extension://iikmkjmpaadaobahmlepeloendndfphd/userscript.html?name=Vk…dia%2520Downloader.user.js&id=058ff367-dc99-42b7-b9ea-38def5347af9:7403:14)
at eval (chrome-extension://iikmkjmpaadaobahmlepeloendndfphd/userscript.html?name=Vk…dia%2520Downloader.user.js&id=058ff367-dc99-42b7-b9ea-38def5347af9:7371:24)
at async Promise.all (index 2)


I assume the final iframe error message might have something to do with the problem but I don't know.

Thankful for any help you can give, and thanks for always delivering so many great updates to the script!
EisenSteinAuthor
§
Posted: 2020-11-21
Hi
Updated the script, check v3.4.1

Post reply

Sign in to post a reply.