Fix build

This commit is contained in:
FongMi 2023-01-03 14:11:49 +08:00
parent 0d61a541ee
commit c523ab990f
8 changed files with 78 additions and 100 deletions

View File

@ -15,3 +15,4 @@ dependencyResolutionManagement {
}
rootProject.name = "CatVodSpider"
include ':app'
include ':tools'

View File

@ -1,18 +1,10 @@
plugins {
id 'java'
id 'java-library'
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral()
}
compileJava {
options.encoding = 'UTF-8'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {

View File

@ -1,4 +0,0 @@
data.json 為對應表,可依據需求新增修改 epg、name、logo。
1. 執行 run.bat
2. 輸入直播文本網址或檔名
3. 自動產出 live.json

View File

@ -1 +0,0 @@
java -jar run.jar

Binary file not shown.

View File

@ -1 +0,0 @@
rootProject.name = 'tools'

View File

@ -1,2 +0,0 @@
Manifest-Version: 1.0
Main-Class: com.fongmi.tools.Run

View File

@ -12,7 +12,6 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Scanner;
public class Run {
@ -21,24 +20,18 @@ public class Run {
private final Gson gson;
public static void main(String[] args) throws IOException {
if (args.length > 0) {
new Run().start(args[0]);
} else {
System.out.print("請輸入網址或檔名:");
new Run().start(new Scanner(System.in).nextLine());
}
new Run().start("http://home.jundie.top:81/Cat/tv/live.txt");
}
public Run() {
groups = new ArrayList<>();
data = Data.arrayFrom(Util.getFile("data.json"));
data = Data.arrayFrom(Util.getFile(getClass(), "data.json"));
gson = new Gson().newBuilder().disableHtmlEscaping().setPrettyPrinting().create();
}
private void start(String text) throws IOException {
if (text.startsWith("http")) parse(Util.call(text));
else parse(Util.getFile(text));
//parseTxt(Util.getFile(getClass(), "live.txt"));
parse(Util.call(text));
writeFile();
}
@ -96,7 +89,7 @@ public class Run {
private void writeFile() {
try {
File file = new File("live.json");
File file = new File("json", "live.json");
PrintWriter writer = new PrintWriter(file, String.valueOf(StandardCharsets.UTF_8));
writer.println(gson.toJson(groups));
writer.close();