Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- Title CurlLink 1.0.0 Test Build 1432
- setlocal EnableDelayedExpansion
- where curl > NUL
- if %errorlevel% neq 0 (
- echo Curl not downloaded!
- curl -L -o curl.exe httpsNO LINKScurl.se/windows/dl-7.79.1/curl-7.79.1_2-win64-mingw.zip
- exit
- )
- :menu
- cls
- echo CurlLink 1.0
- echo Main menu:
- echo 1.Download
- echo 2.Information
- echo 3.Help
- set /p choice=Choose function
- if %choice% equ 1 (
- cls
- set /p url=Input URL-Adress:
- set counter=0
- for /f "tokens=*" %%i in ('curl -s %url%') do (
- set content=!content!%%i
- )
- for /f "tokens=2 delims=<> " %%i in ("%content%") do (
- if "%%i"=="href" (
- set /a counter+=1
- set link[!counter!]=%%j
- )
- )
- if %counter% EQU 0 (
- echo Files not finded
- pause
- exit
- )
- echo List of files:
- for /l %%i in (1, 1, %counter%) do (
- echo %%i. !link[%%i]!
- )
- set /p num=Choose number of file to download:
- set download_url=%url%!link[%num%]!
- curl -O %download_url%
- echo File downloaded.
- pause
- ) else if %choice% equ 2 (
- echo Version 1.0.0 Test Build 1432
- echo Made by Painkiller413
- echo Country of official production: Kazakhstan
- echo Thanks for download CurlLink!
- echo Maded on Batchfile
- echo This is a test version.
- ) else if %choice% equ 3 (
- echo Choose 1 if you want download a file
- echo Choose 2 if you want know information of this program
- ) else (
- echo incorrect choose.
- pause
- goto menu
- )
- pause
Advertisement
Advertisement