Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var q = function() {
- var el = document.getElementsByClassName("audio_row_current")[0].id.replace('audio_', '');
- var ans = {};
- $.ajax({
- url: 'https://vk.com/al_audio.php',
- method: 'POST',
- data: {
- act: 'reload_audio',
- al: 1,
- ids: el
- },
- success: function(response) {
- try {
- var json = response.replace(/^.*(\[\[.*\]\]).*$/, "$1");
- json = JSON.parse(json);
- if (json) {
- json.forEach(function(row) {
- ans = row;
- oh();
- });
- }
- } catch (e) {
- console.log("Error:", e);
- }
- }
- });
- function oh() {
- var a = document.createElement("a");
- var title = ans[4] + " - " + ans[3] + ".mp3";
- ans[2] = getAudioUrl(ans[2]);
- a.id = "FUCKYOU";
- a.download = title;
- a.title = title;
- a.href = ans[2] + "?/" + title;
- a.click();
- }
- };
- function getAudioUrl(url) {
- function checkParams(data, callback) {
- if (typeof data == 'object' || "undefined" == typeof data.length) {
- for (var c in data)
- if (Object.prototype.hasOwnProperty.call(data, c) && callback.call(data[c], c, data[c]) === !1)break
- } else for (var e = 0, f = data.length; f > e; e++) {
- var g = data[e];
- if (callback.call(g, e, g) === !1)break
- }
- return data
- }
- function encodeKey(data) {
- if (!data || data.length % 4 == 1)return !1;
- 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)));
- return f
- }
- var alphaTable = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN0PQRSTUVWXYZO123456789+/=",
- decodeByType = {
- v: function (a) {
- return a.split("").reverse().join("")
- }, r: function (a, b) {
- a = a.split("");
- for (var c, d = alphaTable + alphaTable, e = a.length; e--;)c = d.indexOf(a[e]), ~c && (a[e] = d.substr(c - b, 1));
- return a.join("")
- }, x: function (a, b) {
- //console.log("user X decoder");
- var c = [];
- return b = b.charCodeAt(0), checkParams(a.split(""), function (a, d) {
- c.push(String.fromCharCode(d.charCodeAt(0) ^ b))
- }), c.join("")
- }
- };
- if (url.indexOf("audio_api_unavailable") > -1) {
- var decodedUrl = url.split("?extra=")[1].split("#"),
- encodedKey = encodeKey(decodedUrl[1]);
- if (decodedUrl = encodeKey(decodedUrl[0]), !encodedKey || !decodedUrl)return url;
- encodedKey = encodedKey.split(String.fromCharCode(9));
- for (var coderType, data, len = encodedKey.length; len--;) {
- if (data = encodedKey[len].split(String.fromCharCode(11)),
- coderType = data.splice(0, 1, decodedUrl)[0],
- !decodeByType[coderType])
- return url;
- decodedUrl = decodeByType[coderType].apply(null, data)
- }
- if (decodedUrl && "http" === decodedUrl.substr(0, 4))
- return decodedUrl
- }
- return url
- }
- var z = function() {
- var s = document.createElement('script');
- s.src = "https://code.jquery.com/jquery-2.1.4.min.js";
- document.body.appendChild(s);
- window.setTimeout(q, 1000);
- };
- if (typeof $ === "function") {
- if (typeof $.ajax === "function") {
- q();
- console.log(1);
- } else {
- z();
- console.log(2);
- }
- } else {
- z();
- console.log(3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement