こんにちは、私はダウンロード マネージャー プロジェクトに取り組んでいます。
リンクをテストしていて問題なく動作していますが、問題が見つかりました
以下のこの 2 つのリンクは emupardise からのものであり、私の要点を示すためだけに使用します。
このコードを使用する場合:
String GameLink = "http://www.emuparadise.me/roms/get-download.php?gid=43269&token=2f91d51fcd8b90cec75193ffd592f07c&mirror_available=true";
// String GameLink = "http://www.emuparadise.me/roms/get-download.php?gid=43270&token=a6f395885bea3bbef73d972804d2cbdb&mirror_available=true";
try {
URL url = new URL(GameLink);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestProperty("Host" ,"www.emuparadise.me");
con.setRequestProperty("Accept" ,"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
con.setRequestProperty("Accept-Encoding" ,"gzip, deflate");
con.setRequestProperty("Referer" ,"www.emuparadise.me");
con.setRequestProperty("Connection" ,"keep-alive");
System.out.println("Server answer :"+ con.getResponseCode());
con.connect();
InputStream is = con.getInputStream();
System.out.println(con.getURL().toString()+"\n");
is.close();
} catch (IOException ex) {
Logger.getLogger(Question.class.getName()).log(Level.SEVERE, null, ex);
}
最初に私は得る:
「サーバーの回答:200」(私が望むように)、ただし、2番目のリンクを使用すると:
「サーバーの回答:-1」とエラーが表示されます: java.io.IOException: Invalid Http response
両方のページのヘッダーを既に確認しましたが、それらは同じであり、両方のリンクが Internet Download Manager で機能するだけでなく、解決策を教えてください。
お時間をいただきありがとうございました