You are not logged in.

#1 2009-06-06 01:06:48

LeafStorm
Member
From: North Carolina
Registered: 2009-05-20
Posts: 51
Website

Admiral: Aria2 Download Manager for Midori

I recently started using Midori on this computer, and wrote my own download manager for it. It's really simple. It depends on aria2, zenity, and notify-send, which aren't hard to get at all. Its advantages over the wget.sh in the Midori FAQ is that (a) it uses aria2, which is apparently faster, (b) it lets you choose the download directory (which I like), and (c) it saves a log and notifies you in case things mess up.

#!/bin/sh
# Admiral
# Aria2 Download Manager
# USAGE: 'admiral $FILE'

test -z "$1" && exit 1

URL="$@"
FNAME=$(basename "$URL" | cut -d '?' -f 1)
echo $FNAME
LOGFILE="$HOME/.admiral-log-$$"
SAVE=$(zenity --title="Admiral: Save to:" --file-selection --filename="$FNAME" --save)

test $? -gt 0 && exit 3

asplode() {
    notify-send -u critical -t 5000 -i gtk-no "Admiral Asplode!" "Download of $URL failed
Check the logfile at $LOGFILE"
    exit 2
}

notify-send -u low -t 1500 -i gtk-save "Admiral" "Began downloading $URL"
touch $LOGFILE

aria2c -d "$(dirname $SAVE)" -o "$(basename $SAVE)" -l $LOGFILE "$URL" || asplode

notify-send -u normal -t 2000 -i gtk-ok "Admiral" "Download of $URL complete
Saved to $SAVE"

rm $LOGFILE

Thanks,
Matthew Frazier

Offline

Board footer

Powered by FluxBB