Skip to content

Instantly share code, notes, and snippets.

@noskla
Created August 19, 2023 21:34
Show Gist options
  • Save noskla/1ce4b09e17e633494326e2a0a6f03e8b to your computer and use it in GitHub Desktop.
Save noskla/1ce4b09e17e633494326e2a0a6f03e8b to your computer and use it in GitHub Desktop.
archiwizacja ŚWK (ipla cdn)
#!/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