This commit is contained in:
GH Action - Upstream Sync 2023-05-02 01:20:54 +00:00
commit fafdf71e1f
7 changed files with 28 additions and 8 deletions

View File

@ -31,7 +31,13 @@ import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -140,6 +146,8 @@ public class API {
private boolean isManyRequest(String result) { private boolean isManyRequest(String result) {
if (!result.contains("Too Many Requests")) return false; if (!result.contains("Too Many Requests")) return false;
Init.show("洗洗睡吧Too Many Requests。"); Init.show("洗洗睡吧Too Many Requests。");
oauth.clean().save();
user.clean().save();
return true; return true;
} }
@ -350,7 +358,6 @@ public class API {
SpiderDebug.log(json); SpiderDebug.log(json);
return new JSONObject(json).getString("url"); return new JSONObject(json).getString("url");
} catch (Exception e) { } catch (Exception e) {
Init.execute(this::deleteAll);
e.printStackTrace(); e.printStackTrace();
return ""; return "";
} finally { } finally {
@ -372,7 +379,6 @@ public class API {
JSONArray taskList = new JSONObject(json).getJSONObject("video_preview_play_info").getJSONArray("live_transcoding_task_list"); JSONArray taskList = new JSONObject(json).getJSONObject("video_preview_play_info").getJSONArray("live_transcoding_task_list");
return getPreviewQuality(taskList, flag); return getPreviewQuality(taskList, flag);
} catch (Exception e) { } catch (Exception e) {
Init.execute(this::deleteAll);
e.printStackTrace(); e.printStackTrace();
return ""; return "";
} finally { } finally {
@ -429,9 +435,14 @@ public class API {
} }
private void getQRCode() { private void getQRCode() {
if (Utils.isMobile()) {
user.setRefreshToken(refreshToken);
refreshAccessToken();
} else {
Data data = Data.objectFrom(OkHttp.string("https://passport.aliyundrive.com/newlogin/qrcode/generate.do?appName=aliyun_drive&fromSite=52&appName=aliyun_drive&appEntrance=web&isMobile=false&lang=zh_CN&returnUrl=&bizParams=&_bx-v=2.2.3")).getContent().getData(); Data data = Data.objectFrom(OkHttp.string("https://passport.aliyundrive.com/newlogin/qrcode/generate.do?appName=aliyun_drive&fromSite=52&appName=aliyun_drive&appEntrance=web&isMobile=false&lang=zh_CN&returnUrl=&bizParams=&_bx-v=2.2.3")).getContent().getData();
Init.run(() -> showQRCode(data)); Init.run(() -> showQRCode(data));
} }
}
private void showQRCode(Data data) { private void showQRCode(Data data) {
try { try {

View File

@ -44,6 +44,10 @@ public class User {
return TextUtils.isEmpty(refreshToken) ? "" : refreshToken; return TextUtils.isEmpty(refreshToken) ? "" : refreshToken;
} }
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
public String getAuthorization() { public String getAuthorization() {
return getTokenType() + " " + getAccessToken(); return getTokenType() + " " + getAccessToken();
} }

View File

@ -1,5 +1,6 @@
package com.github.catvod.utils; package com.github.catvod.utils;
import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
@ -33,6 +34,10 @@ public class Utils {
return Sniffer.RULE.matcher(url).find(); return Sniffer.RULE.matcher(url).find();
} }
public static boolean isMobile() {
return Init.context().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
}
public static boolean isSub(String ext) { public static boolean isSub(String ext) {
return ext.equals("srt") || ext.equals("ass") || ext.equals("ssa"); return ext.equals("srt") || ext.equals("ass") || ext.equals("ssa");
} }

Binary file not shown.

View File

@ -1 +1 @@
9eb909e7a180e28b617c5fd15bda5b22 a50f5026c571ca789721f21e88056bcf

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9eb909e7a180e28b617c5fd15bda5b22", "spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;a50f5026c571ca789721f21e88056bcf",
"wallpaper": "https://gao.chuqiuyu.tk", "wallpaper": "https://gao.chuqiuyu.tk",
"sites": [ "sites": [
{ {

View File

@ -1,5 +1,5 @@
{ {
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9eb909e7a180e28b617c5fd15bda5b22", "spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;a50f5026c571ca789721f21e88056bcf",
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php", "wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
"sites": [ "sites": [
{ {