Skip to content

Commit ccb794d

Browse files
committed
更新ping相关类
1 parent c74b77e commit ccb794d

File tree

200 files changed

+12240
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+12240
-100
lines changed

free-apps/src/main/java/com/coderdream/freeapps/util/bbc/TranslateUtil.java

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public class TranslateUtil {
2020

2121
public static void main(String[] args) {
2222

23-
String folderName = "220609";
23+
String folderName = "210318";
2424
// TranslateUtil.process(folderName);
25-
TranslateUtil.mergeScriptContent(folderName);
26-
// TranslateUtil.translateEngSrc(folderName);
25+
// TranslateUtil.mergeScriptContent(folderName);
26+
TranslateUtil.translateEngSrc(folderName);
2727

2828
// String str = "大括号外面的内容(Michael Collins)的内容(Michael Collins) ";
2929
// str = removeEnContent(str);
@@ -42,10 +42,21 @@ public static void main(String[] args) {
4242
@NotNull
4343
private static String removeEnContent(String str) {
4444
do {
45-
int startIndex = str.indexOf("(");
46-
int endIndex = str.indexOf(")");
45+
int startIndex = str.lastIndexOf("(");
46+
int endIndex = str.lastIndexOf(")");
4747
if (startIndex != -1 && endIndex != -1) {
48-
str = str.replaceAll(str.substring(startIndex, endIndex + 1), "");
48+
try {
49+
if (startIndex > 0 && endIndex > 0) {
50+
str = str.replaceAll(str.substring(startIndex, endIndex + 1), "");
51+
} else {
52+
System.out.println(
53+
"########## ERROR: startIndex is " + startIndex + "; endIndex is " + endIndex + "; str "
54+
+ str);
55+
}
56+
} catch (Exception e) {
57+
e.printStackTrace();
58+
System.out.println("### str " + str);
59+
}
4960
}
5061
} while (str.contains("(") && str.contains(")"));
5162
return str;
@@ -360,15 +371,15 @@ public static void translateEngSrc(String folderName) {
360371
// 写中文翻译文本
361372
CdFileUtils.writeToFile(srcFileNameCn, newList);
362373

363-
// 双语字幕
364-
String srcFileNameEnCn = CommonUtil.getFullPathFileName(folderName, "audio5", ".srt");
365-
// 写双语歌词文本
366-
CdFileUtils.writeToFile(srcFileNameEnCn, newListEnCn);
367-
368-
// 双语歌词
369-
String lrcFileNameEnCn = CommonUtil.getFullPathFileName(folderName, "audio5", ".lrc");
370-
// 写双语歌词文本
371-
CdFileUtils.writeToFile(lrcFileNameEnCn, lrcListEnCn);
374+
// // 双语字幕
375+
// String srcFileNameEnCn = CommonUtil.getFullPathFileName(folderName, "audio5", ".srt");
376+
// // 写双语歌词文本
377+
// CdFileUtils.writeToFile(srcFileNameEnCn, newListEnCn);
378+
//
379+
// // 双语歌词
380+
// String lrcFileNameEnCn = CommonUtil.getFullPathFileName(folderName, "audio5", ".lrc");
381+
// // 写双语歌词文本
382+
// CdFileUtils.writeToFile(lrcFileNameEnCn, lrcListEnCn);
372383
}
373384

374385
/**

free-apps/src/main/java/com/coderdream/freeapps/util/bbc/WordCountUtil.java

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.coderdream.freeapps.util.other.TxtUtil;
1212
import java.io.File;
1313
import java.util.ArrayList;
14+
import java.util.Arrays;
1415
import java.util.HashSet;
1516
import java.util.LinkedHashSet;
1617
import java.util.List;
@@ -30,8 +31,82 @@
3031
public class WordCountUtil {
3132

3233
public static void main(String[] args) {
33-
String folderName = "240104";
34-
WordCountUtil.genVocTable(folderName);
34+
// String folderName = "240111";
35+
// WordCountUtil.genVocTable(folderName);
36+
List<String> NUMBER_LIST = Arrays.asList(
37+
// "210107",
38+
// "210114",
39+
// "210121",
40+
// "210128",
41+
// "210211",
42+
// "210218",
43+
// "210225",
44+
// "210304",
45+
// "210311",
46+
// "210318",
47+
// "210325",
48+
// "210401",
49+
// "210408",
50+
// "210415",
51+
// "210422",
52+
// "210429",
53+
// "210506",
54+
// "210513",
55+
// "210520",
56+
// "210527",
57+
// "210603",
58+
// "210610",
59+
// "210617",
60+
// "210624",
61+
// "210701",
62+
// "210708",
63+
// "210715",
64+
// "210719",
65+
// "210722",
66+
// "210726",
67+
// "210729",
68+
// "210802",
69+
// "210805",
70+
// "210809",
71+
// "210812",
72+
// "210816",
73+
// "210819",
74+
// "210823",
75+
// "210826",
76+
// "210902",
77+
// "210906",
78+
// "210909",
79+
// "210913",
80+
// "210916",
81+
// "210920",
82+
// "210923",
83+
// "210927",
84+
// "210930",
85+
// "211007",
86+
// "211014",
87+
// "211021",
88+
// "211028",
89+
// "211104",
90+
// "211111",
91+
// "211118",
92+
// "211125",
93+
// "211202",
94+
// "211209",
95+
// "211216",
96+
// "211223",
97+
// "210304",
98+
// "210311",
99+
// "240125"
100+
"210408"
101+
// ,
102+
// "210218",
103+
// "210225"
104+
);
105+
106+
for (String num : NUMBER_LIST) {
107+
String folderName = "" + num;
108+
WordCountUtil.genVocTable(folderName);
109+
}
35110

36111
// System.out.println(WordCountUtil.removeChar("-abc"));
37112
// System.out.println(WordCountUtil.removeChar("--abc"));
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
package com.coderdream.freeapps.util.finalshell;
2+
3+
import java.io.ByteArrayOutputStream;
4+
import java.io.DataOutputStream;
5+
import java.io.IOException;
6+
import java.math.BigInteger;
7+
import java.security.MessageDigest;
8+
import java.security.NoSuchAlgorithmException;
9+
import java.security.SecureRandom;
10+
import java.util.Base64;
11+
import java.util.Random;
12+
13+
import javax.crypto.Cipher;
14+
import javax.crypto.SecretKey;
15+
import javax.crypto.SecretKeyFactory;
16+
import javax.crypto.spec.DESKeySpec;
17+
18+
public class FinalShellDecodePass {
19+
20+
public static void main(String[] args) throws Exception {
21+
//入参改成加密的密码,运行一下,其他地方不需要修改
22+
System.out.println(decodePass("d2Z2dxs7Dw8odtOQOfTxdQwNaTsJ4Q+4"));
23+
}
24+
25+
public static byte[] desDecode(byte[] data, byte[] head) throws Exception {
26+
SecureRandom sr = new SecureRandom();
27+
DESKeySpec dks = new DESKeySpec(head);
28+
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
29+
SecretKey securekey = keyFactory.generateSecret(dks);
30+
Cipher cipher = Cipher.getInstance("DES");
31+
cipher.init(2, securekey, sr);
32+
return cipher.doFinal(data);
33+
}
34+
35+
public static String decodePass(String data) throws Exception {
36+
if (data == null) {
37+
return null;
38+
} else {
39+
String rs = "";
40+
byte[] buf = Base64.getDecoder().decode(data);
41+
byte[] head = new byte[8];
42+
System.arraycopy(buf, 0, head, 0, head.length);
43+
byte[] d = new byte[buf.length - head.length];
44+
System.arraycopy(buf, head.length, d, 0, d.length);
45+
byte[] bt = desDecode(d, ranDomKey(head));
46+
rs = new String(bt);
47+
48+
return rs;
49+
}
50+
}
51+
52+
static byte[] ranDomKey(byte[] head) {
53+
long ks = 3680984568597093857L / (long) (new Random((long) head[5])).nextInt(127);
54+
Random random = new Random(ks);
55+
int t = head[0];
56+
57+
for (int i = 0; i < t; ++i) {
58+
random.nextLong();
59+
}
60+
61+
long n = random.nextLong();
62+
Random r2 = new Random(n);
63+
long[] ld = new long[]{(long) head[4], r2.nextLong(), (long) head[7], (long) head[3], r2.nextLong(),
64+
(long) head[1], random.nextLong(), (long) head[2]};
65+
ByteArrayOutputStream bos = new ByteArrayOutputStream();
66+
DataOutputStream dos = new DataOutputStream(bos);
67+
long[] var15 = ld;
68+
int var14 = ld.length;
69+
70+
for (int var13 = 0; var13 < var14; ++var13) {
71+
long l = var15[var13];
72+
73+
try {
74+
dos.writeLong(l);
75+
} catch (IOException var18) {
76+
var18.printStackTrace();
77+
}
78+
}
79+
80+
try {
81+
dos.close();
82+
} catch (IOException var17) {
83+
var17.printStackTrace();
84+
}
85+
86+
byte[] keyData = bos.toByteArray();
87+
keyData = md5(keyData);
88+
return keyData;
89+
}
90+
91+
public static byte[] md5(byte[] data) {
92+
String ret = null;
93+
byte[] res = null;
94+
95+
try {
96+
MessageDigest m;
97+
m = MessageDigest.getInstance("MD5");
98+
m.update(data, 0, data.length);
99+
res = m.digest();
100+
ret = new BigInteger(1, res).toString(16);
101+
} catch (NoSuchAlgorithmException e) {
102+
e.printStackTrace();
103+
}
104+
return res;
105+
}
106+
}

free-apps/src/main/java/com/coderdream/freeapps/util/other/CdFileUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ public static List<String> readFileContent(String fileName) {
710710
String s = "";
711711
while ((s = bReader.readLine()) != null) {//逐行读取文件内容,不读取换行符和末尾的空格
712712
// sb.append(s + "\n");//将读取的字符串添加换行符后累加存放在缓存中
713-
stringList.add(s.trim());
713+
stringList.add(s.trim().replaceAll("\"","'"));
714714
// System.out.println(s);
715715
}
716716
// 补空行

free-apps/src/main/java/com/coderdream/freeapps/util/proxy/MultiThreadGenScriptTextExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ public void initTestArr() {
5454
List<DownloadInfoEntity> downloadInfoEntityListTemp = new ArrayList<>();
5555
if (test) {
5656
DownloadInfoEntity infoEntity = new DownloadInfoEntity();
57-
String ep = "240104";
57+
String ep = "240125";
5858
infoEntity.setFileUrl(
5959
"https://www.bbc.co.uk/learningenglish/english/features/6-minute-english_2024/ep-" + ep + "");
6060
infoEntity.setPath("D:/14_LearnEnglish/6MinuteEnglish/2024/" + ep + "/");
6161
infoEntity.setFileName(ep + ".html");
6262
downloadInfoEntityListTemp = Arrays.asList(infoEntity);
6363
} else {
64-
downloadInfoEntityListTemp = HtmlUtil.getDownloadHtmlInfo("pdf", "2022", "05");
64+
downloadInfoEntityListTemp = HtmlUtil.getDownloadHtmlInfo("pdf", "2021");
6565
}
6666

6767
String folderPath =

free-apps/src/main/java/com/coderdream/freeapps/util/proxy/MultiThreadProcessScriptTextExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void initTestArr() {
6666
downloadInfoEntityListTemp = Arrays.asList(infoEntity);
6767
} else {
6868
// downloadInfoEntityListTemp = HtmlUtil.getDownloadHtmlInfo("pdf", "2022", "03", "04", "05", "06", "07", "08", "09");
69-
downloadInfoEntityListTemp = HtmlUtil.getDownloadHtmlInfo("pdf", "2022", "06");
69+
downloadInfoEntityListTemp = HtmlUtil.getDownloadHtmlInfo("pdf", "2021");
7070
}
7171

7272
for (DownloadInfoEntity downloadInfoEntity : downloadInfoEntityListTemp) {

free-apps/src/main/java/com/coderdream/freeapps/util/proxy/NetProxy.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@
1919
public class NetProxy {
2020

2121
public static void main(String[] args) {
22-
// String pageUrl = "https://www.bbc.co.uk/learningenglish/english/features/6-minute-english";
23-
// pageUrl = "https://www.bbc.co.uk/learningenglish/english/features/6-minute-english_2023/ep-231102";
24-
// NetProxy.getPageInfo(pageUrl);
22+
String pageUrl = "https://www.bbc.co.uk/learningenglish/english/features/6-minute-english";
23+
pageUrl = "https://www.bbc.co.uk/learningenglish/english/features/6-minute-english_2023/ep-231102";
24+
NetProxy.getPageInfo(pageUrl);
2525

2626

27-
File pathFile = new File("D://c//c//");
28-
if (!pathFile.exists()) {
29-
pathFile.mkdirs();
30-
}
31-
32-
File file = new File("D://c//c//c.txt");
33-
if (!file.exists()) {
34-
try {
35-
file.createNewFile();
36-
} catch (IOException e) {
37-
throw new RuntimeException(e);
38-
}
39-
}
27+
// File pathFile = new File("D://c//c//");
28+
// if (!pathFile.exists()) {
29+
// pathFile.mkdirs();
30+
// }
31+
//
32+
// File file = new File("D://c//c//c.txt");
33+
// if (!file.exists()) {
34+
// try {
35+
// file.createNewFile();
36+
// } catch (IOException e) {
37+
// throw new RuntimeException(e);
38+
// }
39+
// }
4040
}
4141

4242
public static String getPageInfo(String pageUrl) {
@@ -67,7 +67,7 @@ public static String getPageInfo(String pageUrl) {
6767
while ((len = inputStream.read(buffer)) != -1) {
6868
// System.out.println("len: " + len);
6969
tempStr = new String(buffer, 0, len, "UTF-8");
70-
// System.out.println("tempStr: \t" + tempStr);
70+
System.out.println("tempStr: \t" + tempStr);
7171
sb1.append(tempStr);
7272
contentList.add(tempStr);
7373
index++;

0 commit comments

Comments
 (0)