侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

迅雷快车旋风下载专用链转换批处理代码

技术  /  管理员 发布于 7年前   224

效果图:

复制代码 代码如下:
::将下面所附代码保存为.BAT或.CMD格式的批处理文件,双击运行。
::Base64加密解密部分参考s11ss代码
::转载请注明来自SunTB
@echo off
set "base64=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="

:begin
cls
setlocal disabledelayedexpansion
echo.&echo 输入要转换的链接(若为真实下载链接,需以http://或ftp://开头):
set /p str=
if /i "%str:~0,10%"=="thunder://" goto :thunder
if /i "%str:~0,11%"=="flashget://" goto :flashget
if /i "%str:~0,7%"=="qqdl://" goto :qqdl
set m=1
goto :encode

:thunder
setlocal enabledelayedexpansion
for /f "delims=^&" %%a in ("%str%") do (
set str=%%a
set es=!str:~10!
)
set type=迅雷&set dltype=thunder
goto :Base64_Decode

:flashget
setlocal enabledelayedexpansion
for /f "delims=^&" %%a in ("%str%") do (
set str=%%a
set es=!str:~11!
)
set type=快车&set dltype=flashget
goto :Base64_Decode

:qqdl
setlocal enabledelayedexpansion
for /f "delims=^&" %%a in ("%str%") do (
set str=%%a
set es=!str:~7!
)
set type=旋风&set dltype=qqdl
goto :Base64_Decode

:encode
if /i not "%str:~0,7%"=="http://" (if /i not "%str:~0,6%"=="ftp://" (echo.&echo 链接格式有误,按任意键退出&pause>nul&goto :eof))
set s=
if %m% EQU 1 (set type=迅雷&set dltype=thunder&set s=AA%str%ZZ)
if %m% EQU 2 (set type=快车&set dltype=flashget&set s=[FLASHGET]%str%[FLASHGET])
if %m% EQU 3 (set type=旋风&set dltype=qqdl&set s=%str%)

::Base64加密
:Base64_Encode
setlocal
set vbs=%tmp%\t.vbs
if exist %vbs% goto :str2hex
set t=^>^>%vbs% echo
%t%s=wscript.arguments(0)
%t%h=""
%t%for i=1 to len(s)
%t% h=h^&cstr(hex(asc(mid(s,i,1))))
%t%next
%t%wscript.stdout.write(h)
:str2hex
set hex=
for /f %%a in ('cscript//nologo %vbs% "%s%"') do set "hex=%%a"
setlocal enabledelayedexpansion
:hex2base64
if not defined hex goto :print_Encode
for /l %%a in (1,1,3) do (
set/a "n=2*(%%a-1)"
call set x=%%hex:~!n!,2%%
set "c%%a=0x!x!"
if "!x!" equ "" set c%%a=0
)
set hex=%hex:~6%
set/a ec1=%c1%">>"2
set/a ec2=%c1%"<<"4"|"%c2%">>"4
set/a ec3=%c2%"<<"2"|"%c3%">>"6
set/a ec4=%c3%
for /l %%a in (1,1,4) do set/a ec%%a=!ec%%a!"&"63
if %c2% equ 0 set ec3=64
if %c3% equ 0 set ec4=64
for /l %%a in (1,1,4) do call set "es=%%es%%%%base64:~!ec%%a!,1%%"
goto :hex2base64
:print_Encode
echo.&echo.对应的 %type%下载专用链 转换如下:&echo.%dltype%://%es%
set es=
setlocal disabledelayedexpansion
if %m% EQU 3 (pause>nul&goto :eof) else (set /a m=%m%+1&goto :encode)

::Base64解密
:Base64_Decode
setlocal enabledelayedexpansion
:GetEs
set i=0
:base64-hex
set "o=!es:~%i%,1!"
if not "%o%" equ "" (call :b64-h1by1) else (goto :hex-hex2)
set/a i+=1
goto :base64-hex

:hex-hex2
if not defined hex goto :hex2-str
for /l %%a in (1,1,4) do (
set/a "n=2*(%%a-1)"
call set x=%%hex:~!n!,2%%
set "ec%%a=0x!x!"
if "!x!" equ "40" (set ec%%a=0& set f%%a=0)
)
set hex=%hex:~8%
set/a c1=%ec1%"<<"2"|"%ec2%">>"4
set/a c2=%ec2%"<<"4"|"%ec3%">>"2
set/a c3=%ec3%"<<"6"|"%ec4%
for /l %%a in (1,1,3) do (
set/a c%%a=!c%%a!"&"255
call :dec-hex !c%%a!
)
if "%f3%" equ "0" set "c2="
if "%f4%" equ "0" set "c3="
for /l %%a in (1,1,3) do call set "hex2=%%hex2%%%%r!c%%a!%%"
goto :hex-hex2

:hex2-str
set vbs=%tmp%\tt.vbs
if exist %vbs% goto :runVBS
:createVBS
set t=^>^>%vbs% echo
%t%h=wscript.arguments(0)
%t%s=""
%t%for i=1 to len(h) step 2
%t% a=cint("&h"^&mid(h,i,2))
%t% if a^>160 then
%t% a=cint("&h"^&mid(h,i,4))
%t% i=i+2
%t% end if
%t% s=s^&chr(a)
%t%next
%t%wscript.stdout.write(s)
:runVBS
for /f "delims=" %%a in ('cscript//nologo %vbs% %hex2%') do set "s=%%a"

:print_Decode
echo.&echo 该%type%链真实下载地址如下:
if "%type%"=="迅雷" echo.%s:~2,-2%
if "%type%"=="快车" echo.%s:~10,-10%
if "%type%"=="旋风" echo.%s%
pause>nul&goto :eof

:b64-h1by1
for /l %%a in (0,1,64) do (
if "!base64:~%%a,1!" equ "%o%" (
call :dec-hex %%a
set hex=!hex!!r%%a!
goto :eof
)
)
goto :eof

:dec-hex
set "r%1="
set "h=0123456789ABCDEF"
set/a q=%1
:1c
set/a r=%q%%%16
set/a q=%q%/16
call set r=%%h:~%r%,1%%
set r%1=%r%!r%1!
if not %q% equ 0 goto :1c
if %1 leq 0xf set r%1=0!r%1!

防止批处理因编辑器有问题,打包下载


  • 上一条:
    CHM 文档解包批处理代码
    下一条:
    DOS批处理之DATE命令的使用方法详解
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案(0个评论)
    • 2024.07.09日OpenAI将终止对中国等国家和地区API服务(0个评论)
    • 2024/6/9最新免费公益节点SSR/V2ray/Shadowrocket/Clash节点分享|科学上网|免费梯子(0个评论)
    • 国外服务器实现api.openai.com反代nginx配置(0个评论)
    • 2024/4/28最新免费公益节点SSR/V2ray/Shadowrocket/Clash节点分享|科学上网|免费梯子(0个评论)
    • 近期文章
    • 在go语言中使用api.geonames.org接口实现根据国际邮政编码获取地址信息功能(1个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf分页文件功能(0个评论)
    • gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案(0个评论)
    • 欧盟关于强迫劳动的规定的官方举报渠道及官方举报网站(0个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf文件功能(0个评论)
    • Laravel从Accel获得5700万美元A轮融资(0个评论)
    • 在go + gin中gorm实现指定搜索/区间搜索分页列表功能接口实例(0个评论)
    • 在go语言中实现IP/CIDR的ip和netmask互转及IP段形式互转及ip是否存在IP/CIDR(0个评论)
    • PHP 8.4 Alpha 1现已发布!(0个评论)
    • Laravel 11.15版本发布 - Eloquent Builder中添加的泛型(0个评论)
    • 近期评论
    • 122 在

      学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..
    • 123 在

      Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..
    • 原梓番博客 在

      在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
    • 博主 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..
    • 1111 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
    • 2016-10
    • 2016-11
    • 2017-07
    • 2017-08
    • 2017-09
    • 2018-01
    • 2018-07
    • 2018-08
    • 2018-09
    • 2018-12
    • 2019-01
    • 2019-02
    • 2019-03
    • 2019-04
    • 2019-05
    • 2019-06
    • 2019-07
    • 2019-08
    • 2019-09
    • 2019-10
    • 2019-11
    • 2019-12
    • 2020-01
    • 2020-03
    • 2020-04
    • 2020-05
    • 2020-06
    • 2020-07
    • 2020-08
    • 2020-09
    • 2020-10
    • 2020-11
    • 2021-04
    • 2021-05
    • 2021-06
    • 2021-07
    • 2021-08
    • 2021-09
    • 2021-10
    • 2021-12
    • 2022-01
    • 2022-02
    • 2022-03
    • 2022-04
    • 2022-05
    • 2022-06
    • 2022-07
    • 2022-08
    • 2022-09
    • 2022-10
    • 2022-11
    • 2022-12
    • 2023-01
    • 2023-02
    • 2023-03
    • 2023-04
    • 2023-05
    • 2023-06
    • 2023-07
    • 2023-08
    • 2023-09
    • 2023-10
    • 2023-12
    • 2024-02
    • 2024-04
    • 2024-05
    • 2024-06
    • 2025-02
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客