低端影视修复

This commit is contained in:
lushunming 2024-09-23 13:46:03 +08:00
parent 6453ce95a7
commit 528d97ed9d
8 changed files with 15 additions and 10 deletions

View File

@ -47,11 +47,15 @@ public class Proxy extends Spider {
String url = Util.base64Decode(params.get("url"));
Map<String, String> header = new Gson().fromJson(Util.base64Decode(params.get("header")), Map.class);
if (header == null) header = new HashMap<>();
/* List<String> keys = Arrays.asList("referer", "range", "connection", "accept-encoding");
for (String key : params.keySet()) if (keys.contains(key)) header.put(key, params.get(key));*/
for (Map.Entry<String, String> entry : params.entrySet()) {
if (!keys.contains(entry.getKey())) header.put(entry.getKey(), entry.getValue());
List<String> keys = Arrays.asList( "range", "connection", "accept-encoding");
for (String key : params.keySet()) {
if (keys.contains(key.toLowerCase())) {
header.put(key, params.get(key));
}
}
/*for (Map.Entry<String, String> entry : params.entrySet()) {
if (!keys.contains(entry.getKey())) header.put(entry.getKey(), entry.getValue());
}*/
return ProxyVideo.proxy(url, header);
}

View File

@ -56,7 +56,7 @@ public class ProxyVideo {
Response response = OkHttp.newCall(url, headers);
SpiderDebug.log(" ++end proxy:");
SpiderDebug.log(" ++proxy res code:" + response.code());
SpiderDebug.log(" ++proxy res header:" + Json.toJson(headers));
SpiderDebug.log(" ++proxy res header:" + Json.toJson(response.headers()));
// SpiderDebug.log(" ++proxy res data:" + Json.toJson(response.body()));
String contentType = response.headers().get("Content-Type");
String contentDisposition = response.headers().get("Content-Disposition");

View File

@ -77,12 +77,13 @@ public class DdrkTest {
@org.junit.Test
public void playerContent() throws Exception {
String froms = "第1季";
String urls = "第01集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfOrVlYXtr0IrFW8lVeTT91H%2BUSu5z72Gkx6JAGA8EXlJLvetAfVTXXDhxuKCGJ6Q3Ngws821BcBwndpb%2B2GPjbo%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E01.ddr#第02集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfML0vn1KlTxF0sG%2BEHO21R1cpLbSt%2BXLLxl1R4ROccMqgxKrfB%2BNEqcywjLdgdnFeNOYu8Jp86q1LceYrzyfRNA%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E02.ddr#第03集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfLSbJjBcNaYf0d9KYtSt4Dc4guy5jGVmk1NGoRUN%2FTKNo3wIPi9zaht0T3iaVrIG9aowYlrg4M3ZhF5tpKa5a3Q%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E03.ddr#第04集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfOhtDTTFt4SsSqDAXc29K%2FjRaWjRW4rFJYEkL3dGQ8lunDdVoVDCdwLM3MRdkE5GKZiwJnFV4yokt%2FJTlu6W9B0%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E04.ddr#第05集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfOekWLffYiwPueR2d%2F2jlsdoB2MFrn7KZ7RZxnTO2Cl79FQ6JxdhLFZVKQMUfXjl61OPbX6mB2pwuMC8EZDTZM0%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E05.ddr#第06集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfBlB%2BSpxUCnlGPrINcu%2F1SBXw9E48vZepi2rbznJEL%2B7KaG%2FemNxcMt6i2tonlv%2Fj7Yiciu6%2FJp%2FnYHm9azBMMg%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E06.ddr#第07集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfA3oc9ABVnVTvqzAM188IauJwfyfj0mjiLGQipukzelI2Q3Wr%2F8jwBx1eB8yXqjb8GyGOSE4HjylzNNZEeNIPOE%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E07.ddr#第08集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfJOKQJ6QC7TwGBw%2B7XCHqWtRHmOW78EwIA2WdpWoLK6LZMorbbBF7F8CY0%2F8%2BybxkKutVTxcbwJHLYeq5KfaWXE%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E08.ddr#第09集$https://ddys.pro/getvddr/video?id\u003dKqivU7FCez3AzaByqNMjDfGnF9itLkgWcRnE0NAeMTe7Z8DVPXWR%2FJvYQBGf52fOhv3jBlQ5LihxM6O5JO%2FANOmvP8XvKojMNTHvRaasviQ%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E09.ddr#第10集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfFuxdVAN%2F0ZWpHmPYouX2tGpQafvtO9opv55jVEdqxgnUQwDcXdACwZgP4oMbk0O41aQjab0YOv7F6a2%2BcyCxfk%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E10.ddr#第11集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfB7AzCUzGnvni8EaQgDUAeruvMOEP%2By29vrNL0bgRjV9I4o2IIifgYqTV8EVqhjFogonUNDLNcMFJ5w408hLH3k%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E11.ddr#第12集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfNEKVB%2FplZ4P8g2xyropO3Y344w4x0tjIUr6ZONvPl8QALRIdahfpQFpp5qbK4ufOGYGLHq6zXREpfmhWe0HAkI%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E12.ddr#第13集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfBFMTt9r5WqhZpmc4QQgU0iRjSqc8YQDAEEFCzIar44C%2FwGy4p9PfsBWfynJpu42%2BRv4DgCcpqB%2BXLsv8X24NDQ%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E13.ddr#第14集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfNSmR2YMg3lNOPuwjam%2BOxI4BpWDMdwFRRHLh4PixAzLN5296mDjoA763gkjeEDNYsn6HIU597ge05ZI%2BgWizC8%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E14.ddr#第15集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfI4TiWm%2FCMVOWx2lxRgpl%2BVtwmPeyHyP%2FtdIdfekVgRV69u4HkYZYbLrCHFMLabFTSn3jdgVM5TyCIjypo9O%2F0E%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E15.ddr#第16集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfMieUkuUIEB34HJ4yRt0c18%2F%2BfEyUXCCGYReb9sKVXc8X%2FfcV1nHUDLMb9HeDSZSuf14zDDFEk9DHQNpUgvFa8A%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E16.ddr#第17集$https://ddys.pro/getvddr/video?id\u003dfBG%2Flj6cvF9dk4FfQ5csfKeqB9W4XjNkL%2FsKDi7jnfOhHRtJsT4E1o9nXo8o28wnphO1591NKKbPAWn8Sf%2FFcmrKbymYzH4wwwzlKCL1IQY%3D\u0026type\u003dmix|https://ddys.pro/subddr//v/Anime/The_Fable/The_Fable_S01E17.ddr";
String urls = "第01集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E01.mp4#第02集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E02.mp4#第03集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E03.mp4#第04集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E04.mp4#第05集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E05.mp4#第06集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E06.mp4#第07集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E07.mp4#第08集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E08.mp4#第09集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E09.mp4#第10集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E10.mp4#第11集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E11.mp4#第12集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E12.mp4#第13集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E13.mp4#第14集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E14.mp4#第15集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E15.mp4#第16集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E16.mp4#第17集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E17.mp4#第18集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E18.mp4#第19集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E19.mp4#第20集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E20.mp4#第21集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E21.mp4#第22集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E22.mp4#第23集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E23.mp4#第24集$https://v.ddys.pro/v/Anime/The_Fable/The_Fable_S01E24.mp4";
for (int i = 0; i < urls.split("\\$\\$\\$").length; i++) {
for (int i1 = 0; i1 < urls.split("\\$\\$\\$")[i].split("#").length; i1++) {
String content = spider.playerContent(froms.split("\\$\\$\\$")[i], urls.split("\\$\\$\\$")[i].split("#")[i1].split("\\$")[1], new ArrayList<>());
JsonObject map = Json.safeObject(content);
Gson gson = new GsonBuilder().setPrettyPrinting().create();
System.out.println("playerContent--" + content);
System.out.println("playerContent--" + gson.toJson(map));
Assert.assertFalse(map.getAsJsonPrimitive("url").getAsString().isEmpty());
}

Binary file not shown.

View File

@ -1 +1 @@
78ef1d925a422c7d2b2ada61e32c5d38
6b32420ea8da1560ff69f609769fc883

View File

@ -1,5 +1,5 @@
{
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;78ef1d925a422c7d2b2ada61e32c5d38",
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;6b32420ea8da1560ff69f609769fc883",
"lives": [
{
"name": "直播ipv6",

View File

@ -1,5 +1,5 @@
{
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;78ef1d925a422c7d2b2ada61e32c5d38",
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;6b32420ea8da1560ff69f609769fc883",
"lives": [
{
"name": "直播ipv6",

View File

@ -1,5 +1,5 @@
{
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;78ef1d925a422c7d2b2ada61e32c5d38",
"spider": "https://androidcatvodspider.pages.dev/jar/custom_spider.jar;md5;6b32420ea8da1560ff69f609769fc883",
"lives": [
{
"name": "直播ipv6",