Я пытаюсь просканировать некоторые ссылки на MediaFire и столкнулся с проблемой слишком большого числа перенаправлений, которые я тщательно искал в Интернете, но проблема, с которой я сталкиваюсь, заключается в том, что некоторые URL-адреса не выдают ошибку «Слишком много перенаправлений», поканекоторые из них делают. Не могли бы вы помочь мне с тем, что я делаю неправильно?
try{
String url = "http://www.mediafire.com/file/110n342iorl685e/Guns-n%27-Roses_Paradise-City-TS_v1_2_DD_p.psarc";
Document doc3 = Jsoup.connect(url).userAgent("Mozilla/5.0").timeout(0).get();
for (Element sub3childrow : doc3.select("div.download_link")) {
String link=sub3childrow.select("a").attr("href");
System.out.println(link);
}
}catch(Exception ex){
ex.printStackTrace();
}
И это трассировка стека:
java.io.IOException: Too many redirects occurred trying to load URL http://www.mediafire.com/file/110n342iorl685e/Guns-n%2527-Roses_Paradise-City-TS_v1_2_DD_p.psarc
at org.jsoup.helper.HttpConnection$Response.<init>(HttpConnection.java:623)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:656)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:676)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:628)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:260)
at org.jsoup.helper.HttpConnection.get(HttpConnection.java:249)
at custom_file_downloader.RedirectExample.main(RedirectExample.java:23)
Я попытался установить followRedirects (true) и наоборот, но это никак не помогает.Можете ли вы направить меня в этом отношении?