Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #GENERATED BY CHAT GEE PEE TEE RUN AT OWN RISK
- # Extract PDF links from the markdown file
- pdf_links=$(awk -F'|' '/http.*\.pdf/{print $4}' your-md-file.md)
- # Iterate over each PDF link and download the file
- while IFS= read -r link; do
- # Extract the actual URL from the Markdown link
- url=$(echo "$link" | grep -oP '(?<=\().*?(?=\))')
- # Extract the filename from the URL
- filename=$(echo "$url" | awk -F'/' '{print $NF}')
- # Download the PDF using wget
- wget "$url" -O "$filename"
- # Add a delay to avoid overwhelming the server (adjust as needed)
- sleep 1
- done <<< "$pdf_links"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement