This commit is contained in:
GH Action - Upstream Sync 2023-04-13 12:33:22 +00:00
commit c596710cb6
8 changed files with 55 additions and 17 deletions

View File

@ -351,10 +351,11 @@ public class API {
body.put("drive_id", user.getDriveId());
return new JSONObject(oauth("openFile/getDownloadUrl", body.toString(), true)).getString("url");
} catch (Exception e) {
Init.execute(this::deleteAll);
e.printStackTrace();
return "";
} finally {
deleteAll();
Init.execute(this::deleteAll);
}
}
@ -370,10 +371,11 @@ 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 {
deleteAll();
Init.execute(this::deleteAll);
}
}
@ -396,21 +398,15 @@ public class API {
}
private void deleteAll() {
for (String tempId : tempIds) if (!TextUtils.isEmpty(tempId)) delete(tempId);
for (String tempId : tempIds) delete(tempId);
}
private void delete(String fileId) {
try {
SpiderDebug.log("Delete..." + fileId);
JSONObject body = new JSONObject();
body.put("file_id", fileId);
body.put("drive_id", user.getDriveId());
String result = oauth("openFile/delete", body.toString(), true);
SpiderDebug.log(result + "," + result.length());
if (result.length() == 125) tempIds.remove(fileId);
} catch (Exception e) {
e.printStackTrace();
}
SpiderDebug.log("Delete..." + fileId);
String json = "{\"requests\":[{\"body\":{\"drive_id\":\"%s\",\"file_id\":\"%s\"},\"headers\":{\"Content-Type\":\"application/json\"},\"id\":\"%s\",\"method\":\"POST\",\"url\":\"/file/delete\"}],\"resource\":\"file\"}";
json = String.format(json, user.getDriveId(), fileId, fileId);
String result = auth("adrive/v2/batch", json, true);
if (result.length() == 211) tempIds.remove(fileId);
}
public Object[] proxySub(Map<String, String> params) {

View File

@ -43,6 +43,10 @@ public class Result {
@SerializedName("total")
private int total;
public static Result objectFrom(String str) {
return new Gson().fromJson(str, Result.class);
}
public static String string(List<Class> classes, List<Vod> list, LinkedHashMap<String, List<Filter>> filters) {
return Result.get().classes(classes).vod(list).filters(filters).string();
}

View File

@ -96,6 +96,10 @@ public class Vod {
this.vodContent = Trans.get(vodContent);
}
public String getVodContent() {
return vodContent;
}
public void setVodPlayFrom(String vodPlayFrom) {
this.vodPlayFrom = Trans.get(vodPlayFrom);
}

View File

@ -0,0 +1,24 @@
package com.github.catvod.spider;
import android.content.Context;
import com.github.catvod.bean.Result;
import com.github.catvod.bean.Vod;
import com.github.catvod.net.OkHttp;
import java.net.URLEncoder;
public class Dovx extends Ali {
@Override
public void init(Context context, String extend) {
super.init(context, extend);
}
@Override
public String searchContent(String key, boolean quick) {
Result result = Result.objectFrom(OkHttp.string("https://api.dovx.tk/ali/search?wd=" + URLEncoder.encode(key)));
for (Vod vod : result.getList()) vod.setVodId(vod.getVodContent());
return result.string();
}
}

Binary file not shown.

View File

@ -1 +1 @@
be4d70b1bec4f2c930972aa6685ffe19
f2064f61914f9fe0258820ab04b5abce

View File

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

View File

@ -1,5 +1,5 @@
{
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;be4d70b1bec4f2c930972aa6685ffe19",
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;f2064f61914f9fe0258820ab04b5abce",
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
"sites": [
{
@ -78,6 +78,16 @@
"changeable": 0,
"ext": "影視天下第一"
},
{
"key": "七夜",
"name": "七夜",
"type": 3,
"api": "csp_Dovx",
"searchable": 1,
"filterable": 0,
"changeable": 0,
"ext": "影視天下第一"
},
{
"key": "易搜",
"name": "易搜",