Merge remote-tracking branch 'origin/multiThread' into multiThread
# Conflicts: # jar/custom_spider.jar # jar/custom_spider.jar.md5
This commit is contained in:
commit
22b771615f
|
|
@ -24,7 +24,13 @@ import com.github.catvod.net.OkHttp;
|
||||||
import com.github.catvod.net.OkResult;
|
import com.github.catvod.net.OkResult;
|
||||||
import com.github.catvod.spider.Init;
|
import com.github.catvod.spider.Init;
|
||||||
import com.github.catvod.spider.Proxy;
|
import com.github.catvod.spider.Proxy;
|
||||||
import com.github.catvod.utils.*;
|
import com.github.catvod.utils.Json;
|
||||||
|
import com.github.catvod.utils.Notify;
|
||||||
|
import com.github.catvod.utils.Path;
|
||||||
|
import com.github.catvod.utils.ProxyVideo;
|
||||||
|
import com.github.catvod.utils.QRCode;
|
||||||
|
import com.github.catvod.utils.ResUtil;
|
||||||
|
import com.github.catvod.utils.Util;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -32,7 +38,15 @@ import org.apache.commons.lang3.StringUtils;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.UUID;
|
||||||
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;
|
||||||
|
|
@ -168,7 +182,7 @@ public class QuarkApi {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
SpiderDebug.log("资源已取消:" + e.getMessage());
|
SpiderDebug.log("资源已取消:" + e.getMessage());
|
||||||
Notify.show("资源已取消");
|
Notify.show("资源已取消");
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> playFrom = QuarkApi.get().getPlayFormatList();
|
List<String> playFrom = QuarkApi.get().getPlayFormatList();
|
||||||
|
|
@ -474,14 +488,17 @@ public class QuarkApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearSaveDir() throws Exception {
|
private void clearSaveDir() throws Exception {
|
||||||
|
|
||||||
Map<String, Object> listData = Json.parseSafe(api("file/sort?" + this.pr + "&pdir_fid=" + this.saveDirId + "&_page=1&_size=200&_sort=file_type:asc,updated_at:desc", Collections.emptyMap(), Collections.emptyMap(), 0, "GET"), Map.class);
|
Map<String, Object> listData = Json.parseSafe(api("file/sort?" + this.pr + "&pdir_fid=" + this.saveDirId + "&_page=1&_size=200&_sort=file_type:asc,updated_at:desc", Collections.emptyMap(), Collections.emptyMap(), 0, "GET"), Map.class);
|
||||||
if (listData.get("data") != null && ((List<Map<String, Object>>) ((Map<String, Object>) listData.get("data")).get("list")).size() > 0) {
|
|
||||||
List<String> list = new ArrayList<>();
|
if (listData.get("data") != null) {
|
||||||
for (Map<String, Object> stringStringMap : ((List<Map<String, Object>>) ((Map<String, Object>) listData.get("data")).get("list"))) {
|
List<Map<String, Object>> fileList = (List<Map<String, Object>>) ((Map<String, Object>) listData.get("data")).get("list");
|
||||||
list.add((String) stringStringMap.get("fid"));
|
if (fileList.size() >= 10) {
|
||||||
|
List<String> fileIdsToDelete = new ArrayList<>();
|
||||||
|
for (Map<String, Object> file : fileList) {
|
||||||
|
fileIdsToDelete.add((String) file.get("fid"));
|
||||||
|
}
|
||||||
|
api("file/delete?" + this.pr + "&uc_param_str=", Collections.emptyMap(), Map.of("action_type", 2, "filelist", fileIdsToDelete, "exclude_fids", Collections.emptyList()), 0, "POST");
|
||||||
}
|
}
|
||||||
api("file/delete?" + this.pr, Collections.emptyMap(), Map.of("action_type", "2", "filelist", Json.toJson(list), "exclude_fids", ""), 0, "POST");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;0cab1186330902b80785825911735a7d",
|
"spider": "https://andoridspidermt.netlify.app/jar/custom_spider.jar;md5;e27d8367c711ebf383ae645b40b79d53",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "电视直播",
|
"name": "电视直播",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue