Fetch
Fetch copied to clipboard
URL More than 3 times redirect ,Download Failed: REQUEST_NOT_SUCCESSFUL
When a URL redirect more than 3 times,it will download failed:REQUEST_NOT_SUCCESSFUL
e.g. url = "http://debug.mobads.baidu.com/clk?url=https%3A%2F%2Fcover%2Ebaidu%2Ecom%2Fcover%2Fdeeplink%5Fandroid%3FdownloadUrl%3D29611749%26ssl%3D1&s=0260db22d7b31f53"
Here is the solution: package com.tonyodev.fetch2 class HttpUrlConnectionDownloader fun execute line 72 change 'if' to 'while':
while ((code == HttpURLConnection.HTTP_MOVED_TEMP || code == HttpURLConnection.HTTP_MOVED_PERM || code == HttpURLConnection.HTTP_SEE_OTHER) && getHeaderValue(responseHeaders, "Location") != null) ...
it should be ok!