Advertisement
Guest User

vk dl music

a guest
Apr 29th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. var q = function() {
  2. var el = document.getElementsByClassName("audio_row_current")[0].id.replace('audio_', '');
  3. var ans = {};
  4. $.ajax({
  5. url: 'https://vk.com/al_audio.php',
  6. method: 'POST',
  7. data: {
  8. act: 'reload_audio',
  9. al: 1,
  10. ids: el
  11. },
  12. success: function(response) {
  13. try {
  14. var json = response.replace(/^.*(\[\[.*\]\]).*$/, "$1");
  15. json = JSON.parse(json);
  16. if (json) {
  17. json.forEach(function(row) {
  18. ans = row;
  19. oh();
  20. });
  21. }
  22. } catch (e) {
  23. console.log("Error:", e);
  24. }
  25. }
  26. });
  27.  
  28. function oh() {
  29. var a = document.createElement("a");
  30. var title = ans[4] + " - " + ans[3] + ".mp3";
  31. ans[2] = getAudioUrl(ans[2]);
  32. a.id = "FUCKYOU";
  33. a.download = title;
  34. a.title = title;
  35. a.href = ans[2] + "?/" + title;
  36. a.click();
  37. }
  38. };
  39. function getAudioUrl(url) {
  40. function checkParams(data, callback) {
  41. if (typeof data == 'object' || "undefined" == typeof data.length) {
  42. for (var c in data)
  43. if (Object.prototype.hasOwnProperty.call(data, c) && callback.call(data[c], c, data[c]) === !1)break
  44. } else for (var e = 0, f = data.length; f > e; e++) {
  45. var g = data[e];
  46. if (callback.call(g, e, g) === !1)break
  47. }
  48. return data
  49. }
  50.  
  51. function encodeKey(data) {
  52. if (!data || data.length % 4 == 1)return !1;
  53. for (var b, c, d = 0, e = 0, f = ""; c = data.charAt(e++);)c = alphaTable.indexOf(c), ~c && (b = d % 4 ? 64 * b + c : c, d++ % 4) && (f += String.fromCharCode(255 & b >> (-2 * d & 6)));
  54. return f
  55. }
  56.  
  57. var alphaTable = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN0PQRSTUVWXYZO123456789+/=",
  58. decodeByType = {
  59. v: function (a) {
  60. return a.split("").reverse().join("")
  61. }, r: function (a, b) {
  62. a = a.split("");
  63. for (var c, d = alphaTable + alphaTable, e = a.length; e--;)c = d.indexOf(a[e]), ~c && (a[e] = d.substr(c - b, 1));
  64. return a.join("")
  65. }, x: function (a, b) {
  66. //console.log("user X decoder");
  67. var c = [];
  68. return b = b.charCodeAt(0), checkParams(a.split(""), function (a, d) {
  69. c.push(String.fromCharCode(d.charCodeAt(0) ^ b))
  70. }), c.join("")
  71. }
  72. };
  73.  
  74. if (url.indexOf("audio_api_unavailable") > -1) {
  75. var decodedUrl = url.split("?extra=")[1].split("#"),
  76. encodedKey = encodeKey(decodedUrl[1]);
  77.  
  78. if (decodedUrl = encodeKey(decodedUrl[0]), !encodedKey || !decodedUrl)return url;
  79. encodedKey = encodedKey.split(String.fromCharCode(9));
  80.  
  81. for (var coderType, data, len = encodedKey.length; len--;) {
  82. if (data = encodedKey[len].split(String.fromCharCode(11)),
  83. coderType = data.splice(0, 1, decodedUrl)[0],
  84. !decodeByType[coderType])
  85. return url;
  86. decodedUrl = decodeByType[coderType].apply(null, data)
  87. }
  88. if (decodedUrl && "http" === decodedUrl.substr(0, 4))
  89. return decodedUrl
  90. }
  91. return url
  92. }
  93. var z = function() {
  94. var s = document.createElement('script');
  95. s.src = "https://code.jquery.com/jquery-2.1.4.min.js";
  96. document.body.appendChild(s);
  97. window.setTimeout(q, 1000);
  98. };
  99. if (typeof $ === "function") {
  100. if (typeof $.ajax === "function") {
  101. q();
  102. console.log(1);
  103. } else {
  104. z();
  105. console.log(2);
  106. }
  107. } else {
  108. z();
  109. console.log(3);
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement