<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://test.amule.szerverem.hu/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://test.amule.szerverem.hu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dreamer1</id>
		<title>AMule Project FAQ - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://test.amule.szerverem.hu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dreamer1"/>
		<link rel="alternate" type="text/html" href="http://test.amule.szerverem.hu/wiki/Special:Contributions/Dreamer1"/>
		<updated>2026-04-05T22:58:30Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.3</generator>

	<entry>
		<id>http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files</id>
		<title>Automatically search and download arbitrary number of files</title>
		<link rel="alternate" type="text/html" href="http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files"/>
				<updated>2007-03-29T08:57:07Z</updated>
		
		<summary type="html">&lt;p&gt;Dreamer1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This short document will describe the setup of the aMule and provide a shell script which will allow you to download all of the files you need with almost no effort needed.&lt;br /&gt;
&lt;br /&gt;
'''1. Have amule installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Obviously, you're gonna need that one.&lt;br /&gt;
&lt;br /&gt;
'''2. Have amule-utils installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:The shell script which does all the work for you uses the amulecmd utility to add ed2k links to aMule downloads.&lt;br /&gt;
&lt;br /&gt;
'''3. Set up aMule, your firewall, whatever...'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Find a way (if it's not working out of the box) to setup your aMule so that you can manually (the ordinary way) search for and download the files you need.&lt;br /&gt;
&lt;br /&gt;
'''4. Setup aMule Remote Controls'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open Preferences dialog&lt;br /&gt;
:b. In the left pane select &amp;quot;Remote Controls&amp;quot;&lt;br /&gt;
:c. Check the &amp;quot;Accept external connections&amp;quot; checkbox&lt;br /&gt;
:d. Choose (or leave unchanged) TCP port, and write down that number somewhere&lt;br /&gt;
:e. Set password (and remember it) for remote connection in the Password field&lt;br /&gt;
:f. OK&lt;br /&gt;
&lt;br /&gt;
:Now you should have everything you need to successfully use the script you are about to download.&lt;br /&gt;
&lt;br /&gt;
'''5. Download this shell script'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open the text editor of your preference&lt;br /&gt;
:b. Copy&amp;amp;paste the script bellow&lt;br /&gt;
:c. Save the file as 'amuleget.sh' to your local directory or to /usr/bin to make it available to all users &lt;br /&gt;
:d. Set appropriate read/write permissions (when needed) and allow execution&lt;br /&gt;
::''Note:'' In most cases it will be enough to do: ''chmod +x amuleget.sh''&lt;br /&gt;
:e. Here comes the script:&lt;br /&gt;
::&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 if [ -z &amp;quot;$1&amp;quot; ] || [ &amp;quot;$1&amp;quot; = &amp;quot;--help&amp;quot; ]; then&lt;br /&gt;
        if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
                echo &amp;quot;Not enough parameters!&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;Usage: $0 [--help] [-p port] [-P password] file&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   --help\t\tShow this help text&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -p port\t\tTCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -P password\t\tpassword for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -v level\t\tverbosity level:&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   0 - (default) suppress wget and amulecmd output&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   1 - suppress wget output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   2 - suppress amulecmd output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   3 - show both wget and amulecmd outputs&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   file\t\t\tfile containing list of items to be downloaded&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;\nTip 1&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;To find out the values for the -p and -P parameters, in your aMule graphical client open Preferences -&amp;gt; Remote Controls and in External Connection Parameters part set (if unset or unknown) the password and write down the TCP port.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 2&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;If the scripts hangs at \&amp;quot;Creating client...\&amp;quot; the most probable causes are unchecked 'Accept external connections' checkbox, incorrect password, incorrect TCP port or aMule instance not running&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 3&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;Read Wiki at http://www.amule.org/wiki/index.php/Automatically_search_and_download_arbitrary_number_of_files&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 eval fileName=\$$#&lt;br /&gt;
 if [ ! -f &amp;quot;$fileName&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;File \&amp;quot;$fileName\&amp;quot; doesn't exist&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
 echo -e &amp;quot;!!!!!!Before continuing make sure you have a running instance of aMule!!!!!!&amp;quot;&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #parse arguments&lt;br /&gt;
 while getopts &amp;quot;:p:P:v:&amp;quot; options; do&lt;br /&gt;
        case $options in&lt;br /&gt;
                p ) aMulePort=$OPTARG;;&lt;br /&gt;
                P ) aMulePass=$OPTARG;;&lt;br /&gt;
                v ) verbose=$OPTARG;;&lt;br /&gt;
        esac&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePort&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nWhat is the TCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        read aMulePort&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePass&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nPlease, provide password for aMule remote connection&amp;quot;&lt;br /&gt;
        read -s aMulePass&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Initiating aMule connection to server&amp;quot;&lt;br /&gt;
 amulecmd -p $aMulePort -P $aMulePass -c connect&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Searching for ed2k links...&amp;quot;&lt;br /&gt;
 #file descriptor&lt;br /&gt;
 exec 5&amp;lt; $fileName&lt;br /&gt;
 searchStringLeft=&amp;quot;http://www.emugle.com/search.php?q=&amp;quot;&lt;br /&gt;
 searchStringRight=&amp;quot;&amp;amp;t=All+categories&amp;amp;Submit=Search&amp;amp;f=0&amp;quot;&lt;br /&gt;
 tmpFile=`mktemp /tmp/aMuleTmp.XXXXXX`&lt;br /&gt;
&lt;br /&gt;
 #process each line&lt;br /&gt;
 until [ $done ]; do&lt;br /&gt;
        read &amp;lt;&amp;amp;5 searchItem&lt;br /&gt;
        if [ $? != 0 ]; then&lt;br /&gt;
                #end of file reached&lt;br /&gt;
                done=1&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        if [ &amp;quot;$searchItem&amp;quot; = &amp;quot;&amp;quot; ]; then&lt;br /&gt;
                #empty line&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;    SEARCHING:\t$searchItem&amp;quot;&lt;br /&gt;
        searchItem=`echo $searchItem | sed -e 's/\ /+/g'`&lt;br /&gt;
        searchString=&amp;quot;$searchStringLeft$searchItem$searchStringRight&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;2&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -O $tmpFile&lt;br /&gt;
        else&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -o /dev/null -O $tmpFile&lt;br /&gt;
        fi&lt;br /&gt;
        firstResult=`grep -m 1 ed2k $tmpFile`&lt;br /&gt;
        #remove HTML tags and spaces&lt;br /&gt;
        ed2kLink=`echo $firstResult | sed -e 's/&amp;lt;[^&amp;gt;]*&amp;gt;//g'| sed -e 's/\ //g'`&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;    ADDING:\t$searchItem to aMule. Ed2k link:\n  $ed2kLink\n&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;1&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot; &amp;gt; /dev/null&lt;br /&gt;
        fi&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
rm -f $tmpFile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
'''6. Create the file with a list of the search items'''&lt;br /&gt;
:You should put each search item on it's own line and the keywords should be separated by spaces, for instance:&lt;br /&gt;
::keywords for 1st search&lt;br /&gt;
::keywords for 2nd search&lt;br /&gt;
::keywords for 3rd search&lt;br /&gt;
::...&lt;br /&gt;
'''7. And finally...'''&lt;br /&gt;
:a. run aMule&lt;br /&gt;
:b. ''amuleget.sh --help'' to check the usage&lt;br /&gt;
::Examples:&lt;br /&gt;
:::1. script in a current directory, file with search items: /tmp/listFile&lt;br /&gt;
::::''./amuleget.sh -p 5020 -P myWeakPassword /tmp/listFile''&amp;lt;br&amp;gt;&lt;br /&gt;
:::2. script in /usr/bin, file with search items in current directory, enter port and password through dialog&lt;br /&gt;
::::''amuleget.sh listFile''&lt;br /&gt;
&lt;br /&gt;
'''8. Reporting the problems'''&lt;br /&gt;
:You can always ask for the help on the http://forum.amule.org.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:If I've made a typo or any other error which makes this wiki unusable for the average user, you can correct it yourself or try to post a question or report a problem at the original thread at the aMule forum: http://forum.amule.org/index.php?topic=12413.0&lt;br /&gt;
:I will check it occasionally.&lt;br /&gt;
&lt;br /&gt;
'''9. Enjoy the downloading...'''&lt;/div&gt;</summary>
		<author><name>Dreamer1</name></author>	</entry>

	<entry>
		<id>http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files</id>
		<title>Automatically search and download arbitrary number of files</title>
		<link rel="alternate" type="text/html" href="http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files"/>
				<updated>2007-03-29T08:55:40Z</updated>
		
		<summary type="html">&lt;p&gt;Dreamer1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This short document will describe the setup of the aMule and provide a shell script which will allow you to download all of the files you need with almost no effort needed.&lt;br /&gt;
&lt;br /&gt;
'''1. Have amule installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Obviously, you're gonna need that one.&lt;br /&gt;
&lt;br /&gt;
'''2. Have amule-utils installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:The shell script which does all the work for you uses the amulecmd utility to add ed2k links to aMule downloads.&lt;br /&gt;
&lt;br /&gt;
'''3. Set up aMule, your firewall, whatever...'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Find a way (if it's not working out of the box) to setup your aMule so that you can manually (the ordinary way) search for and download the files you need.&lt;br /&gt;
&lt;br /&gt;
'''4. Setup aMule Remote Controls'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open Preferences dialog&lt;br /&gt;
:b. In the left pane select &amp;quot;Remote Controls&amp;quot;&lt;br /&gt;
:c. Check the &amp;quot;Accept external connections&amp;quot; checkbox&lt;br /&gt;
:d. Choose (or leave unchanged) TCP port, and write down that number somewhere&lt;br /&gt;
:e. Set password (and remember it) for remote connection in the Password field&lt;br /&gt;
:f. OK&lt;br /&gt;
&lt;br /&gt;
:Now you should have everything you need to successfully use the script you are about to download.&lt;br /&gt;
&lt;br /&gt;
'''5. Download this shell script'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open the text editor of your preference&lt;br /&gt;
:b. Copy&amp;amp;paste the script bellow&lt;br /&gt;
:c. Save the file as 'amuleget.sh' to your local directory or to /usr/bin to make it available to all users &lt;br /&gt;
:d. Set appropriate read/write permissions (when needed) and allow execution&lt;br /&gt;
::''Note:'' In most cases it will be enough to do: ''chmod +x amuleget.sh''&lt;br /&gt;
:e. Here comes the script:&lt;br /&gt;
::&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 if [ -z &amp;quot;$1&amp;quot; ] || [ &amp;quot;$1&amp;quot; = &amp;quot;--help&amp;quot; ]; then&lt;br /&gt;
        if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
                echo &amp;quot;Not enough parameters!&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;Usage: $0 [--help] [-p port] [-P password] file&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   --help\t\tShow this help text&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -p port\t\tTCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -P password\t\tpassword for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -v level\t\tverbosity level:&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   0 - (default) suppress wget and amulecmd output&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   1 - suppress wget output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   2 - suppress amulecmd output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   3 - show both wget and amulecmd outputs&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   file\t\t\tfile containing list of items to be downloaded&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;\nTip 1&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;To find out the values for the -p and -P parameters, in your aMule graphical client open Preferences -&amp;gt; Remote Controls and in External Connection Parameters part set (if unset or unknown) the password and write down the TCP port.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 2&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;If the scripts hangs at \&amp;quot;Creating client...\&amp;quot; the most probable causes are unchecked 'Accept external connections' checkbox, incorrect password, incorrect TCP port or aMule instance not running&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 3&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;Read Wiki at http://www.amule.org/wiki/index.php/Automatically_search_and_download_arbitrary_number_of_files&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 eval fileName=\$$#&lt;br /&gt;
 if [ ! -f &amp;quot;$fileName&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;File \&amp;quot;$fileName\&amp;quot; doesn't exist&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
 echo -e &amp;quot;!!!!!!Before continuing make sure that you have a running instance of aMule!!!!!!&amp;quot;&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #parse arguments&lt;br /&gt;
 while getopts &amp;quot;:p:P:v:&amp;quot; options; do&lt;br /&gt;
        case $options in&lt;br /&gt;
                p ) aMulePort=$OPTARG;;&lt;br /&gt;
                P ) aMulePass=$OPTARG;;&lt;br /&gt;
                v ) verbose=$OPTARG;;&lt;br /&gt;
        esac&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePort&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nWhat is the TCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        read aMulePort&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePass&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nPlease, provide password for aMule remote connection&amp;quot;&lt;br /&gt;
        read -s aMulePass&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Initiating aMule connection to server&amp;quot;&lt;br /&gt;
 amulecmd -p $aMulePort -P $aMulePass -c connect&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Searching for ed2k links...&amp;quot;&lt;br /&gt;
 #file descriptor&lt;br /&gt;
 exec 5&amp;lt; $fileName&lt;br /&gt;
 searchStringLeft=&amp;quot;http://www.emugle.com/search.php?q=&amp;quot;&lt;br /&gt;
 searchStringRight=&amp;quot;&amp;amp;t=All+categories&amp;amp;Submit=Search&amp;amp;f=0&amp;quot;&lt;br /&gt;
 tmpFile=`mktemp /tmp/aMuleTmp.XXXXXX`&lt;br /&gt;
&lt;br /&gt;
 #process each line&lt;br /&gt;
 until [ $done ]; do&lt;br /&gt;
        read &amp;lt;&amp;amp;5 searchItem&lt;br /&gt;
        if [ $? != 0 ]; then&lt;br /&gt;
                #end of file reached&lt;br /&gt;
                done=1&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        if [ &amp;quot;$searchItem&amp;quot; = &amp;quot;&amp;quot; ]; then&lt;br /&gt;
                #empty line&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;    SEARCHING:\t$searchItem&amp;quot;&lt;br /&gt;
        searchItem=`echo $searchItem | sed -e 's/\ /+/g'`&lt;br /&gt;
        searchString=&amp;quot;$searchStringLeft$searchItem$searchStringRight&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;2&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -O $tmpFile&lt;br /&gt;
        else&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -o /dev/null -O $tmpFile&lt;br /&gt;
        fi&lt;br /&gt;
        firstResult=`grep -m 1 ed2k $tmpFile`&lt;br /&gt;
        #remove HTML tags and spaces&lt;br /&gt;
        ed2kLink=`echo $firstResult | sed -e 's/&amp;lt;[^&amp;gt;]*&amp;gt;//g'| sed -e 's/\ //g'`&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;    ADDING:\t$searchItem to aMule. Ed2k link:\n  $ed2kLink\n&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;1&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot; &amp;gt; /dev/null&lt;br /&gt;
        fi&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
rm -f $tmpFile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
'''6. Create the file with a list of the search items'''&lt;br /&gt;
:You should put each search item on it's own line and the keywords should be separated by spaces, for instance:&lt;br /&gt;
::keywords for 1st search&lt;br /&gt;
::keywords for 2nd search&lt;br /&gt;
::keywords for 3rd search&lt;br /&gt;
::...&lt;br /&gt;
'''7. And finally...'''&lt;br /&gt;
:a. run aMule&lt;br /&gt;
:b. ''amuleget.sh --help'' to check the usage&lt;br /&gt;
::Examples:&lt;br /&gt;
:::1. script in a current directory, file with search items: /tmp/listFile&lt;br /&gt;
::::''./amuleget.sh -p 5020 -P myWeakPassword /tmp/listFile''&amp;lt;br&amp;gt;&lt;br /&gt;
:::2. script in /usr/bin, file with search items in current directory, enter port and password through dialog&lt;br /&gt;
::::''amuleget.sh listFile''&lt;br /&gt;
&lt;br /&gt;
'''8. Reporting the problems'''&lt;br /&gt;
:You can always ask for the help on the http://forum.amule.org.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:If I've made a typo or any other error which makes this wiki unusable for the average user, you can correct it yourself or try to post a question or report a problem at the original thread at the aMule forum: http://forum.amule.org/index.php?topic=12413.0&lt;br /&gt;
:I will check it occasionally.&lt;br /&gt;
&lt;br /&gt;
'''9. Enjoy the downloading...'''&lt;/div&gt;</summary>
		<author><name>Dreamer1</name></author>	</entry>

	<entry>
		<id>http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files</id>
		<title>Automatically search and download arbitrary number of files</title>
		<link rel="alternate" type="text/html" href="http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files"/>
				<updated>2007-03-29T08:55:09Z</updated>
		
		<summary type="html">&lt;p&gt;Dreamer1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This short document will describe the setup of the aMule and provide a shell script which will allow you to download all of the files you need without almost any effort needed.&lt;br /&gt;
&lt;br /&gt;
'''1. Have amule installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Obviously, you're gonna need that one.&lt;br /&gt;
&lt;br /&gt;
'''2. Have amule-utils installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:The shell script which does all the work for you uses the amulecmd utility to add ed2k links to aMule downloads.&lt;br /&gt;
&lt;br /&gt;
'''3. Set up aMule, your firewall, whatever...'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Find a way (if it's not working out of the box) to setup your aMule so that you can manually (the ordinary way) search for and download the files you need.&lt;br /&gt;
&lt;br /&gt;
'''4. Setup aMule Remote Controls'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open Preferences dialog&lt;br /&gt;
:b. In the left pane select &amp;quot;Remote Controls&amp;quot;&lt;br /&gt;
:c. Check the &amp;quot;Accept external connections&amp;quot; checkbox&lt;br /&gt;
:d. Choose (or leave unchanged) TCP port, and write down that number somewhere&lt;br /&gt;
:e. Set password (and remember it) for remote connection in the Password field&lt;br /&gt;
:f. OK&lt;br /&gt;
&lt;br /&gt;
:Now you should have everything you need to successfully use the script you are about to download.&lt;br /&gt;
&lt;br /&gt;
'''5. Download this shell script'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open the text editor of your preference&lt;br /&gt;
:b. Copy&amp;amp;paste the script bellow&lt;br /&gt;
:c. Save the file as 'amuleget.sh' to your local directory or to /usr/bin to make it available to all users &lt;br /&gt;
:d. Set appropriate read/write permissions (when needed) and allow execution&lt;br /&gt;
::''Note:'' In most cases it will be enough to do: ''chmod +x amuleget.sh''&lt;br /&gt;
:e. Here comes the script:&lt;br /&gt;
::&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 if [ -z &amp;quot;$1&amp;quot; ] || [ &amp;quot;$1&amp;quot; = &amp;quot;--help&amp;quot; ]; then&lt;br /&gt;
        if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
                echo &amp;quot;Not enough parameters!&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;Usage: $0 [--help] [-p port] [-P password] file&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   --help\t\tShow this help text&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -p port\t\tTCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -P password\t\tpassword for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -v level\t\tverbosity level:&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   0 - (default) suppress wget and amulecmd output&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   1 - suppress wget output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   2 - suppress amulecmd output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   3 - show both wget and amulecmd outputs&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   file\t\t\tfile containing list of items to be downloaded&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;\nTip 1&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;To find out the values for the -p and -P parameters, in your aMule graphical client open Preferences -&amp;gt; Remote Controls and in External Connection Parameters part set (if unset or unknown) the password and write down the TCP port.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 2&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;If the scripts hangs at \&amp;quot;Creating client...\&amp;quot; the most probable causes are unchecked 'Accept external connections' checkbox, incorrect password, incorrect TCP port or aMule instance not running&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 3&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;Read Wiki at http://www.amule.org/wiki/index.php/Automatically_search_and_download_arbitrary_number_of_files&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 eval fileName=\$$#&lt;br /&gt;
 if [ ! -f &amp;quot;$fileName&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;File \&amp;quot;$fileName\&amp;quot; doesn't exist&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
 echo -e &amp;quot;!!!!!!Before continuing make sure that you have a running instance of aMule!!!!!!&amp;quot;&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #parse arguments&lt;br /&gt;
 while getopts &amp;quot;:p:P:v:&amp;quot; options; do&lt;br /&gt;
        case $options in&lt;br /&gt;
                p ) aMulePort=$OPTARG;;&lt;br /&gt;
                P ) aMulePass=$OPTARG;;&lt;br /&gt;
                v ) verbose=$OPTARG;;&lt;br /&gt;
        esac&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePort&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nWhat is the TCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        read aMulePort&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePass&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nPlease, provide password for aMule remote connection&amp;quot;&lt;br /&gt;
        read -s aMulePass&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Initiating aMule connection to server&amp;quot;&lt;br /&gt;
 amulecmd -p $aMulePort -P $aMulePass -c connect&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Searching for ed2k links...&amp;quot;&lt;br /&gt;
 #file descriptor&lt;br /&gt;
 exec 5&amp;lt; $fileName&lt;br /&gt;
 searchStringLeft=&amp;quot;http://www.emugle.com/search.php?q=&amp;quot;&lt;br /&gt;
 searchStringRight=&amp;quot;&amp;amp;t=All+categories&amp;amp;Submit=Search&amp;amp;f=0&amp;quot;&lt;br /&gt;
 tmpFile=`mktemp /tmp/aMuleTmp.XXXXXX`&lt;br /&gt;
&lt;br /&gt;
 #process each line&lt;br /&gt;
 until [ $done ]; do&lt;br /&gt;
        read &amp;lt;&amp;amp;5 searchItem&lt;br /&gt;
        if [ $? != 0 ]; then&lt;br /&gt;
                #end of file reached&lt;br /&gt;
                done=1&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        if [ &amp;quot;$searchItem&amp;quot; = &amp;quot;&amp;quot; ]; then&lt;br /&gt;
                #empty line&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;    SEARCHING:\t$searchItem&amp;quot;&lt;br /&gt;
        searchItem=`echo $searchItem | sed -e 's/\ /+/g'`&lt;br /&gt;
        searchString=&amp;quot;$searchStringLeft$searchItem$searchStringRight&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;2&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -O $tmpFile&lt;br /&gt;
        else&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -o /dev/null -O $tmpFile&lt;br /&gt;
        fi&lt;br /&gt;
        firstResult=`grep -m 1 ed2k $tmpFile`&lt;br /&gt;
        #remove HTML tags and spaces&lt;br /&gt;
        ed2kLink=`echo $firstResult | sed -e 's/&amp;lt;[^&amp;gt;]*&amp;gt;//g'| sed -e 's/\ //g'`&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;    ADDING:\t$searchItem to aMule. Ed2k link:\n  $ed2kLink\n&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;1&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot; &amp;gt; /dev/null&lt;br /&gt;
        fi&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
rm -f $tmpFile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
'''6. Create the file with a list of the search items'''&lt;br /&gt;
:You should put each search item on it's own line and the keywords should be separated by spaces, for instance:&lt;br /&gt;
::keywords for 1st search&lt;br /&gt;
::keywords for 2nd search&lt;br /&gt;
::keywords for 3rd search&lt;br /&gt;
::...&lt;br /&gt;
'''7. And finally...'''&lt;br /&gt;
:a. run aMule&lt;br /&gt;
:b. ''amuleget.sh --help'' to check the usage&lt;br /&gt;
::Examples:&lt;br /&gt;
:::1. script in a current directory, file with search items: /tmp/listFile&lt;br /&gt;
::::''./amuleget.sh -p 5020 -P myWeakPassword /tmp/listFile''&amp;lt;br&amp;gt;&lt;br /&gt;
:::2. script in /usr/bin, file with search items in current directory, enter port and password through dialog&lt;br /&gt;
::::''amuleget.sh listFile''&lt;br /&gt;
&lt;br /&gt;
'''8. Reporting the problems'''&lt;br /&gt;
:You can always ask for the help on the http://forum.amule.org.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:If I've made a typo or any other error which makes this wiki unusable for the average user, you can correct it yourself or try to post a question or report a problem at the original thread at the aMule forum: http://forum.amule.org/index.php?topic=12413.0&lt;br /&gt;
:I will check it occasionally.&lt;br /&gt;
&lt;br /&gt;
'''9. Enjoy the downloading...'''&lt;/div&gt;</summary>
		<author><name>Dreamer1</name></author>	</entry>

	<entry>
		<id>http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files</id>
		<title>Automatically search and download arbitrary number of files</title>
		<link rel="alternate" type="text/html" href="http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files"/>
				<updated>2007-03-29T08:53:10Z</updated>
		
		<summary type="html">&lt;p&gt;Dreamer1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''WORK IN PROGRESS, CHECK BACK A BIT LATER'''&lt;br /&gt;
