功能
1、启动qbittorrent
2、将最新的trackers放到剪贴板,进去就能右键粘贴了
; -------------------------- Run as Administrator --------------------------
full_command_line := DllCall("GetCommandLine", "str")
If not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
Try
{
If A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
Else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
; ------------------------------------------------------------------------------
#NoEnv
#SingleInstance, Force
SetBatchLines, -1
DetectHiddenWindows, On
#NoTrayIcon
; ------------------------------------------------------------------------------
IniRead, qbittorrent, DIR.ini, DIR, qbittorrent
if (qbittorrent="ERROR")
{
FileSelectFile, qbittorrent,,1,选择qbittorrent的启动exe
IniWrite, %qbittorrent%,DIR.ini, DIR, qbittorrent
}
; -------------------------- 自己改成需要的链接 --------------------------
trackers:="`n" downloadtracker("https://cdn.jsdelivr.net/gh/ngosang/trackerslist@master/trackers_all.txt")
trackers.="`n" downloadtracker("https://cdn.jsdelivr.net/gh/ngosang/trackerslist@master/trackers_all_http.txt")
trackers.="`n" downloadtracker("https://cdn.jsdelivr.net/gh/ngosang/trackerslist@master/trackers_all_https.txt")
trackers.="`n" downloadtracker("https://cdn.jsdelivr.net/gh/ngosang/trackerslist@master/trackers_all_ip.txt")
trackers.="`n" downloadtracker("https://cdn.jsdelivr.net/gh/ngosang/trackerslist@master/trackers_all_udp.txt")
trackers.="`n" downloadtracker("https://trackerslist.com/all.txt")
; -------------------------- 将trackers放到剪贴板 --------------------------
Clipboard := % trackers
; ------------------------------------------------------------------------------
WinGet, a, List, ahk_exe qbittorrent.exe
If (a>0)
{
Run "%qbittorrent%"
Msgbox,4096,, trackers在剪贴板
WinActivate, ahk_exe qbittorrent.exe
ExitApp
; --------
}Else{
loop,%a%
{
WinGet, pida, PID, % "ahk_id" a%A_Index%
Process, close, %pida%
}
Run "%qbittorrent%"
Msgbox,4096,, trackers在剪贴板
WinActivate, ahk_exe qbittorrent.exe
ExitApp
}
; ------------------------------------------------------------------------------
downloadtracker(trackerurl){
try{
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
}
try{
whr.Open("GET", trackerurl, true)
}
try{
whr.Send()
}
; 使用 'true'(上面) 和调用下面的函数, 允许脚本保持响应.
try{
whr.WaitForResponse()
}
try{
Return whr.ResponseText
}
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。