Thought this might help
|
|
I have some code from the old playlist.com that would get the local links. I've been looking over it, thinking about trying to remake it to work with the new search, but I figured since you've already started there was no sense in repeating the such. So, here it is:
function hexToChars (hex) {
function charsToStr (chars) {
function strToChars (str) {
function initialize (pwd) {
function calculate (plaintxt, psw) {
function decrypt (src, key) {
function getSongs() {
for (var i = 0; i < dev.snapshotLength; i ++) {
GM_addStyle('.marklink { display:none; } ');
|
|
|
Thanks. I hope they haven't changed their salt. //--Edit--//
|
![]() ![]() |
Lol glad to see somebody still had a copy of that script, although it is a really old version. This is one of my three controversial scripts (the other two are AmazonMp3/Playlist.com Mashup and Download Facebook Audio) that I deleted from userscripts.org for fear of legal ramifications. That decryption code is proprietary actionscript code that I took from a flash mp3 player ;) Somebody posted the latest version(2.2.1) I released on this site. The up-to-date version(2.2.2): http://pastebin.com/f208b6f0d And yes it does get the download links of an entire playlist. If you like you can just post my script. |
![]() ![]() |
Sounds good to me. I was considering writing in that functionality, just had been too busy to do so. |
![]() ![]() |
Here's an update of the script for the change in the site:
// ==UserScript==
// @name Download Songs from Project Playlist
// @namespace sizzlemctwizzle
// @description This script allows you to download ALL SONGS on playlist.com and has been updated to work with the latest update of the site.
// @version 2.2.2
// @include http://*.playlist.com/search*/tracks*
// ==/UserScript==
function getSongs() {
forEach($x('//li[starts-with(@id, "tracklink-") and not(@decrypted)]', $('results')), function(li, i) {
sbox = new Array(255);
mykey = new Array(255);
li.appendChild(create(' | '));
li.appendChild(create('a', { href: decrypt(unsafeWindow.trackdata[i].song_url, 'sdf883jsdf22'), innerHTML: "Download song" }));
li.setAttribute('decrypted', 'true');
});
}
function $(element) { return document.getElementById(element); }
function create(A, B, C) {
if (!B)
A = document.createTextNode(A);
else {
A = document.createElement(A);
for (var b in B) {
if (b.indexOf("on") == 0)
A.addEventListener(b.substring(2), B[b], false);
else if (b == "style")
A.setAttribute(b, B[b]);
else
A[b] = B[b];
}
if (C)
for(var i = 0, len = C.length; i<len; i++)
A.appendChild(C[i]);
}
return A;
}
function forEach(lst, cb) {
if (lst.snapshotItem) {
var i = 0, len = lst.snapshotLength;
while (i < len)
cb(lst.snapshotItem(i), i++, lst);
}
else if (lst.iterateNext) {
var item;
while (item = lst.iterateNext())
cb(item, lst);
}
else if (lst.forEach)
lst.forEach(cb);
else if (lst.length && typeof lst === 'object')
Array.forEach(lst, cb);
else if (typeof lst === 'object')
for (var i in lst) cb(lst[i], i, lst);
else
return false;
}
function $x(x, t, r) {
if (t && t.nodeType)
var h = r, r = t, t = h;
var d = r ? r.ownerDocument || r : r = document, p;
switch (t) {
case 1:
p = 'numberValue';
break;
case 2:
p = 'stringValue';
break;
case 3:
p = 'booleanValue';
break;
case 8: case 9:
p = 'singleNodeValue';
break;
default:
return d.evaluate(x, r, null, t || 6, null);
}
return d.evaluate(x, r, null, t, null)[p];
}
function hexToChars (hex) {
var a = new Array();
var b = (hex.substr(0, 2) == '0x') ? 2 : 0;
while (b < hex.length) {
a.push(parseInt(hex.substr(b, 2), 16));
b += 2;
}
return a;
}
function charsToStr (chars) {
var a = '';
var b = 0;
while (b < chars.length) {
a += String.fromCharCode(chars[b]);
++b;
}
return a;
}
function strToChars (str) {
var a = new Array();
var b = 0;
while (b < str.length) {
a.push(str.charCodeAt(b));
++b;
}
return a;
}
function initialize (pwd) {
var a = 0;
var b;
var c = pwd.length;
var d = 0;
while (d <= 255) {
mykey[d] = pwd[d % c];
sbox[d] = d;
++d;
}
d = 0;
while (d <= 255) {
a = (a + sbox[d] + mykey[d]) % 256;
b = sbox[d];
sbox[d] = sbox[a];
sbox[a] = b;
++d;
}
}
function calculate (plaintxt, psw) {
initialize(psw);
var a = 0;
var b = 0;
var c = new Array();
var d;
var e;
var f;
var g = 0;
while (g < plaintxt.length) {
a = (a + 1) % 256;
b = (b + sbox[a]) % 256;
e = sbox[a];
sbox[a] = this.sbox[b];
sbox[b] = e;
var h = (sbox[a] + sbox[b]) % 256;
d = sbox[h];
f = plaintxt[g] ^ d;
c.push(f);
++g;
}
return c;
}
function decrypt(src, key) {
var plaintxt = hexToChars(src);
var psw = strToChars(key);
var chars = calculate(plaintxt, psw);
return charsToStr(chars);
}
function process() {
$('searchResultsColumn').removeEventListener('DOMNodeInserted', process, false);
var checker=setInterval(function(){
if(unsafeWindow.trackdata.length && $('loadingModal').getAttribute('style').match(/display: none;/)) {
clearInterval(checker);
getSongs();
$('searchResultsColumn').addEventListener("DOMNodeInserted", process, false);
}
},200);
}
if(typeof unsafeWindow==='undefined') unsafeWindow = window;
var checker=setInterval(function(){
if(unsafeWindow.trackdata) {
clearInterval(checker);
process();
}
},200);
|
![]() ![]() |
Thanks. I just noticed the change tonight. I like the new color scheme. |


