Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Prompt the user for the URL
- echo "Please enter the URL:"
- read url
- # Download HTML page using wget
- wget -O page.html "$url"
- # Replace href="/ with href="https://2ch.hk/ in the downloaded HTML file
- sed -i 's#href="/#href="https://2ch.hk/#g' page.html
- # Extract links to media files (including .webp and .webm) into a separate text file
- grep -Eo 'href="https?://[^"]+\.(jpg|jpeg|png|gif|webp|webm|mp4)"' page.html | cut -d'"' -f2 > media_links.txt
- # Function to download files with aria2
- download_with_aria2() {
- local profile_dir=$1
- local cookies=$2
- # Download files using aria2 with Firefox cookies
- aria2c -x 16 --continue=true --load-cookies="$cookies" -i media_links.txt
- }
- # Get the list of Firefox profiles
- profiles=$(find ~/.mozilla/firefox -maxdepth 1 -type d -name "*.*")
- # Prompt the user to select a Firefox profile and get the cookies file
- echo "Please select a Firefox profile:"
- select profile_dir in $profiles; do
- # Get Firefox cookies file for the selected profile
- cookies=$(find "$profile_dir" -name "cookies.sqlite")
- break
- done
- # Download files using aria2 and selected cookies
- download_with_aria2 "$profile_dir" "$cookies"
Add Comment
Please, Sign In to add comment