FileDownloader icon indicating copy to clipboard operation
FileDownloader copied to clipboard

Unable to download text file through Chunked transfer encoding

Open sergiomartinez4 opened this issue 6 years ago • 14 comments

Issue

1. What problem do you get? I'm not able to download one text file (VTT file). Presumably, it's because the server is using Chunked transfer encoding.

2. Which version of FileDownloader are you using when you produce such problem? Version 1.7.4

3. How to reproduce such problem? Just try downloading the following VTT file. Please note that I added the VTT url to Bitly, because the url expires and I can keep updating it for testing purposes: http://bit.ly/2HtV0gP You might need to get the redirect url first. Please let me know if the url expires.

4. Do you set FileDownloadLog.NEED_LOG=true? Yes

5. Could you please reproduce this problem and provide all main process and :filedownloader process logcat See the logcat below.

6. Can you fix it by yourself and request PR, if not, what's problem do you get when you try to fix it Not at this moment

///////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////MAIN PROCESS LOG//////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// 06-07 17:10:45.678 15132-15132/com.example.bugapp I/zygote64: Late-enabling -Xcheck:jni 06-07 17:10:45.786 15132-15150/com.example.bugapp D/libEGL: loaded /vendor/lib64/egl/libEGL_adreno.so 06-07 17:10:45.792 15132-15150/com.example.bugapp D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_adreno.so 06-07 17:10:45.805 15132-15150/com.example.bugapp D/libEGL: loaded /vendor/lib64/egl/libGLESv2_adreno.so 06-07 17:10:45.864 15132-15171/com.example.bugapp D/OpenGLRenderer: HWUI GL Pipeline 06-07 17:10:45.900 15132-15171/com.example.bugapp I/Adreno: QUALCOMM build : 594927b, I916dfac403 Build Date : 10/11/17 OpenGL ES Shader Compiler Version: EV031.21.02.00 Local Branch : mybranch28618966 Remote Branch : quic/gfx-adreno.lnx.6.4.9-rel Remote Branch : NONE Reconstruct Branch : NOTHING 06-07 17:10:45.905 15132-15171/com.example.bugapp I/Adreno: PFP: 0x005ff087, ME: 0x005ff063 06-07 17:10:45.910 15132-15171/com.example.bugapp I/zygote64: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 1 06-07 17:10:45.910 15132-15171/com.example.bugapp I/OpenGLRenderer: Initialized EGL, version 1.4 06-07 17:10:45.910 15132-15171/com.example.bugapp D/OpenGLRenderer: Swap behavior 2 06-07 17:10:55.359 15132-15301/com.example.bugapp I/ODRM: Starting downloadOneByOne 06-07 17:10:55.373 15132-15301/com.example.bugapp D/FileDownloader.DownloadTask: setPath /storage/emulated/0/Android/data/com.example.bugapp/files/Download 06-07 17:10:55.374 15132-15301/com.example.bugapp D/FileDownloader.DownloadTask: setListener com.example.bugapp.util.DownloadIntentService$MyFileDownloadListener@f4140ac 06-07 17:10:55.374 15132-15301/com.example.bugapp V/FileDownloader.DownloadTaskHunter: call start Url[http://bcboltproduse1-a.akamaihd.net/media/v1/text/vtt/clear/5783296997001/9f8be68c-fd34-4b94-922e-ce97768dd48d/8d06ebef-49db-43fe-921a-c6a38b777a91/text.vtt?akamai_token=exp=1528428442~acl=/media/v1/text/vtt/clear/5783296997001/9f8be68c-fd34-4b94-922e-ce97768dd48d/8d06ebef-49db-43fe-921a-c6a38b777a91/text.vtt*~hmac=77a5a4c6cb010b8594b9e55a7f35f3a6e0fda9f7713b752dd81815860882b896], Path[/storage/emulated/0/Android/data/com.example.bugapp/files/Download] Listener[com.example.bugapp.util.DownloadIntentService$MyFileDownloadListener@f4140ac], Tag[null] 06-07 17:10:55.377 15132-15303/com.example.bugapp V/FileDownloader.FileDownloadEventPool: setListener event.service.connect.changed 06-07 17:10:55.378 15132-15301/com.example.bugapp V/FileDownloader.DownloadTaskHunter: the task[-818857745] has been into the launch pool. 06-07 17:10:55.378 15132-15301/com.example.bugapp I/ODRM: Checking that atomic integer is ZERO 06-07 17:10:55.380 15132-15303/com.example.bugapp I/FileDownloader.FileDownloadProperties: init properties 0 load properties: http.lenient=FALSE; process.non-separate=FALSE; download.min-progress-step=65536; download.min-progress-time=2000; download.max-network-thread-count=3; file.non-pre-allocation=FALSE; broadcast.completed=FALSE; download.trial-connection-head-method=FALSE 06-07 17:10:55.381 15132-15303/com.example.bugapp D/FileDownloader.LostServiceConnectedHandler: Waiting for connecting with the downloader service... -818857745 06-07 17:10:55.383 15132-15303/com.example.bugapp D/FileDownloader.FileDownloadServiceUIGuard: bindStartByContext PlaybackTestApplication 06-07 17:10:55.398 15132-15303/com.example.bugapp D/FileDownloader.DownloadTaskHunter: free the task -818857745, when the status is 10 06-07 17:10:55.493 15132-15132/com.example.bugapp D/FileDownloader.FileDownloadServiceUIGuard: onServiceConnected ComponentInfo{com.example.bugapp/com.liulishuo.filedownloader.services.FileDownloadService$SeparateProcessService} com.liulishuo.filedownloader.i.IFileDownloadIPCService$Stub$Proxy@a935ff1 06-07 17:10:55.494 15132-15132/com.example.bugapp V/FileDownloader.FileDownloadEventPool: asyncPublishInNewThread event.service.connect.changed 06-07 17:10:55.495 15132-15321/com.example.bugapp V/FileDownloader.FileDownloadEventPool: publish event.service.connect.changed 06-07 17:10:55.496 15132-15321/com.example.bugapp D/FileDownloader.LostServiceConnectedHandler: The downloader service is connected. 06-07 17:10:55.496 15132-15321/com.example.bugapp V/FileDownloader.DownloadTaskHunter: call start Url[http://bcboltproduse1-a.akamaihd.net/media/v1/text/vtt/clear/5783296997001/9f8be68c-fd34-4b94-922e-ce97768dd48d/8d06ebef-49db-43fe-921a-c6a38b777a91/text.vtt?akamai_token=exp=1528428442~acl=/media/v1/text/vtt/clear/5783296997001/9f8be68c-fd34-4b94-922e-ce97768dd48d/8d06ebef-49db-43fe-921a-c6a38b777a91/text.vtt*~hmac=77a5a4c6cb010b8594b9e55a7f35f3a6e0fda9f7713b752dd81815860882b896], Path[/storage/emulated/0/Android/data/com.example.bugapp/files/Download] Listener[com.example.bugapp.util.DownloadIntentService$MyFileDownloadListener@f4140ac], Tag[null] 06-07 17:10:55.497 15132-15321/com.example.bugapp V/FileDownloader.DownloadTaskHunter: the task[-818857745] has been into the launch pool. 06-07 17:10:55.498 15132-15322/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify begin [email protected]@458f944 06-07 17:10:55.498 15132-15322/com.example.bugapp V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:start com.liulishuo.filedownloader.DownloadTaskHunter@46d0a2d by 11 06-07 17:10:55.499 15132-15322/com.example.bugapp V/FileDownloader.FileDownloadList: add list in all [email protected]@458f944 11 1 06-07 17:10:55.521 15132-15325/com.example.bugapp D/FileDownloader.MessageSnapshotGate: ~~~callback -818857745 old[11] new[1] 1 06-07 17:10:55.522 15132-15325/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify pending [email protected]@458f944 06-07 17:10:55.523 15132-15325/com.example.bugapp D/FileDownloader.MessageSnapshotGate: updateKeepFlow 06-07 17:10:55.524 15132-15325/com.example.bugapp D/FileDownloader.MessageSnapshotGate: ~~~callback -818857745 old[1] new[6] 1 06-07 17:10:55.524 15132-15325/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify started [email protected]@458f944 06-07 17:10:55.524 15132-15325/com.example.bugapp D/FileDownloader.MessageSnapshotGate: updateKeepFlow 06-07 17:10:55.729 15132-15325/com.example.bugapp D/FileDownloader.MessageSnapshotGate: ~~~callback -818857745 old[6] new[2] 1 06-07 17:10:55.730 15132-15325/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify connected [email protected]@458f944 06-07 17:10:55.731 15132-15325/com.example.bugapp D/FileDownloader.MessageSnapshotGate: updateKeepFlow 06-07 17:10:55.831 15132-15325/com.example.bugapp D/FileDownloader.MessageSnapshotGate: ~~~callback -818857745 old[2] new[-1] 1 06-07 17:10:55.832 15132-15325/com.example.bugapp V/FileDownloader.FileDownloadList: remove [email protected]@458f944 left -1 0 06-07 17:10:55.833 15132-15325/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify error [email protected]@458f944 com.liulishuo.filedownloader.exception.FileDownloadGiveUpRetryException: can't know the size of the download file, and its Transfer-Encoding is not Chunked either. you can ignore such exception by add http.lenient=true to the filedownloader.properties 06-07 17:10:55.833 15132-15325/com.example.bugapp V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@46d0a2d by -1 06-07 17:10:55.834 15132-15325/com.example.bugapp D/FileDownloader.MessageSnapshotGate: updateKeepFlow

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////FILEDOWNLOADER service LOG////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 06-07 17:10:55.401 15304-15304/? I/zygote64: Late-enabling -Xcheck:jni 06-07 17:10:55.523 15304-15324/com.example.bugapp:filedownloader D/NetworkSecurityConfig: No Network Security Config specified, using platform default

sergiomartinez4 avatar Jun 07 '18 21:06 sergiomartinez4

This is a good issue, thanks.

In fact, the log info has a very clear explanation:

com.liulishuo.filedownloader.exception.FileDownloadGiveUpRetryException: can't know the size of the download file, and its Transfer-Encoding is not Chunked either.
you can ignore such exception by add http.lenient=true to the filedownloader.properties

It means that the server response doesn't contain Content-Length and Transfer-Encoding, so FileDownload doesn't know the file length. Also, you can ignore this issue by adding http.lenient=true to filedownloader.properties, and let me know this solves your problem or not.

rantianhua avatar Jun 08 '18 14:06 rantianhua

@rantianhua thanks for the quick response. Unfortunately, that didn't solve the problem. Here's the new log:

///////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////MAIN PROCESS LOG//////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// 06-08 10:24:11.664 10158-10158/? I/zygote64: Late-enabling -Xcheck:jni 06-08 10:24:11.774 10158-10180/com.example.bugapp D/libEGL: loaded /vendor/lib64/egl/libEGL_adreno.so 06-08 10:24:11.783 10158-10180/com.example.bugapp D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_adreno.so 06-08 10:24:11.797 10158-10180/com.example.bugapp D/libEGL: loaded /vendor/lib64/egl/libGLESv2_adreno.so 06-08 10:24:11.858 10158-10198/com.example.bugapp D/OpenGLRenderer: HWUI GL Pipeline 06-08 10:24:11.897 10158-10198/com.example.bugapp I/Adreno: QUALCOMM build : 594927b, I916dfac403 Build Date : 10/11/17 OpenGL ES Shader Compiler Version: EV031.21.02.00 Local Branch : mybranch28618966 Remote Branch : quic/gfx-adreno.lnx.6.4.9-rel Remote Branch : NONE Reconstruct Branch : NOTHING 06-08 10:24:11.900 10158-10198/com.example.bugapp I/Adreno: PFP: 0x005ff087, ME: 0x005ff063 06-08 10:24:11.904 10158-10198/com.example.bugapp I/zygote64: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 1 06-08 10:24:11.904 10158-10198/com.example.bugapp I/OpenGLRenderer: Initialized EGL, version 1.4 06-08 10:24:11.904 10158-10198/com.example.bugapp D/OpenGLRenderer: Swap behavior 2 06-08 10:24:20.655 10158-10324/com.example.bugapp I/ODRM: Starting downloadOneByOne 06-08 10:24:20.671 10158-10324/com.example.bugapp D/FileDownloader.DownloadTask: setPath /storage/emulated/0/Android/data/com.example.bugapp/files/Download 06-08 10:24:20.671 10158-10324/com.example.bugapp D/FileDownloader.DownloadTask: setListener com.example.bugapp.util.DownloadIntentService$MyFileDownloadListener@f4140ac 06-08 10:24:20.672 10158-10324/com.example.bugapp V/FileDownloader.DownloadTaskHunter: call start Url[http://bcboltproduse1-a.akamaihd.net/media/v1/text/vtt/clear/5783296997001/9f8be68c-fd34-4b94-922e-ce97768dd48d/8d06ebef-49db-43fe-921a-c6a38b777a91/text.vtt?akamai_token=exp=1528491081~acl=/media/v1/text/vtt/clear/5783296997001/9f8be68c-fd34-4b94-922e-ce97768dd48d/8d06ebef-49db-43fe-921a-c6a38b777a91/text.vtt*~hmac=590597501ebe86dfe429f686c923773136c0d55d224f37223de74dd6c04a55cc], Path[/storage/emulated/0/Android/data/com.example.bugapp/files/Download] Listener[com.example.bugapp.util.DownloadIntentService$MyFileDownloadListener@f4140ac], Tag[null] 06-08 10:24:20.674 10158-10326/com.example.bugapp V/FileDownloader.FileDownloadEventPool: setListener event.service.connect.changed 06-08 10:24:20.675 10158-10324/com.example.bugapp V/FileDownloader.DownloadTaskHunter: the task[-236327181] has been into the launch pool. 06-08 10:24:20.675 10158-10324/com.example.bugapp I/ODRM: Checking that atomic integer is ZERO 06-08 10:24:20.676 10158-10326/com.example.bugapp I/FileDownloader.FileDownloadProperties: init properties 0 load properties: http.lenient=TRUE; process.non-separate=FALSE; download.min-progress-step=65536; download.min-progress-time=2000; download.max-network-thread-count=3; file.non-pre-allocation=FALSE; broadcast.completed=FALSE; download.trial-connection-head-method=FALSE 06-08 10:24:20.677 10158-10326/com.example.bugapp D/FileDownloader.LostServiceConnectedHandler: Waiting for connecting with the downloader service... -236327181 06-08 10:24:20.679 10158-10326/com.example.bugapp D/FileDownloader.FileDownloadServiceUIGuard: bindStartByContext PlaybackTestApplication 06-08 10:24:20.695 10158-10326/com.example.bugapp D/FileDownloader.DownloadTaskHunter: free the task -236327181, when the status is 10 06-08 10:24:20.847 10158-10158/com.example.bugapp D/FileDownloader.FileDownloadServiceUIGuard: onServiceConnected ComponentInfo{com.example.bugapp/com.liulishuo.filedownloader.services.FileDownloadService$SeparateProcessService} com.liulishuo.filedownloader.i.IFileDownloadIPCService$Stub$Proxy@a935ff1 06-08 10:24:20.848 10158-10158/com.example.bugapp V/FileDownloader.FileDownloadEventPool: asyncPublishInNewThread event.service.connect.changed 06-08 10:24:20.849 10158-10346/com.example.bugapp V/FileDownloader.FileDownloadEventPool: publish event.service.connect.changed 06-08 10:24:20.849 10158-10346/com.example.bugapp D/FileDownloader.LostServiceConnectedHandler: The downloader service is connected. 06-08 10:24:20.850 10158-10346/com.example.bugapp V/FileDownloader.DownloadTaskHunter: call start Url[http://bcboltproduse1-a.akamaihd.net/media/v1/text/vtt/clear/5783296997001/9f8be68c-fd34-4b94-922e-ce97768dd48d/8d06ebef-49db-43fe-921a-c6a38b777a91/text.vtt?akamai_token=exp=1528491081~acl=/media/v1/text/vtt/clear/5783296997001/9f8be68c-fd34-4b94-922e-ce97768dd48d/8d06ebef-49db-43fe-921a-c6a38b777a91/text.vtt*~hmac=590597501ebe86dfe429f686c923773136c0d55d224f37223de74dd6c04a55cc], Path[/storage/emulated/0/Android/data/com.example.bugapp/files/Download] Listener[com.example.bugapp.util.DownloadIntentService$MyFileDownloadListener@f4140ac], Tag[null] 06-08 10:24:20.851 10158-10346/com.example.bugapp V/FileDownloader.DownloadTaskHunter: the task[-236327181] has been into the launch pool. 06-08 10:24:20.851 10158-10347/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify begin [email protected]@458f944 06-08 10:24:20.851 10158-10347/com.example.bugapp V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:start com.liulishuo.filedownloader.DownloadTaskHunter@46d0a2d by 11 06-08 10:24:20.852 10158-10347/com.example.bugapp V/FileDownloader.FileDownloadList: add list in all [email protected]@458f944 11 1 06-08 10:24:20.877 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: ~~~callback -236327181 old[11] new[1] 1 06-08 10:24:20.878 10158-10350/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify pending [email protected]@458f944 06-08 10:24:20.879 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: updateKeepFlow 06-08 10:24:20.879 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: ~~~callback -236327181 old[1] new[6] 1 06-08 10:24:20.880 10158-10350/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify started [email protected]@458f944 06-08 10:24:20.881 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: updateKeepFlow 06-08 10:24:21.475 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: ~~~callback -236327181 old[6] new[2] 1 06-08 10:24:21.476 10158-10350/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify connected [email protected]@458f944 06-08 10:24:21.476 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: updateKeepFlow 06-08 10:24:21.518 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: ~~~callback -236327181 old[2] new[3] 1 06-08 10:24:21.519 10158-10350/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify progress [email protected]@458f944 3778 1521 06-08 10:24:21.519 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: updateKeepFlow 06-08 10:24:21.639 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: ~~~callback -236327181 old[3] new[-1] 1 06-08 10:24:21.640 10158-10350/com.example.bugapp V/FileDownloader.FileDownloadList: remove [email protected]@458f944 left -1 0 06-08 10:24:21.642 10158-10350/com.example.bugapp D/FileDownloader.FileDownloadMessenger: notify error [email protected]@458f944 com.liulishuo.filedownloader.exception.FileDownloadGiveUpRetryException: fetched length[9788] != content length[1521], range[0, -1) offset[9788] fetch begin offset[0] 06-08 10:24:21.643 10158-10350/com.example.bugapp V/FileDownloader.DownloadTaskHunter: filedownloader:lifecycle:over com.liulishuo.filedownloader.DownloadTaskHunter@46d0a2d by -1 06-08 10:24:21.643 10158-10350/com.example.bugapp D/FileDownloader.MessageSnapshotGate: updateKeepFlow

