@echo off
chcp 65001 > nul
setlocal
start Video
set bbdown_command=BBDown --config-file BBDown.config.win --dfn-priority "1080P 高清"
:loop
cls
echo Enter a URL or type 'exit' to quit:
set /p input=
if "%input%"=="exit" (
echo Exiting...
goto :eof
)
:: Check if input starts with 'ttp' and prepend 'h'
set input_prefix=%input:~0,3%
if "%input_prefix%"=="ttp" set input=h%input%
echo "%input%" | findstr /r "https\?://[^ ]*" > nul
if %errorlevel%==0 (
echo Running command with URL: "%input%"
echo command is %bbdown_command% "%input%"
%bbdown_command% "%input%"
echo Command has finished executing. Press any key to continue...
pause > nul
) else (
echo Invalid URL format. Please enter a valid URL.
)
goto loop
@echo off
chcp 65001 > nul
setlocal
start Video
set bbdown_command=BBDown --config-file BBDown.config.win --dfn-priority "1080P 高清"
:loop
cls
echo Enter a URL, type 'r' to run the latest TXT script, or type 'exit' to quit:
set /p input=
if /I "%input%"=="exit" (
echo Exiting...
goto :eof
)
if /I "%input%"=="r" (
echo Finding and processing the newest TXT file...
call :findAndProcessTxt
goto loop
)
:: Check if input starts with 'ttp' and prepend 'h'
set input_prefix=%input:~0,3%
if "%input_prefix%"=="ttp" set input=h%input%
echo "%input%" | findstr /r "https\?://[^ ]*" > nul
if %errorlevel%==0 (
echo Running command with URL: "%input%"
echo command is %bbdown_command% "%input%"
%bbdown_command% "%input%"
echo Command has finished executing. Press any key to continue...
pause > nul
) else (
echo Invalid URL format. Please enter a valid URL.
)
goto loop
:findAndProcessTxt
setlocal enabledelayedexpansion
REM 查找当前目录下最新的txt文件
set "newestFile="
for /F "delims=" %%i in ('dir /b /a-d /o-d /t:w *.txt') do (
set "newestFile=%%i"
goto breakLoop
)
:breakLoop
REM 检查是否找到了文件
if "!newestFile!"=="" (
echo No TXT files found.
goto endFindAndProcess
)
echo Found newest TXT file: !newestFile!
REM 使用找到的最新txt文件运行原始命令
For /F "delims=" %%a in (!newestFile!) Do (
%bbdown_command% "%%a"
)
:endFindAndProcess
endlocal
goto :eof