[Users] mangling URL?
Michael
codejodler at gmx.ch
Fri Oct 21 20:16:06 CEST 2016
Dave,
Not directly relate but just to mention it again: There is the possibility to insert the path to a script, as claws preference for browser. It does not fix when claws alerady break links, but offers you to choose different treatment depending on the URL. For example, you can download youtube links in the background or add login data or simply chose a different browser.
For example,
#!/bin/sh
url="$1"
#
# Trigger list
# Format: keyword {whitespace-separator} trigger-expression
triggerlist="this this.url.com
that that.domain.org
youtube www.youtube"
#
# Defaults
#browser="/usr/bin/iceweasel -new-tab"
browser="/usr/local/bin/palemoon/palemoon -new-tab"
dir_dl=~/Download/
log=$dir_dl/download.log
#
# Log
function log_url () { echo "`date +%y-%m-%d`: $url" >> $log; }
#
# Debug
echo "xxx claws browser: Got URL = "$url
#
# Trigger loop
#
match=`echo "$triggerlist" | while read keyword trigger; do
echo "$url" | grep -q "$trigger" && echo $keyword && break
done`
# echo "Found: "$match; exit
case $match in
this) # example: convert url
url=`echo "$url" | sed 's/\.new#new$/.0/1'`
;;
that) # example: background download
cd $dir_dl;
browser="/usr/bin/wget "
log_url
;;
youtube) # background download
dir_dl=$dir_dl/tube
cd $dir_dl;
browser="/usr/bin/youtube-dl -i --user-agent 'none' "
log_url
# browser="/usr/bin/get_flash_videos -q -y "
;;
esac
exec $browser $url
More information about the Users
mailing list