parent
cfa8d12e83
commit
0d61a541ee
Binary file not shown.
@ -0,0 +1,5 @@ |
||||
distributionBase=GRADLE_USER_HOME |
||||
distributionPath=wrapper/dists |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip |
||||
zipStoreBase=GRADLE_USER_HOME |
||||
zipStorePath=wrapper/dists |
||||
@ -0,0 +1,4 @@ |
||||
data.json 為對應表,可依據需求新增修改 epg、name、logo。 |
||||
1. 執行 run.bat |
||||
2. 輸入直播文本網址或檔名 |
||||
3. 自動產出 live.json |
||||
@ -0,0 +1 @@ |
||||
java -jar run.jar |
||||
Binary file not shown.
@ -0,0 +1 @@ |
||||
rootProject.name = 'tools' |
||||
@ -0,0 +1,2 @@ |
||||
Manifest-Version: 1.0 |
||||
Main-Class: com.fongmi.tools.Run |
||||
@ -1,22 +1,39 @@ |
||||
package com.fongmi.tools; |
||||
|
||||
import java.io.IOException; |
||||
import java.net.URI; |
||||
import java.nio.charset.StandardCharsets; |
||||
import java.nio.file.Files; |
||||
import java.nio.file.Path; |
||||
import java.nio.file.Paths; |
||||
import java.util.stream.Stream; |
||||
|
||||
import okhttp3.OkHttpClient; |
||||
import okhttp3.Request; |
||||
|
||||
public class Util { |
||||
|
||||
public static String getFile(Class<?> clz, String fileName) { |
||||
try { |
||||
StringBuilder sb = new StringBuilder(); |
||||
URI uri = clz.getClassLoader().getResource(fileName).toURI(); |
||||
Stream<String> stream = Files.lines(Paths.get(uri), StandardCharsets.UTF_8); |
||||
stream.forEach(s -> sb.append(s).append("\n")); |
||||
return sb.toString(); |
||||
} catch (Exception e) { |
||||
return ""; |
||||
} |
||||
} |
||||
public static String call(String url) throws IOException { |
||||
return new OkHttpClient().newCall(new Request.Builder().url(url).build()).execute().body().string(); |
||||
} |
||||
|
||||
public static String getFile(Class<?> clz, String fileName) { |
||||
try { |
||||
StringBuilder sb = new StringBuilder(); |
||||
URI uri = clz.getClassLoader().getResource(fileName).toURI(); |
||||
Stream<String> stream = Files.lines(Paths.get(uri), StandardCharsets.UTF_8); |
||||
stream.forEach(s -> sb.append(s).append("\n")); |
||||
return sb.toString(); |
||||
} catch (Exception e) { |
||||
return ""; |
||||
} |
||||
} |
||||
|
||||
public static String getFile(String fileName) { |
||||
try { |
||||
return Files.readString(Path.of(fileName)); |
||||
} catch (Exception e) { |
||||
return ""; |
||||
} |
||||
} |
||||
} |
||||
|
||||
Loading…
Reference in new issue