2 Commits

2 changed files with 2 additions and 66 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ CONTENT
--- ---
Recorded and edited on YYYY-MM-DD. Recorded and edited YYYY-MM-DD.
Recorded YYYY-MM-DD, edited YYYY-MM-DD.
[blog.hyperling.com/TBD](https://blog.hyperling.com/TBD) [blog.hyperling.com/TBD](https://blog.hyperling.com/TBD)
-65
View File
@@ -1108,70 +1108,6 @@
done done
sh -c "rm '{{ notify_log_file_wip }}'" sh -c "rm '{{ notify_log_file_wip }}'"
fi fi
function_download_website: |
function download-website {
website="$1"
if [[ -z "$website" ]]; then
echo "ERROR: Website not provided. $website"
return
fi
if [[ "$website" != "http"* ]]; then
website="http://$website"
fi
# https://simpleit.rocks/linux/how-to-download-a-website-with-wget-the-right-way/
# Does not simplify the links for offline usage.
# wget --wait=2 \
# --level=inf \
# --limit-rate=20K \
# --recursive \
# --page-requisites \
# --user-agent=Mozilla \
# --no-parent \
# --convert-links \
# --adjust-extension \
# --no-clobber \
# -e robots=off \
# $website &&
# https://www.digitalcitizen.life/how-to-download-entire-website-for-offline-viewing/
# This one is supposed to work too and is much smaller.
# wget --mirror \
# --convert-links \
# --adjust-extension \
# --page-requisites \
# --no-parent \
# $website &&
# Combine the two by using mirow and removing the rate limit.
wget --mirror \
--wait=2 \
--level=inf \
--recursive \
--page-requisites \
--user-agent=Mozilla \
--no-parent \
--convert-links \
--adjust-extension \
--no-clobber \
-e robots=off \
--timeout=15 \
--tries=0 \
--continue \
$website &&
{
echo "Success!"
} || {
echo "ERROR: Command reported a failure. (Error code '$?')"
echo "This may mean that the URL was not converted to local links."
echo "Please check the error and contents and try again if needed."
}
}
alias website-download="download-website"
alias curl-site="download-website"
alias pull-site="download-website"
alias curl-www="download-website"
alias pull-www="download-website"
alias www-pull="download-website"
- name: General | Account Management | Users | Files | Common Variable - name: General | Account Management | Users | Files | Common Variable
@@ -1255,7 +1191,6 @@
{{ alias_commit }} {{ alias_commit }}
{{ function_loop }} {{ function_loop }}
{{ process_notify_log }} {{ process_notify_log }}
{{ function_download_website }}
- name: General | Account Management | Users | Files | .bashrc - name: General | Account Management | Users | Files | .bashrc
blockinfile: blockinfile: