Esempio n. 1
0
 def create_params(self, song_id):
     text = '{"ids":[' + str(song_id) + '], br:"320000",csrf_token:"csrf"}'
     nonce = '0CoJUm6Qyw8W8jud'
     nonce2 = 16 * 'F'
     encText = encrypt.aes(
         encrypt.aes(text, nonce).decode("utf-8"), nonce2
     )
     return encText
Esempio n. 2
0
 def createPlaylistParams(self,ids,playlist_id,cmd,csrf_token):
     text = '{"trackIds":  ['+",".join(ids) + '],"pid": "{}","op": "{}","csrf_token": "{}"'.format(playlist_id,cmd,csrf_token) + '}'
     nonce = '0CoJUm6Qyw8W8jud'
     nonce2 = 16 * 'F'
     encText = encrypt.aes(
         encrypt.aes(text, nonce).decode("utf-8"), nonce2
     )
     return encText
Esempio n. 3
0
 def createLoginParams(self, username, password):
     psw = tools.md5(password)
     text = '{' + '"phone": "{}","password": "******","rememberLogin": "******"'.format(
         username, psw) + '}'
     nonce = '0CoJUm6Qyw8W8jud'
     nonce2 = 16 * 'F'
     encText = encrypt.aes(encrypt.aes(text, nonce).decode("utf-8"), nonce2)
     return encText
Esempio n. 4
0
 def createParams(self, page=1):
     if page == 1:
         text = (
             '{rid:"", offset:"0", total:"true", limit:"20", csrf_token:""}'
         )
     else:
         offset = str((page - 1) * 20)
         text = ('{rid:"", offset:"{}", total:"{}", limit:"20", '
                 'csrf_token:""}'.format(offset, 'false'))
     nonce = '0CoJUm6Qyw8W8jud'
     nonce2 = 16 * 'F'
     encText = encrypt.aes(encrypt.aes(text, nonce).decode("utf-8"), nonce2)
     return encText