Lucas Zhang

#1 批量下载mp3脚本

@echo off
chcp 65001 > nul
setlocal enabledelayedexpansion

echo Starting MP3 download...

for /l %%i in (1,1,48) do (
    if %%i lss 10 (
        set "num=0%%i"
    ) else (
        set "num=%%i"
    )
    
    set "url=https://www3.nhk.or.jp/nhkworld/lesson/zh/mp3/audio_lesson_!num!.mp3"
    set "filename=!num!.mp3"
    
    echo Downloading: !filename!
    curl -L --connect-timeout 10 --max-time 60 --retry 3 --retry-delay 1 -o "!filename!" "!url!"
    
    if !errorlevel! equ 0 (
        echo Success: !filename!
    ) else (
        echo Failed: !filename!
    )
)

echo All downloads completed!
pause

对于这种手动操作略显繁琐,编写代码又只用一次的鸡肋场景,让AI生成一个脚本就特别合适了。

This site in other languages:
, ,