vsd icon indicating copy to clipboard operation
vsd copied to clipboard

error: error decoding response body

Open machsix opened this issue 3 months ago • 2 comments

I failed to run this command

vsd save --retries 50 "https://asnwish.com/stream/s6_s_hxXgmQgc8pE4wPF_Q/kjhhiuahiuhgihdf/1758078408/12230410/index-f3-v1-a1.m3u8" -o SNIS-895.mp4 

It will show an error of "error: error decoding response body" for a segment. If I rerun the program, it starts to download again but may end at a different place

machsix avatar Sep 16 '25 15:09 machsix

kind of strange... after keep running the command until I get exit 0, it generates the file, but it is not a real mp4..

ffprobe -hide_banner -i  test.mp4                                                                                                                                                                                               
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf59.27.100
  Duration: 00:00:28.68, start: 0.000000, bitrate: 827385 kb/s
  Stream #0:0[0x1](und): Video: png (mp4v / 0x7634706D), rgba(pc), 1x1, 827383 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]

machsix avatar Sep 16 '25 15:09 machsix

ok... after some digging, I found this line in the JWplayer source code

onSuccess: function(e, r, n, a) {
  i.resetLoader(t, h);
  var s = e.data;
  n.resetIV && t.decryptdata && (t.decryptdata.iv = new Uint8Array(s.slice(0, 16)),
                                 s = s.slice(16)),
    l({
    frag: t,
    part: null,
    payload: s,
    networkDetails: a
  })
},

The first 16 bytes are

'�PNG\r\n\x1A\n\x00\x00\x00\rIHDR'

So they basically add an obfuscation. I used a python script to strip these obfuscation until PNG_IEND = b'\x00\x00\x00\x00IEND\xAE\x42\x60\x82' or the first 16 bytes and the final data works.

machsix avatar Sep 16 '25 18:09 machsix