I am following this post : https://forum.videohelp.com/threads/408196-howto-deal-with-HLS-128-bit-aes-encrypted-t...on#post2699930
URL :
Video Details (Contains Index.m3u8 link) :Code:https://forum.videohelp.com/forums/48-Video-Streaming-Downloading
Timestamp :Code:https://www.goclasses.in/s/courses/60fdd8530cf2c7989e1f109d/videos/640c251ee4b04eb4af8fe5ec/get
apkId :Code:https://drive.google.com/file/d/1BljbOfqGpFq8UuCADpNCuXaQOEvwqEqX/view?usp=sharing
Remove the first and last character from the above apkId to get the actual apkId (Source : https://forum.videohelp.com/threads/408196-howto-deal-with-HLS-128-bit-aes-encrypted-t...-version/page2)Code:'6636637376163356630333436353765660'
Python Script Decrypt (Change apkId and download timestamp file in script folder) :
Output :Code:import binascii from Crypto.Cipher import AES with open("timestamp", "rb") as file: data = file.read() apkid = '63663737616335663033343635376566' def _decrypt_key(data, apkid): tmp1 = data[0:16] tmp2 = data[32:48] dec1 = AES.new(bytes.fromhex(apkid),AES.MODE_ECB) tmp3 = dec1.decrypt(tmp1) dec2 = AES.new(tmp3,AES.MODE_ECB) return dec2.decrypt(tmp2) result = _decrypt_key(data, apkid) hex_result = binascii.hexlify(result) print(hex_result.decode())
Code:59ace6010edd4ee2e5bf169e5f661863
Download Command :
The above command gives me error :Code:N_m3u8DL-RE.exe "https://d2qny97nu4rj64.cloudfront.net/spees/w/o/60e975430cf20278db21ff30/v/640c251ee4b04eb4af8fe5ec/u/64c41b63e4b0abe3bbd7fb51/t/b83a22f7c61e6715c78f5dba2835ad9f/p/assets/videos/60e975430cf20278db21ff30/2023/03/11/640c251ee4b04eb4af8fe5ec/index.m3u8" --custom-hls-key "59ace6010edd4ee2e5bf169e5f661863"
Does someone know why this error occurs ?Code:11:19:06.053 ERROR: Padding is invalid and cannot be removed.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 16 of 16
Thread
-
-
Your key is wrong,the correct key is :
648dea11fe203008b24f492175fe674d
command:
N_m3u8DL-RE "https://d2qny97nu4rj64.cloudfront.net/spees/w/o/60e975430cf20278db21ff30/v/640c251ee4b04eb4af8fe5ec/u/64c41b63e4b0abe3bbd7fb51/t/b83a22f7c61e6715c78f5dba2835ad9f/p/assets/videos/60e975430cf20278db21ff30/2023/03/11/640c251ee4b04eb4af8fe5ec/index.m3u8" --custom-hls-key "648dea11fe203008b24f492175fe674d" -mt -M mp4 --save-name "test" -
-
def _decrypt_key(data, apkId):
tmp1 = data[16:32]
tmp2 = data[48:64]
dec1 = AES.new(bytes.fromhex(apkId[1:33]),AES.MODE_ECB)
tmp3 = dec1.decrypt(tmp1)
dec2 = AES.new(tmp3,AES.MODE_ECB)
return dec2.decrypt(tmp2) -
-
why do i get this error,
ValueError: Incorrect AES key length (17 bytes)
i have tried the same script as this, import binascii
from Crypto.Cipher import AES
with open("timestamp", "rb") as file:
data = file.read()
apkid = '63663737616335663033343635376566'
def _decrypt_key(data, apkid):
tmp1 = data[0:16]
tmp2 = data[32:48]
dec1 = AES.new(bytes.fromhex(apkid),AES.MODE_ECB)
tmp3 = dec1.decrypt(tmp1)
dec2 = AES.new(tmp3,AES.MODE_ECB)
return dec2.decrypt(tmp2)
result = _decrypt_key(data, apkid)
hex_result = binascii.hexlify(result)
print(hex_result.decode()) -
code:
./N_m3u8DL-RE "https://d2qny97nu4rj64.cloudfront.net/spees/w/o/60e975430cf20278db21ff30/v/64bd9879e4b0f4c23037fa8c/u/6225780a0cf29abe0345ee88/t/7b32062cdb9a0c9e6005631d637919b3/p/assets/videos/60e975430cf20278db21ff30/2023/07/23/64bd9879e4b0f4c23037fa8c/index.m3u8" --custom-hls-key bbcca16ae752e8b21593b3e5b7122679 -mt -M mp4 --save-name "test"
00:25:42.998 INFO : N_m3u8DL-RE (Beta version) 20230111
00:25:43.005 INFO : Loading URL: https://d2qny97nu4rj64.cloudfront.net/spees/w/o/60e975430cf20278db21ff30/v/64bd9879e4b...a8c/index.m3u8
00:25:43.140 INFO : Content Matched: HTTP Live Streaming
00:25:43.141 INFO : Parsing streams...
00:25:43.141 WARN : Master List detected, try parse all streams
00:25:43.142 INFO : Extracted, there are 4 streams, with 3 basic streams, 1 audio streams, 0 subtitle streams
00:25:43.142 INFO : Vid 1920x1080 | 1500 Kbps | avc1.640028
00:25:43.142 INFO : Vid 1280x720 | 900 Kbps | avc1.64001f
00:25:43.142 INFO : Vid 852x480 | 650 Kbps | avc1.64001f
00:25:43.142 INFO : Aud audio-0 | eng | eng
00:25:43.525 INFO : New version detected! v0.2.0-beta
00:25:45.459 INFO : Parsing streams...
00:25:45.538 INFO : Selected streams:
00:25:45.538 INFO : Vid *AES_128 1920x1080 | 1500 Kbps | avc1.640028 | 599 Segments | ~19m56s
00:25:45.538 INFO : Aud *AES_128 audio-0 | eng | eng | 598 Segments | ~19m55s
00:25:45.538 INFO : Save Name: test
00:25:45.539 INFO : Start downloading...Vid 1920x1080 | 1500 Kbps | avc1.640028
00:25:45.539 INFO : Start downloading...Aud audio-0 | eng | eng
00:25:45.540 ERROR: Padding is invalid and cannot be removed.
apkId code: 64363433353038323162643935316565643634333530383231 62643935316565
python code : import binascii
from Crypto.Cipher import AES
with open("timestamp", "rb") as file:
data = file.read()
apkid=input('\napkid:')
def _decrypt_key(data, apkId):
tmp1 = data[16:32]
tmp2 = data[48:64]
dec1 = AES.new(bytes.fromhex(apkid[1:33]),AES.MODE_ECB)
tmp3 = dec1.decrypt(tmp1)
dec2 = AES.new(tmp3,AES.MODE_ECB)
return dec2.decrypt(tmp2)
result = _decrypt_key(data, apkid)
hex_result = binascii.hexlify(result)
print(hex_result.decode())
Finding error can anyone helpLast edited by jora; 13th Oct 2023 at 13:59.
-
Earlier I used to download videos hosted on graphy but now I'm getting this error "ERROR: Padding is invalid and cannot be removed."
How to get rid of this so that we can download videos from it. -
Can anyone help me with the error, padding is invalid and cannot be removed, I tried 2-3 scripts and the key I got is different and I tried them all but everytime same error occurs.
Earlier they used to work, but now I'm getting this error, kindly help me please. -
If you need some help from here to solve your problem then please provide some necessary information
1. ApkId
2. m3u8 URL -
Thanks a lot for your reply, but I was searching for it from last half an hour and just now it worked for me. Still thanks bro
-
@para8ox
I am happy to hear that you got a solution on your own
If you feel comfortable you can share here what you've figured out for future reference to everyone -
Sure, I searched on the forum and found that the solution is already provided here, just we need to understand it.
https://forum.videohelp.com/threads/408196-howto-deal-with-HLS-128-bit-aes-encrypted-t...e3#post2716234
This is the link from where I got the solution,
• In our script we simply have to change the range of apkID that needs to be processed to get the actual key.
• So steps are very simple, go to above link and there is one SS attached by aadrl, go to the source tab and then open that .min.js file and inside that you'll find apkId range.
• Put that range in the script and then run it. You'll surely get the working key. -
@para8ox Great Catch...
Graphy often changes that range.
When we use the Script posted by @NBA456017 it generates a wrong key and fails to decrypt the file
I had also encountered the same problem in the past but I followed the same steps suggested by @aadrl and managed to get my videos -
Similar Threads
-
Need Help Downloading & Decrypting Videos Hosted on Graphy
By johndiehl929 in forum Video Streaming DownloadingReplies: 32Last Post: 11th Feb 2024, 10:12 -
Help for downloading
By talms in forum Video Streaming DownloadingReplies: 8Last Post: 27th Jan 2023, 06:04 -
Help me downloading this :(
By Elias22 in forum Video Streaming DownloadingReplies: 1Last Post: 4th Jan 2023, 11:59 -
Help downloading from iq.com
By dami3n in forum Video Streaming DownloadingReplies: 10Last Post: 3rd Apr 2022, 03:27 -
Downloading From FS
By Abraham in forum Video Streaming DownloadingReplies: 1Last Post: 29th Jul 2020, 04:39