qbittorrent相关-启动及更新trackers

功能

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
    }
}

给TA捐赠
共{{data.count}}人
人已捐赠
其他

Excel函数的使用有大哥教教我不

2022-4-22 20:19:18

其他案例

Kawvin_Excel多工作簿数据合并

2022-4-27 14:27:21

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
有新私信 私信列表
搜索