&lt;br /&gt;
This short document will describe the setup of the aMule and provide a shell script which will allow you to download all of the files you need without almost any effort needed.&lt;br /&gt;
&lt;br /&gt;
'''1. Have amule installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Obviously, you're gonna need that one.&lt;br /&gt;
&lt;br /&gt;
'''2. Have amule-utils installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:The shell script which does all the work for you uses the amulecmd utility to add ed2k links to aMule downloads.&lt;br /&gt;
&lt;br /&gt;
'''3. Set up aMule, your firewall, whatever...'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Find a way (if it's not working out of the box) to setup your aMule so that you can manually (the ordinary way) search for and download the files you need.&lt;br /&gt;
&lt;br /&gt;
'''4. Setup aMule Remote Controls'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open Preferences dialog&lt;br /&gt;
:b. In the left pane select &amp;quot;Remote Controls&amp;quot;&lt;br /&gt;
:c. Check the &amp;quot;Accept external connections&amp;quot; checkbox&lt;br /&gt;
:d. Choose (or leave unchanged) TCP port, and write down that number somewhere&lt;br /&gt;
:e. Set password (and remember it) for remote connection in the Password field&lt;br /&gt;
:f. OK&lt;br /&gt;
&lt;br /&gt;
:Now you should have everything you need to successfully use the script you are about to download.&lt;br /&gt;
&lt;br /&gt;
'''5. Download this shell script'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open the text editor of your preference&lt;br /&gt;
:b. Copy&amp;amp;paste the script bellow&lt;br /&gt;
:c. Save the file as 'amuleget.sh' to your local directory or to /usr/bin to make it available to all users &lt;br /&gt;
:d. Set appropriate read/write permissions (when needed) and allow execution&lt;br /&gt;
::''Note:'' In most cases it will be enough to do: ''chmod +x amuleget.sh''&lt;br /&gt;
:e. Here comes the script:&lt;br /&gt;
::&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 if [ -z &amp;quot;$1&amp;quot; ] || [ &amp;quot;$1&amp;quot; = &amp;quot;--help&amp;quot; ]; then&lt;br /&gt;
        if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
                echo &amp;quot;Not enough parameters!&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;Usage: $0 [--help] [-p port] [-P password] file&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   --help\t\tShow this help text&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -p port\t\tTCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -P password\t\tpassword for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -v level\t\tverbosity level:&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   0 - (default) suppress wget and amulecmd output&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   1 - suppress wget output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   2 - suppress amulecmd output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   3 - show both wget and amulecmd outputs&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   file\t\t\tfile containing list of items to be downloaded&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;\nTip 1&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;To find out the values for the -p and -P parameters, in your aMule graphical client open Preferences -&amp;gt; Remote Controls and in External Connection Parameters part set (if unset or unknown) the password and write down the TCP port.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 2&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;If the scripts hangs at \&amp;quot;Creating client...\&amp;quot; the most probable causes are unchecked 'Accept external connections' checkbox, incorrect password, incorrect TCP port or aMule instance not running&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 3&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;Read Wiki at http://www.amule.org/wiki/index.php/Automatically_search_and_download_arbitrary_number_of_files&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 eval fileName=\$$#&lt;br /&gt;
 if [ ! -f &amp;quot;$fileName&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;File \&amp;quot;$fileName\&amp;quot; doesn't exist&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
 echo -e &amp;quot;!!!!!!Before continuing make sure that you have a running instance of aMule!!!!!!&amp;quot;&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #parse arguments&lt;br /&gt;
 while getopts &amp;quot;:p:P:v:&amp;quot; options; do&lt;br /&gt;
        case $options in&lt;br /&gt;
                p ) aMulePort=$OPTARG;;&lt;br /&gt;
                P ) aMulePass=$OPTARG;;&lt;br /&gt;
                v ) verbose=$OPTARG;;&lt;br /&gt;
        esac&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePort&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nWhat is the TCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        read aMulePort&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePass&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nPlease, provide password for aMule remote connection&amp;quot;&lt;br /&gt;
        read -s aMulePass&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Initiating aMule connection to server&amp;quot;&lt;br /&gt;
 amulecmd -p $aMulePort -P $aMulePass -c connect&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Searching for ed2k links...&amp;quot;&lt;br /&gt;
 #file descriptor&lt;br /&gt;
 exec 5&amp;lt; $fileName&lt;br /&gt;
 searchStringLeft=&amp;quot;http://www.emugle.com/search.php?q=&amp;quot;&lt;br /&gt;
 searchStringRight=&amp;quot;&amp;amp;t=All+categories&amp;amp;Submit=Search&amp;amp;f=0&amp;quot;&lt;br /&gt;
 tmpFile=`mktemp /tmp/aMuleTmp.XXXXXX`&lt;br /&gt;
&lt;br /&gt;
 #process each line&lt;br /&gt;
 until [ $done ]; do&lt;br /&gt;
        read &amp;lt;&amp;amp;5 searchItem&lt;br /&gt;
        if [ $? != 0 ]; then&lt;br /&gt;
                #end of file reached&lt;br /&gt;
                done=1&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        if [ &amp;quot;$searchItem&amp;quot; = &amp;quot;&amp;quot; ]; then&lt;br /&gt;
                #empty line&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;    SEARCHING:\t$searchItem&amp;quot;&lt;br /&gt;
        searchItem=`echo $searchItem | sed -e 's/\ /+/g'`&lt;br /&gt;
        searchString=&amp;quot;$searchStringLeft$searchItem$searchStringRight&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;2&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -O $tmpFile&lt;br /&gt;
        else&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -o /dev/null -O $tmpFile&lt;br /&gt;
        fi&lt;br /&gt;
        firstResult=`grep -m 1 ed2k $tmpFile`&lt;br /&gt;
        #remove HTML tags and spaces&lt;br /&gt;
        ed2kLink=`echo $firstResult | sed -e 's/&amp;lt;[^&amp;gt;]*&amp;gt;//g'| sed -e 's/\ //g'`&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;    ADDING:\t$searchItem to aMule. Ed2k link:\n  $ed2kLink\n&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;1&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot; &amp;gt; /dev/null&lt;br /&gt;
        fi&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
rm -f $tmpFile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
'''6. Create the file with a list of the search items'''&lt;br /&gt;
:You should put each search item on it's own line and the keywords should be separated by spaces, for instance:&lt;br /&gt;
::keywords for 1st search&lt;br /&gt;
::keywords for 2nd search&lt;br /&gt;
::keywords for 3rd search&lt;br /&gt;
::...&lt;br /&gt;
'''7. And finally...'''&lt;br /&gt;
:a. run aMule&lt;br /&gt;
:b. ''amuleget.sh --help'' to check the usage&lt;br /&gt;
::Examples:&lt;br /&gt;
:::1. script in a current directory, file with search items: /tmp/listFile&lt;br /&gt;
::::''./amuleget.sh -p 5020 -P myWeakPassword /tmp/listFile''&amp;lt;br&amp;gt;&lt;br /&gt;
:::2. script in /usr/bin, file with search items in current directory, enter port and password through dialog&lt;br /&gt;
::::''amuleget.sh listFile''&lt;br /&gt;
&lt;br /&gt;
'''8. Reporting the problems'''&lt;br /&gt;
:You can always ask for the help on the http://forum.amule.org.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:If I've made a typo or any other error which makes this wiki unusable for the average user, you can correct it yourself or try to post a question or report a problem at the original thread at the aMule forum: http://forum.amule.org/index.php?topic=12413.0&lt;br /&gt;
:I will check it occasionally.&lt;br /&gt;
&lt;br /&gt;
'''9. Enjoy the downloading...'''&lt;/div&gt;</summary>
		<author><name>Dreamer1</name></author>	</entry>

	<entry>
		<id>http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files</id>
		<title>Automatically search and download arbitrary number of files</title>
		<link rel="alternate" type="text/html" href="http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files"/>
				<updated>2007-03-29T08:28:24Z</updated>
		
		<summary type="html">&lt;p&gt;Dreamer1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''WORK IN PROGRESS, CHECK BACK A BIT LATER'''&lt;br /&gt;
