melbahja / got

Got: Simple golang package and CLI tool to download large files faster 🏃 than cURL and Wget!
MIT License
714 stars 45 forks source link

Corrupt files #1

Closed githubixx closed 4 years ago

githubixx commented 4 years ago

Hi!

The tools is really fast! :smiley: But it seems to produce corrupt files. E.g.

got --out job_jobse..mp4 https://arteconcert-a.akamaihd.net/am/concert/096000/096900/096905-054-A_SQ_0_VO_05149030_MP4-2200_AMM-CONCERT-NEXT_1NdTQsPyN0.mp4

The download itself worked without issues. If I play the downloaded file with mpv I get this:

mpv --no-video job_jobse.mp4 
     Video --vid=1 (*) (h264 1280x720 25.000fps)
 (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
A: 00:11:55 / 00:59:39 (19%)
[ffmpeg/audio] aac: channel element 3.8 is not allocated
Error decoding audio.
[ffmpeg/audio] aac: Reserved bit set.
[ffmpeg/audio] aac: Number of bands (32) exceeds limit (20).
Error decoding audio.
[ffmpeg/audio] aac: Multiple frames in a packet.
[ffmpeg/audio] aac: Input buffer exhausted before END element found
Error decoding audio.
[ffmpeg/audio] aac: Sample rate index in program config element does not match the sample rate index configured by the container.
[ffmpeg/audio] aac: Inconsistent channel configuration.
[ffmpeg/audio] aac: get_buffer() failed
Error decoding audio.
[ffmpeg/audio] aac: Input buffer exhausted before END element found
Error decoding audio.
[ffmpeg/audio] aac: Prediction is not allowed in AAC-LC.
Error decoding audio.
[ffmpeg/audio] aac: Sample rate index in program config element does not match the sample rate index configured by the container.
[ffmpeg/audio] aac: Too large remapped id is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[ffmpeg/audio] aac: If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
...

So it plays without issues until 11:55 and then I get lots of errors. Downloading the same file with wget everything works as expected.

Could it be that there are race conditions in the tool that causes the chunks to be assembled in the wrong order or something like that? I suspect if you do the same download now that it might work for you because you didn't trigger the race condition. But that's just guessing of course.

melbahja commented 4 years ago

thank you for your helpful report, I will investigate this issue and I will push a fix today.

melbahja commented 4 years ago

Hey @githubixx, the bug has been fixed in v0.1.1 release... could you please confirm from your side, before closing the issue.

melbahja commented 4 years ago

The issue has been resolved on #2

githubixx commented 4 years ago

Looking good so far. Thanks!