sergiomartinez4 avatar Jun 08 '18 14:06 sergiomartinez4

The pivotal log is:

fetched length[9788] != content length[1521], range[0, -1) offset[9788] fetch begin offset[0]

It means that the file length told by server and downloaded by FileDownloader actually are not coincident. It's probably a server's issue. So, I need the log of filedownloader process to find the real problem. If it's not convenient for you to collect the log of filedownloader process, you can add process.non-separate=true into filedownloader.properties so that you can get all log in the main process.

rantianhua avatar Jun 09 '18 04:06 rantianhua

Hi @rantianhua ,

I've added the process.non-separate=true and saved the log. You can find it here: http://bit.ly/2l0cqZM By the way, I'm able to download that VTT file using the web browser or using Android DownloadManager.

Thanks

sergiomartinez4 avatar Jun 11 '18 14:06 sergiomartinez4

I will give you a response tomorrow.

rantianhua avatar Jun 11 '18 14:06 rantianhua

The error message is:

com.liulishuo.filedownloader.exception.FileDownloadGiveUpRetryException: fetched length[9788] != content length[1521], range[0, -1) offset[9788] fetch begin offset[0]

Content-Length is 1521 but FileDownloader get 9788 bytes from the stream.


I get the redirect url from http://bit.ly/2HtV0gP, but it has expired. Could you please give me a useable url so that I can debug it.

rantianhua avatar Jun 12 '18 01:06 rantianhua

@rantianhua sure, here it is: http://bit.ly/2l4U3mA

sergiomartinez4 avatar Jun 12 '18 03:06 sergiomartinez4

@sergiomartinez4 I can sure this is a serve error.


FileDownloader will check the bytes read from stream and returned in the response header, if they are not coincident, FileDownloadGiveUpRetryException will be thrown. In your case, server told FileDownloader that the file size is 1521 bytes, but actually, real size is 9788 bytes. I copied the content downloaded by chrome and saved it in a file, and file size is 9788 bytes too.

2018-06-12 12 27 47

So, FileDownloader did the right action.


You said you can download the file through Chrome and Android DownloadManager, so FileDownloader. What's the difference is that FileDownloader adds a file size check after downloading.

rantianhua avatar Jun 12 '18 04:06 rantianhua

@rantianhua let me check this out and I'll get back to you. Thanks for the info!

sergiomartinez4 avatar Jun 12 '18 21:06 sergiomartinez4

@rantianhua I think one detail is being omitted here. FileDownloader sets Accept-encoding: gzip in the request asdas

To which server responds with Content-Length of gzipped data which is correct behaviour based on RFC 2616.

The file size you're seeing after downloading via Chrome and saving to file is most likely uncompressed. That's probably why you're seeing discrepancy there. That said, if FileDownloader sends Accept-encoding: gzip in the request and expects Content-Length value of uncompressed file, that is, I believe, incorrect behaviour.

