#!/bin/bash
chan_thread=$1;
# Get domain of the site (8chan.moe, 8chan.se, etc)
chan_domain=$(echo $chan_thread | cut -d"/" -f1-3);
# Download the thread's html and embedded elements
wget --no-cookies --header 'Cookie: splash=1' --referer "$chan_domain" -N --convert-links --page-requisites $chan_thread;
# Make the thread locally accessible
local_thread=$(echo $chan_thread | cut -d"/" -f3-);
# Download the files uploaded to the thread
wget --no-cookies --header 'Cookie: splash=1' --referer "$chan_domain" -N --mirror $(grep -o -i -P 'href=".+/.media/[^"]+' $local_thread | sed 's/href="//g' | sort -u);
# Make the html point to the files saved with the previous command
sed -i 's/\(href="\).\+\(\/.media\/[^"]\+\)/\1..\/..\2/g' $local_thread;
Edit Report
Pub: 31 Oct 2022 22:14 UTC
Views: 81