本帖最后由 kaze 于 2020-2-19 13:36 编辑
整了一个代码,最近github.com网络很卡(我觉得是GFW搞得鬼),半天才能打开网址,如何重复发送http get,解决获取网站数据的网络问题,(我的另外一个扒拉数据的也挂了)
故障代码 (40, 1) msxml3.dll: 系统无法找到指定的资源。
附:获取trackers列表增加BT速度代码- /*&cls
- @echo off
- title get trackers list
- echo get trackers list
- cd /d "%~dp0"
- cscript -nologo -e:jscript "%~f0"
- pause&exit /b
- */
- var fso=new ActiveXObject('Scripting.FileSystemObject');
- var http=new ActiveXObject('MSXML2.XMLHTTP');
- var d=new Date();
- var today=d.getFullYear()+"-"+("0"+(d.getMonth()+1)).slice(-2)+"-"+("0"+d.getDate()).slice(-2);
- var url1='https://newtrackon.com/api/live';
- var url2='https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt';
- var tracker1=gettext(url1);
- var tracker2=gettext(url2);
- if (tracker1&&tracker2){
- tracker=(tracker1+tracker2).replace(/\n\n/g,'\n').replace(/\n$/,'');
- arr=tracker.split("\n");
- for(var i=0; i<arr.length; i++){
- for(var j=i+1; j<arr.length; j++){
- if(arr[i]==arr[j]){
- arr.splice(j,1);
- j--;
- }
- }
- }
-
- ntrackers=arr.join("\n");
- var f=fso.CreateTextFile('D:\\trackers-'+today+'.txt',2,true);
- f.Write(ntrackers);
- f.Close();
- }
- else {WSH.echo('Network error!')}
- WSH.Quit();
-
- function gettext(url){
- var text='';
- http.open('GET', url, false);
- http.send();
- text=http.responseText;
- return text;
- }
复制代码
|