&lt;br /&gt;
This short document will describe the setup of the aMule and provide a shell script which will allow you to download all of the files you need without almost any effort needed.&lt;br /&gt;
&lt;br /&gt;
'''1. Have amule installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Obviously, you're gonna need that one.&lt;br /&gt;
&lt;br /&gt;
'''2. Have amule-utils installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:The shell script which does all the work for you uses the amulecmd utility to add ed2k links to aMule downloads.&lt;br /&gt;
&lt;br /&gt;
'''3. Set up aMule, your firewall, whatever...'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Find a way (if it's not working out of the box) to setup your aMule so that you can manually (the ordinary way) search for and download the files you need.&lt;br /&gt;
&lt;br /&gt;
'''4. Setup aMule Remote Controls'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open Preferences dialog&lt;br /&gt;
:b. In the left pane select &amp;quot;Remote Controls&amp;quot;&lt;br /&gt;
:c. Check the &amp;quot;Accept external connections&amp;quot; checkbox&lt;br /&gt;
:d. Choose (or leave unchanged) TCP port, and write down that number somewhere&lt;br /&gt;
:e. Set password (and remember it) for remote connection in the Password field&lt;br /&gt;
:f. OK&lt;br /&gt;
&lt;br /&gt;
:Now you should have everything you need to successfully use the script you are about to download.&lt;br /&gt;
&lt;br /&gt;
'''5. Download this shell script'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open the text editor of your preference&lt;br /&gt;
:b. Copy&amp;amp;paste the script bellow&lt;br /&gt;
:c. Save the file as 'amuleget.sh' to your local directory or to /usr/bin to make it available to all users &lt;br /&gt;
:d. Set appropriate read/write permissions (when needed) and allow execution&lt;br /&gt;
::'Note:' In most cases it will be enough to do: ''chmod +x amuleget.sh''&lt;br /&gt;
:e. Here comes the script:&lt;br /&gt;
::&amp;lt;code&amp;gt;&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 if [ -z &amp;quot;$1&amp;quot; ] || [ &amp;quot;$1&amp;quot; = &amp;quot;--help&amp;quot; ]; then&lt;br /&gt;
        if [ -z &amp;quot;$1&amp;quot; ]; then&lt;br /&gt;
                echo &amp;quot;Not enough parameters!&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;Usage: $0 [--help] [-p port] [-P password] file&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   --help\t\tShow this help text&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -p port\t\tTCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -P password\t\tpassword for aMule remote connection&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   -v level\t\tverbosity level:&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   0 - (default) suppress wget and amulecmd output&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   1 - suppress wget output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   2 - suppress amulecmd output only&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;           \t\t   3 - show both wget and amulecmd outputs&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;   file\t\t\tfile containing list of items to be downloaded&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;\nTip 1&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;To find out the values for the -p and -P parameters, in your aMule graphical client open Preferences -&amp;gt; Remote Controls and in External Connection Parameters part set (if unset or unknown) the password and write down the TCP port.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 2&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;If the scripts hangs at \&amp;quot;Creating client...\&amp;quot; the most probable causes are unchecked 'Accept external connections' checkbox, incorrect password, incorrect TCP port or aMule instance not running&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;Tip 3&amp;quot;&lt;br /&gt;
        echo -e &amp;quot;Read Wiki at http://www.amule.org/wiki/index.php/Automatically_search_and_download_arbitrary_number_of_files&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 eval fileName=\$$#&lt;br /&gt;
 if [ ! -f &amp;quot;$fileName&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;File \&amp;quot;$fileName\&amp;quot; doesn't exist&amp;quot;&lt;br /&gt;
        exit&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
 echo -e &amp;quot;!!!!!!Before continuing make sure that you have a running instance of aMule!!!!!!&amp;quot;&lt;br /&gt;
 echo    &amp;quot;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #parse arguments&lt;br /&gt;
 while getopts &amp;quot;:p:P:v:&amp;quot; options; do&lt;br /&gt;
        case $options in&lt;br /&gt;
                p ) aMulePort=$OPTARG;;&lt;br /&gt;
                P ) aMulePass=$OPTARG;;&lt;br /&gt;
                v ) verbose=$OPTARG;;&lt;br /&gt;
        esac&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePort&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nWhat is the TCP port for aMule remote connection&amp;quot;&lt;br /&gt;
        read aMulePort&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 if [ -z &amp;quot;$aMulePass&amp;quot; ]; then&lt;br /&gt;
        echo -e &amp;quot;\nPlease, provide password for aMule remote connection&amp;quot;&lt;br /&gt;
        read -s aMulePass&lt;br /&gt;
 fi&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Initiating aMule connection to server&amp;quot;&lt;br /&gt;
 amulecmd -p $aMulePort -P $aMulePass -c connect&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;Searching for ed2k links...&amp;quot;&lt;br /&gt;
 #file descriptor&lt;br /&gt;
 exec 5&amp;lt; $fileName&lt;br /&gt;
 searchStringLeft=&amp;quot;http://www.emugle.com/search.php?q=&amp;quot;&lt;br /&gt;
 searchStringRight=&amp;quot;&amp;amp;t=All+categories&amp;amp;Submit=Search&amp;amp;f=0&amp;quot;&lt;br /&gt;
 tmpFile=`mktemp /tmp/aMuleTmp.XXXXXX`&lt;br /&gt;
&lt;br /&gt;
 #process each line&lt;br /&gt;
 until [ $done ]; do&lt;br /&gt;
        read &amp;lt;&amp;amp;5 searchItem&lt;br /&gt;
        if [ $? != 0 ]; then&lt;br /&gt;
                #end of file reached&lt;br /&gt;
                done=1&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        if [ &amp;quot;$searchItem&amp;quot; = &amp;quot;&amp;quot; ]; then&lt;br /&gt;
                #empty line&lt;br /&gt;
                continue&lt;br /&gt;
        fi&lt;br /&gt;
        echo -e &amp;quot;    SEARCHING:\t$searchItem&amp;quot;&lt;br /&gt;
        searchItem=`echo $searchItem | sed -e 's/\ /+/g'`&lt;br /&gt;
        searchString=&amp;quot;$searchStringLeft$searchItem$searchStringRight&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;2&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -O $tmpFile&lt;br /&gt;
        else&lt;br /&gt;
                wget &amp;quot;$searchString&amp;quot; -o /dev/null -O $tmpFile&lt;br /&gt;
        fi&lt;br /&gt;
        firstResult=`grep -m 1 ed2k $tmpFile`&lt;br /&gt;
        #remove HTML tags and spaces&lt;br /&gt;
        ed2kLink=`echo $firstResult | sed -e 's/&amp;lt;[^&amp;gt;]*&amp;gt;//g'| sed -e 's/\ //g'`&lt;br /&gt;
&lt;br /&gt;
        echo -e &amp;quot;    ADDING:\t$searchItem to aMule. Ed2k link:\n  $ed2kLink\n&amp;quot;&lt;br /&gt;
        if [ &amp;quot;$verbose&amp;quot; = &amp;quot;1&amp;quot; ] || [ &amp;quot;$verbose&amp;quot; = &amp;quot;3&amp;quot; ]; then&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
                amulecmd -p $aMulePort -P $aMulePass -c &amp;quot;add $ed2kLink&amp;quot; &amp;gt; /dev/null&lt;br /&gt;
        fi&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
rm -f $tmpFile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dreamer1</name></author>	</entry>

	<entry>
		<id>http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files</id>
		<title>Automatically search and download arbitrary number of files</title>
		<link rel="alternate" type="text/html" href="http://test.amule.szerverem.hu/wiki/Automatically_search_and_download_arbitrary_number_of_files"/>
				<updated>2007-03-29T07:59:11Z</updated>
		
		<summary type="html">&lt;p&gt;Dreamer1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''WORK IN PROGRESS, CHECK BACK A BIT LATER'''&lt;br /&gt;
&lt;br /&gt;
This short document will describe the setup of the aMule and provide a shell script which will allow you to download all of the files you need without almost any effort needed.&lt;br /&gt;
&lt;br /&gt;
'''1. Have amule installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Obviously, you're gonna need that one.&lt;br /&gt;
&lt;br /&gt;
'''2. Have amule-utils installed'''&amp;lt;br&amp;gt;&lt;br /&gt;
:The shell script which does all the work for you uses the amulecmd utility to add ed2k links to aMule downloads.&lt;br /&gt;
&lt;br /&gt;
'''3. Set up aMule, your firewall, whatever...'''&amp;lt;br&amp;gt;&lt;br /&gt;
:Find a way (if it's not working out of the box) to setup your aMule so that you can manually (the ordinary way) search for and download the files you need.&lt;br /&gt;
&lt;br /&gt;
'''4. Setup aMule Remote Controls'''&amp;lt;br&amp;gt;&lt;br /&gt;
:a. Open Preferences dialog&lt;br /&gt;
:b. In the left pane select &amp;quot;Remote Controls&amp;quot;&lt;br /&gt;
:c. Check the &amp;quot;Accept external connections&amp;quot; checkbox&lt;br /&gt;
:d. Choose (or leave unchanged) TCP port, and write down that number somewhere&lt;br /&gt;
:e. Set password (and remember it) for remote connection in the Password field&lt;br /&gt;
:f. OK&lt;br /&gt;
&lt;br /&gt;
:Now you should have everything you need to successfully use the script you are about to download.&lt;br /&gt;
&lt;br /&gt;
'''5. Download this shell script'''&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dreamer1</name></author>	</entry>

	</feed>