bcdarius avatar Mar 14 '19 04:03 bcdarius

I want to download this file https://v.redd.it/b5fdxaieg8y11/HLSPlaylist.m3u8, but get exception com.liulishuo.filedownloader.exception.FileDownloadGiveUpRetryException: fetched length[xxxx] != content length[xxxx], how can i escape this probleam? @rantianhua

BCsl avatar Mar 20 '19 11:03 BCsl

@rantianhua I think one detail is being omitted here. FileDownloader sets Accept-encoding: gzip in the request asdas

To which server responds with Content-Length of gzipped data which is correct behaviour based on RFC 2616.

The file size you're seeing after downloading via Chrome and saving to file is most likely uncompressed. That's probably why you're seeing discrepancy there. That said, if FileDownloader sends Accept-encoding: gzip in the request and expects Content-Length value of uncompressed file, that is, I believe, incorrect behaviour.

You are right. When i try to download this file https://v.redd.it/b5fdxaieg8y11/HLSPlaylist.m3u8 directly, I got FileDownloadGiveUpRetryException: fetched length[xxxx] != content length[xxxx]. After i change the
Accept-encoding to identity , it works well without exception.

BCsl avatar Mar 27 '19 08:03 BCsl

怎么解决这个错误呢?fetched length[1140621] != content length[1000887], range[0, -1) offset[1140621] fetch begin offset[0]

799837663 avatar Feb 26 '20 08:02 799837663

FYI: I found a workaround for this issue. I added the "Accept-Encoding" header with the "identity" value when downloading VTT files.

BaseDownloadTask task = FileDownloader.getImpl().create(...);
task.addHeader("Accept-Encoding", "identity");
...

Hope this help anyone else having this problem.

sergiomartinez4 avatar Feb 26 '20 15:02 sergiomartinez4