0

Hi i am trying to decipher the signature present in youtube page.I passed the orginal signature to below function as its there in youtube html5player js(http://s.ytimg.com/yts/jsbin/html5player-en_US-vflr38Js6/html5player.js) .but this function just removes first and last two characters.Am i missing any steps please enlighten me.Thanks.

var ar = {
    KF: function(a, b) {
        a.splice(0, b);
    },
    Xm: function(a) {
        a.reverse();
    },
    BT: function(a, b) {
        var c = a[0];
        a[0] = a[b % a.length];
        a[b] = c;
    }
};

function br(a) {
    a = a.split("");

    ar.BT(a, 63);
    ar.KF(a, 1);
    ar.Xm(a, 43);
    ar.BT(a, 46);
    ar.KF(a, 2);
    ar.Xm(a, 0);
    ar.KF(a, 3);
    return a.join("")
};

console.log(br("6A51A51911872F6C22D0BD925F0AC6865F8BBB63AE24.8933FFE6E311091075A664E5B940181409139CEAE0"));

orginal :

6A51A51911872F6C22D0BD925F0AC6865F8BBB63AE24.8933FFE6E311091075A664E5B940181409139CEAE0

result :

A51911872F6C22D0BD925F0AC6865F8BBB630E24.8933FFE6E3110910756664E5B940181409139CEA

Expected result is something like below:

8C06A0DDD566FD3C3B278CFD2BFE39AFD8A0B5C3.3AFF1E5C1C378DB9751628A61FEE0130041F556F
Akhilesh
  • 1,064
  • 15
  • 28
Devaki Arulmami
  • 131
  • 1
  • 9

1 Answers1

0

The deciphered signature is correct. You are doing it right but always remember to use the latest algorithm to decrypt the ciphered signature. Here I can see that you are using old HTML5 js player file. So if you are using the old file then the decrypted signature will not work for videos.

Akhilesh
  • 1,064
  • 15
  • 28
  • hey thanks for response.This is the latest html player js i can find in the source code..can you tell me what new html5 player js looks like ? – Devaki Arulmami Nov 22 '14 at 10:28
  • Wrong. this is the latest file: //s.ytimg.com/yts/jsbin/html5player-en_US-vflEhuJxd/html5player.js. For latest HTML5 player js file you have parse the webpage and check for the js component of ytplayer.config in the webpage source code – Akhilesh Nov 22 '14 at 10:32
  • hi , 1st of all i forced youtube to use html5 but the ytplayer.config shows swf filesonly... and 2nd i used ur new player that have same functions only..but still my video are not downloading , i get 403 error blank file – Devaki Arulmami Nov 22 '14 at 10:45
  • i am testing in localhost only..is there any other steps like adding itag ? – Devaki Arulmami Nov 22 '14 at 10:54
  • If you are facing problem then you can check the method here: https://github.com/bitnol/CipherAPI/blob/master/modules.php – Akhilesh Nov 22 '14 at 10:57
  • great code :) thanks..but i dont want code i just need to understand...so it just pass the s parameter to the js function i mentioned and use the result in signature parameter ? nothing else ? – Devaki Arulmami Nov 22 '14 at 11:08
  • @DevakiArulmami Please avoid the extended discussion in comments. Use the SO chatrooms or for Gmail chat – Akhilesh Nov 22 '14 at 11:21