图片批量下载
需要安装curl 和 magick 工具
curl 一般电脑都是自带的,用于批量下载图片
magick工具,用于合并pdf文档,安装 :
首先,确保你已经安装了 ImageMagick,并且其 magick 命令在你的命令行可用。你可以从 ImageMagick 官方网站 下载并安装。
执行示例:
get.bat 33 诱骗态BB84量子密钥分配产品检测规范 https://hbba.sacinfo.org.cn/hbba_onlineRead_page/c70f8def4f4d93e816c0110a46135725063b5022cb598cb3a0cd1e83892dc8b8/
代码如下
@echo off
REM Check if required arguments are provided
if "%1" == "" goto :USAGE
if "%2" == "" goto :USAGE
if "%3" == "" goto :USAGE
set end=%1
set destination_folder=%2
set url=%3
REM Create the destination folder if it doesn't exist
mkdir "%destination_folder%" 2>nul
REM Download the files
for /l %%i in (0, 1, %end%) do (
curl "%url%/%%i.png" -o "%destination_folder%\temp.png"
setlocal enabledelayedexpansion
set "file_index=000%%i"
set "file_index=!file_index:~-3!"
ren "%destination_folder%\temp.png" "!file_index!.png"
endlocal
)
REM Convert images to PDF using ImageMagick
magick convert "%destination_folder%\*.png" "%destination_folder%.pdf"
goto :END
:USAGE
echo Usage: %0 ^<end^> ^<destination_folder^> ^<url^>
echo Example: %0 20 量子保密通信网络架构 "https://hbba.sacinfo.org.cn/hbba_onlineRead_page/405a2747ea434bc6a46bd3445194cfecc222d2159a8a2c2b907abfb259bc6d27/"
exit /b 1
:END