Merge branch 'main' of https://github.com/FongMi/CatVodSpider
This commit is contained in:
commit
942557ad12
|
|
@ -137,7 +137,7 @@ public class API {
|
||||||
private boolean checkAuth(String result) {
|
private boolean checkAuth(String result) {
|
||||||
if (result.contains("AccessTokenInvalid")) return refreshAccessToken();
|
if (result.contains("AccessTokenInvalid")) return refreshAccessToken();
|
||||||
if (result.contains("ShareLinkTokenInvalid") || result.contains("InvalidParameterNotMatch")) return refreshShareToken();
|
if (result.contains("ShareLinkTokenInvalid") || result.contains("InvalidParameterNotMatch")) return refreshShareToken();
|
||||||
return false;
|
return checkQuotaExhausted(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkOpen(String result) {
|
private boolean checkOpen(String result) {
|
||||||
|
|
@ -145,6 +145,14 @@ public class API {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean checkQuotaExhausted(String result) {
|
||||||
|
if (!result.contains("QuotaExhausted")) return false;
|
||||||
|
Init.show("容量不夠拉。");
|
||||||
|
auth.setRefreshToken("");
|
||||||
|
refreshAccessToken();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean checkManyRequest(String result) {
|
private boolean checkManyRequest(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。");
|
||||||
|
|
|
||||||
|
|
@ -80,12 +80,19 @@ public class Auth {
|
||||||
return TextUtils.isEmpty(expireTime) ? "" : expireTime;
|
return TextUtils.isEmpty(expireTime) ? "" : expireTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setExpireTime(String expireTime) {
|
||||||
|
this.expireTime = expireTime;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return getAccessToken().isEmpty();
|
return getAccessToken().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clean() {
|
public void clean() {
|
||||||
|
setRefreshToken("");
|
||||||
setAccessToken("");
|
setAccessToken("");
|
||||||
|
setExpireTime("");
|
||||||
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save() {
|
public void save() {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ public class Drive {
|
||||||
|
|
||||||
@SerializedName("drives")
|
@SerializedName("drives")
|
||||||
private List<Drive> drives;
|
private List<Drive> drives;
|
||||||
|
@SerializedName("vodPic")
|
||||||
|
private String vodPic;
|
||||||
@SerializedName("name")
|
@SerializedName("name")
|
||||||
private String name;
|
private String name;
|
||||||
@SerializedName("server")
|
@SerializedName("server")
|
||||||
|
|
@ -40,6 +42,10 @@ public class Drive {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getVodPic() {
|
||||||
|
return TextUtils.isEmpty(vodPic) ? "https://s1.ax1x.com/2023/04/03/pp4F4bT.png" : vodPic;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return TextUtils.isEmpty(name) ? "" : name;
|
return TextUtils.isEmpty(name) ? "" : name;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,8 @@ public class Item {
|
||||||
return id + getPath() + "/" + getName();
|
return id + getPath() + "/" + getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPic() {
|
public String getPic(String pic) {
|
||||||
return getThumb().isEmpty() && isFolder() ? "https://s1.ax1x.com/2023/04/03/pp4F4bT.png" : getThumb();
|
return getThumb().isEmpty() && isFolder() ? pic : getThumb();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemark() {
|
public String getRemark() {
|
||||||
|
|
@ -124,11 +124,11 @@ public class Item {
|
||||||
return isFolder() ? "folder" : "file";
|
return isFolder() ? "folder" : "file";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vod getVod(String id) {
|
public Vod getVod(String id, String pic) {
|
||||||
return new Vod(getVodId(id), getName(), getPic(), getRemark(), getVodTag());
|
return new Vod(getVodId(id), getName(), getPic(pic), getRemark(), getVodTag());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vod getVod(Drive drive) {
|
public Vod getVod(Drive drive, String pic) {
|
||||||
return new Vod(getVodId(drive.getName()), getName(), getPic(), drive.getName(), getVodTag());
|
return new Vod(getVodId(drive.getName()), getName(), getPic(pic), drive.getName(), getVodTag());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import java.util.concurrent.CountDownLatch;
|
||||||
public class AList extends Spider {
|
public class AList extends Spider {
|
||||||
|
|
||||||
private List<Drive> drives;
|
private List<Drive> drives;
|
||||||
|
private String vodPic;
|
||||||
private String ext;
|
private String ext;
|
||||||
|
|
||||||
private List<Filter> getFilter() {
|
private List<Filter> getFilter() {
|
||||||
|
|
@ -42,7 +43,9 @@ public class AList extends Spider {
|
||||||
private void fetchRule() {
|
private void fetchRule() {
|
||||||
if (drives != null && !drives.isEmpty()) return;
|
if (drives != null && !drives.isEmpty()) return;
|
||||||
if (ext.startsWith("http")) ext = OkHttp.string(ext);
|
if (ext.startsWith("http")) ext = OkHttp.string(ext);
|
||||||
drives = Drive.objectFrom(ext).getDrives();
|
Drive drive = Drive.objectFrom(ext);
|
||||||
|
drives = drive.getDrives();
|
||||||
|
vodPic = drive.getVodPic();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Drive getDrive(String name) {
|
private Drive getDrive(String name) {
|
||||||
|
|
@ -84,8 +87,8 @@ public class AList extends Spider {
|
||||||
Sorter.sort(type, order, folders);
|
Sorter.sort(type, order, folders);
|
||||||
Sorter.sort(type, order, files);
|
Sorter.sort(type, order, files);
|
||||||
}
|
}
|
||||||
for (Item item : folders) list.add(item.getVod(tid));
|
for (Item item : folders) list.add(item.getVod(tid, vodPic));
|
||||||
for (Item item : files) list.add(item.getVod(tid));
|
for (Item item : files) list.add(item.getVod(tid, vodPic));
|
||||||
return Result.get().vod(list).page().string();
|
return Result.get().vod(list).page().string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,9 +111,9 @@ public class AList extends Spider {
|
||||||
Vod vod = new Vod();
|
Vod vod = new Vod();
|
||||||
vod.setVodId(id);
|
vod.setVodId(id);
|
||||||
vod.setVodName(name);
|
vod.setVodName(name);
|
||||||
|
vod.setVodPic(vodPic);
|
||||||
vod.setVodPlayFrom(key);
|
vod.setVodPlayFrom(key);
|
||||||
vod.setVodPlayUrl(TextUtils.join("#", playUrls));
|
vod.setVodPlayUrl(TextUtils.join("#", playUrls));
|
||||||
vod.setVodPic("http://img1.3png.com/281e284a670865a71d91515866552b5f172b.png");
|
|
||||||
return Result.string(vod);
|
return Result.string(vod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -167,7 +170,7 @@ public class AList extends Spider {
|
||||||
try {
|
try {
|
||||||
String response = OkHttp.postJson(drive.searchApi(), drive.params(keyword));
|
String response = OkHttp.postJson(drive.searchApi(), drive.params(keyword));
|
||||||
List<Item> items = Item.arrayFrom(getSearchJson(drive.isNew(), response));
|
List<Item> items = Item.arrayFrom(getSearchJson(drive.isNew(), response));
|
||||||
for (Item item : items) if (!item.ignore(drive.isNew())) list.add(item.getVod(drive));
|
for (Item item : items) if (!item.ignore(drive.isNew())) list.add(item.getVod(drive, vodPic));
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
} finally {
|
} finally {
|
||||||
cd.countDown();
|
cd.countDown();
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
46f550f87ace39f5b51a4fa8737c7029
|
9dad9b968f26436fc4e681d0dc372d55
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;46f550f87ace39f5b51a4fa8737c7029",
|
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9dad9b968f26436fc4e681d0dc372d55",
|
||||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"vodPic": "https://s1.ax1x.com/2023/04/04/pp5M5Jx.png",
|
||||||
"drives": [
|
"drives": [
|
||||||
{
|
{
|
||||||
"name": "小雅",
|
"name": "小雅",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;46f550f87ace39f5b51a4fa8737c7029",
|
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9dad9b968f26436fc4e681d0dc372d55",
|
||||||
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
|
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
|
||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue