Skip to content

Commit

Permalink
Bump config version and readUtf buf size
Browse files Browse the repository at this point in the history
  • Loading branch information
shinovon committed Nov 21, 2024
1 parent 72933ee commit 991743a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/jtube/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ public static void loadConfig(Canvas testCanvas) {
}
if (i < 8) {
useApiProxy = true;
}
if (i < 9) {
playbackProxyVariant = 0;
saveConfig();
}
return;
Expand All @@ -330,7 +333,7 @@ public static void saveConfig() {
try {
RecordStore r = RecordStore.openRecordStore(CONFIG_RECORD_NAME, true);
JSONObject j = new JSONObject();
j.put("v", "v8");
j.put("v", "v9");
j.put("videoRes", "360p");
j.put("region", region);
j.put("downloadDir", downloadDir);
Expand Down
4 changes: 2 additions & 2 deletions src/jtube/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ public static byte[] get(String url) throws IOException {
}

private static String readUtf(InputStream in, int i) throws IOException {
byte[] buf = new byte[i <= 0 ? 1024 : i];
byte[] buf = new byte[i <= 0 ? 16384 : i];
i = 0;
int j;
while ((j = in.read(buf, i, buf.length - i)) != -1) {
if ((i += j) >= buf.length) {
System.arraycopy(buf, 0, buf = new byte[i + 2048], 0, i);
System.arraycopy(buf, 0, buf = new byte[i + 4096], 0, i);
}
}
try {
Expand Down

0 comments on commit 991743a

Please sign in to comment.