Created
August 19, 2023 21:34
-
-
Save noskla/1ce4b09e17e633494326e2a0a6f03e8b to your computer and use it in GitHub Desktop.
archiwizacja ŚWK (ipla cdn)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REGEX_URL="https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/=]*)" | |
PASTEBIN_DATA="$(curl https://pastebin.pl/view/raw/0ce85bfa 2>/dev/null)" | |
# Create the out directory if not exists | |
mkdir -p dl_output | |
while [[ ${PASTEBIN_DATA} =~ (${REGEX_URL}) ]]; do | |
# HTTPS enforce | |
url=$(echo "${BASH_REMATCH[1]}" | sed "s/http/https/") | |
# Download the file to the dl_output directory | |
wget -P./dl_output/ $url | |
echo -e "Done downloading $url\n" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment