mirror of
https://github.com/Maschell/JNUSLib.git
synced 2025-02-17 00:36:21 +01:00
Use a proper user agent for downloading
This commit is contained in:
parent
eaef0fefd1
commit
5603bfb94e
@ -28,6 +28,7 @@ public class Settings {
|
|||||||
public static final String WUD_KEY_FILENAME = "game.key";
|
public static final String WUD_KEY_FILENAME = "game.key";
|
||||||
public static final String WOOMY_METADATA_FILENAME = "metadata.xml";
|
public static final String WOOMY_METADATA_FILENAME = "metadata.xml";
|
||||||
public static final String H3_EXTENTION = ".h3";
|
public static final String H3_EXTENTION = ".h3";
|
||||||
|
public static final String USER_AGENT = "Mozilla/5.0 (Nintendo WiiU) AppleWebKit/536.28 (KHTML, like Gecko) NX/3.0.3.12.12 NintendoBrowser/3.0.0.9561.US";
|
||||||
|
|
||||||
public static byte[] commonKey = new byte[0x10];
|
public static byte[] commonKey = new byte[0x10];
|
||||||
public static int WIIU_DECRYPTED_AREA_OFFSET = 0x18000;
|
public static int WIIU_DECRYPTED_AREA_OFFSET = 0x18000;
|
||||||
|
@ -21,6 +21,7 @@ import java.io.InputStream;
|
|||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
import de.mas.wiiu.jnus.Settings;
|
||||||
import lombok.extern.java.Log;
|
import lombok.extern.java.Log;
|
||||||
|
|
||||||
@Log
|
@Log
|
||||||
@ -33,6 +34,7 @@ public abstract class Downloader {
|
|||||||
int BUFFER_SIZE = 0x800;
|
int BUFFER_SIZE = 0x800;
|
||||||
URL url = new URL(fileURL);
|
URL url = new URL(fileURL);
|
||||||
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
|
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
|
||||||
|
httpConn.setRequestProperty("User-Agent", Settings.USER_AGENT);
|
||||||
int responseCode = httpConn.getResponseCode();
|
int responseCode = httpConn.getResponseCode();
|
||||||
|
|
||||||
byte[] file = null;
|
byte[] file = null;
|
||||||
|
@ -85,6 +85,7 @@ public final class NUSDownloadService extends Downloader {
|
|||||||
public InputStream getInputStream(String URL, long offset) throws IOException {
|
public InputStream getInputStream(String URL, long offset) throws IOException {
|
||||||
URL url_obj = new URL(URL);
|
URL url_obj = new URL(URL);
|
||||||
HttpURLConnection connection = (HttpURLConnection) url_obj.openConnection();
|
HttpURLConnection connection = (HttpURLConnection) url_obj.openConnection();
|
||||||
|
connection.setRequestProperty("User-Agent", Settings.USER_AGENT);
|
||||||
connection.setRequestProperty("Range", "bytes=" + offset + "-");
|
connection.setRequestProperty("Range", "bytes=" + offset + "-");
|
||||||
try {
|
try {
|
||||||
connection.connect();
|
connection.connect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user