Merge branch 'main' of https://github.com/FongMi/CatVodSpider
This commit is contained in:
commit
fafdf71e1f
|
|
@ -31,7 +31,13 @@ import org.json.JSONArray;
|
|||
import org.json.JSONObject;
|
||||
|
||||
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.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
|
@ -140,6 +146,8 @@ public class API {
|
|||
private boolean isManyRequest(String result) {
|
||||
if (!result.contains("Too Many Requests")) return false;
|
||||
Init.show("洗洗睡吧,Too Many Requests。");
|
||||
oauth.clean().save();
|
||||
user.clean().save();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -350,7 +358,6 @@ public class API {
|
|||
SpiderDebug.log(json);
|
||||
return new JSONObject(json).getString("url");
|
||||
} catch (Exception e) {
|
||||
Init.execute(this::deleteAll);
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
} finally {
|
||||
|
|
@ -372,7 +379,6 @@ public class API {
|
|||
JSONArray taskList = new JSONObject(json).getJSONObject("video_preview_play_info").getJSONArray("live_transcoding_task_list");
|
||||
return getPreviewQuality(taskList, flag);
|
||||
} catch (Exception e) {
|
||||
Init.execute(this::deleteAll);
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
} finally {
|
||||
|
|
@ -429,8 +435,13 @@ public class API {
|
|||
}
|
||||
|
||||
private void getQRCode() {
|
||||
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));
|
||||
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();
|
||||
Init.run(() -> showQRCode(data));
|
||||
}
|
||||
}
|
||||
|
||||
private void showQRCode(Data data) {
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@ public class User {
|
|||
return TextUtils.isEmpty(refreshToken) ? "" : refreshToken;
|
||||
}
|
||||
|
||||
public void setRefreshToken(String refreshToken) {
|
||||
this.refreshToken = refreshToken;
|
||||
}
|
||||
|
||||
public String getAuthorization() {
|
||||
return getTokenType() + " " + getAccessToken();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.github.catvod.utils;
|
||||
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.util.DisplayMetrics;
|
||||
|
|
@ -33,6 +34,10 @@ public class Utils {
|
|||
return Sniffer.RULE.matcher(url).find();
|
||||
}
|
||||
|
||||
public static boolean isMobile() {
|
||||
return Init.context().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
|
||||
}
|
||||
|
||||
public static boolean isSub(String ext) {
|
||||
return ext.equals("srt") || ext.equals("ass") || ext.equals("ssa");
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
9eb909e7a180e28b617c5fd15bda5b22
|
||||
a50f5026c571ca789721f21e88056bcf
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue