修改了订阅地址

This commit is contained in:
Yutousama 2021-11-06 01:28:17 +08:00
parent cc3027b950
commit cb708d5e44
2 changed files with 6 additions and 3 deletions

View File

@ -150,7 +150,7 @@ public class tools {
@RequestMapping(value="/tools/clash/get.do",produces ="text/plain;charset=utf-8") @RequestMapping(value="/tools/clash/get.do",produces ="text/plain;charset=utf-8")
public String getClash(){ public String getClash(){
StringBuilder builder=new StringBuilder(); StringBuilder builder=new StringBuilder();
String text= HttpTools.get("https://pub-api-1.bianyuan.xyz/sub?target=clash&url=https%3A%2F%2Fs.sublink.me%2Fsubscribe%2F2611%2F8rXy3HKfdI8%2Fssr%2F&insert=false&config=https%3A%2F%2Fraw.githubusercontent.com%2FACL4SSR%2FACL4SSR%2Fmaster%2FClash%2Fconfig%2FACL4SSR_Online_AdblockPlus.ini&emoji=true&list=false&tfo=false&scv=false&fdn=false&sort=false&new_name=true"); String text= HttpTools.get("https://pub-api-1.bianyuan.xyz/sub?url=https%3A%2F%2Fs.sublink.me%2Fsubscribe%2F2611%2F8rXy3HKfdI8%2Fssr%2F&insert=false&config=https%3A%2F%2Fraw.githubusercontent.com%2FDarkatse%2FACL4SSR%2Fmaster%2FClash%2Fconfig%2FACL4SSR_Online.ini&target=clash");
String[] tmp=text.split("\n"); String[] tmp=text.split("\n");
text=RedisTools.get("clash"); text=RedisTools.get("clash");
for (String s : tmp) { for (String s : tmp) {

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yutou.tools.interfaces.DownloadInterface; import com.yutou.tools.interfaces.DownloadInterface;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import javax.net.ssl.HttpsURLConnection;
import java.io.*; import java.io.*;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
@ -29,8 +30,10 @@ public class HttpTools {
public static String https_get(String url, Map<String, String> header) { public static String https_get(String url, Map<String, String> header) {
try { try {
URLConnection connection; HttpsURLConnection connection;
connection = new URL(url).openConnection(); connection = (HttpsURLConnection) new URL(url).openConnection();
connection.setConnectTimeout(60*1000);
connection.setReadTimeout(60*1000);
connection.setRequestProperty("User-Agent", getExtUa()); connection.setRequestProperty("User-Agent", getExtUa());
if (header != null) { if (header != null) {
for (String key : header.keySet()) { for (String key : header.keySet()) {