目的是把多个Tracker 服务器下载合并到一个txt文档去除空行和重复项。
用GPT生成的vbs脚本去空行、删除重复项无效,请问大佬们要怎么修改?谢谢 | Dim objFSO, objShell, objHTTP, strURL, strContent, arrURLs, line, uniqueContent | | | | Set objFSO = CreateObject("Scripting.FileSystemObject") | | Set objShell = CreateObject("WScript.Shell") | | Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP") | | | | | | Set uniqueContent = CreateObject("Scripting.Dictionary") | | | | | | arrURLs = Array( _ | | "https://raw.githubusercontent.com/Tunglies/TrackersList/main/all.txt", _ | | "https://cf.trackerslist.com/best.txt", _ | | "https://raw.adysec.com/adysec/tracker/main/trackers_best.txt", _ | | "https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt", _ | | "https://raw.githubusercontent.com/DeSireFire/animeTrackerList/master/AT_all_https.txt" _ | | ) | | | | | | For Each strURL In arrURLs | | objHTTP.open "GET", strURL, False | | objHTTP.send | | | | If objHTTP.Status = 200 Then | | strContent = objHTTP.ResponseText | | For Each line In Split(strContent, vbCrLf) | | | | If Trim(line) <> "" Then | | If Not uniqueContent.Exists(line) Then | | uniqueContent.Add line, "" | | End If | | End If | | Next | | End If | | Next | | | | | | Set objOutputFile = objFSO.CreateTextFile("combined_content.txt", True) | | For Each item In uniqueContent.Keys | | objOutputFile.WriteLine(item) | | Next | | objOutputFile.Close | | | | Set objFSO = Nothing | | Set objShell = Nothing | | Set objHTTP = Nothing | | Set uniqueContent = NothingCOPY |
|