天意accessToken
This commit is contained in:
parent
3fd5670471
commit
42a916ac7b
|
|
@ -9,15 +9,14 @@ import com.github.catvod.crawler.SpiderDebug;
|
||||||
import com.github.catvod.net.OkHttpWithCookie;
|
import com.github.catvod.net.OkHttpWithCookie;
|
||||||
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.utils.*;
|
import com.github.catvod.utils.*;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
import okhttp3.Cookie;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
|
|
@ -140,14 +139,17 @@ public class TianyiApi {
|
||||||
Map<String, String> header = getHeaders();
|
Map<String, String> header = getHeaders();
|
||||||
header.remove("Host");
|
header.remove("Host");
|
||||||
header.remove("Content-Type");
|
header.remove("Content-Type");
|
||||||
|
List<String> cookies = new ArrayList<>();
|
||||||
|
for (String s : tianYiHandler.getCookieJar().getCookieStore().keySet()) {
|
||||||
|
for (Cookie cookie : tianYiHandler.getCookieJar().getCookieStore().get(s)) {
|
||||||
|
cookies.add(cookie.name() + "=" + cookie.value());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
header.put("Cookie", TextUtils.join(";", cookies));
|
||||||
return Result.get().url(ProxyVideo.buildCommonProxyUrl(playUrl, header)).octet().header(header).string();
|
return Result.get().url(ProxyVideo.buildCommonProxyUrl(playUrl, header)).octet().header(header).string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String proxyVideoUrl(String url, Map<String, String> header) {
|
|
||||||
return String.format(Proxy.getUrl() + "?do=quark&type=video&url=%s&header=%s", Util.base64Encode(url.getBytes(Charset.defaultCharset())), Util.base64Encode(Json.toJson(header).getBytes(Charset.defaultCharset())));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param url
|
* @param url
|
||||||
* @param params get 参数
|
* @param params get 参数
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
5da083c7c4fc601b94e45e6f9e0a2172
|
65b5c5c84143ee6a6b8a46d75b0d132f
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://raw.kkgithub.com/lushunming/AndroidCatVodSpider/tyCookieJar/jar/custom_spider.jar;md5;5da083c7c4fc601b94e45e6f9e0a2172",
|
"spider": "https://raw.kkgithub.com/lushunming/AndroidCatVodSpider/tyCookieJar/jar/custom_spider.jar;md5;65b5c5c84143ee6a6b8a46d75b0d132f",
|
||||||
"lives": [
|
"lives": [
|
||||||
{
|
{
|
||||||
"name": "电视直播",
|
"name": "电视直播",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue