Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# SPDX-License-Identifier: MIT
## Copyright (C) 2013 Przemyslaw Pawelczyk <>
## This script is licensed under the terms of the MIT license.
# Simple script for downloading program stored on CNET:
# - AOMEI Partition Assistant Standard
# Tested on 2013-11-17.
set -e
get_page() { curl -LsS "$1"; }
get_href() { sed '/'"$1"'/!d;s,.*<a href=",,;s,".*,,;q'; }
get_rurl() { sed '/.*<META HTTP-EQUIV="Refresh" CONTENT="0; URL=/I!d;s,,,;s,".*,,;q'; }
strip_pq() { sed 's,.*/,,;s,?.*,,'; }
download() { curl -R "$1" -o "$2"; }
echo "Finding download link for AOMEI Partition Assistant Standard:"
echo "- $HOMEPAGE"
CNETPAGE="$(get_page "$HOMEPAGE" | get_href "Local Download Freeware")"
echo "- $CNETPAGE"
CNETLINK="$(get_page "$CNETPAGE" | get_href "Download Now")"
echo "- $CNETLINK"
CNETDURL="$(get_page "$CNETLINK" | get_rurl)"
echo "- $CNETDURL"
FILENAME="$(echo "$CNETDURL" | strip_pq)"
echo "Downloading $FILENAME:"
download "$CNETDURL" "$FILENAME"

This comment has been minimized.

Copy link
Owner Author

@przemoc przemoc commented Feb 6, 2018

commit 0b903631667f7e76e6f444544261757468471d59
Author: Przemyslaw Pawelczyk <>
Date:   2018-02-06 14:44:00 +0100 Add copyright notice and MIT license notice.

commit 979ba93c1c81a8c848a8548e9acbd8717dec23ae
Author: Przemyslaw Pawelczyk <>
Date:   2018-02-06 14:45:08 +0100

    Add SPDX License Identifier.

    The Software Package Data Exchange (SPDX) is a good initiative, it has
    matured over time and deserves accelerated adoption in open-source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment