aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Manage the files in incoming  (Read 1545 times)

Dominique

  • Approved Newbie
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 23
  • Ask me!
Manage the files in incoming
« on: February 05, 2011, 03:16:17 PM »

I done a bash script that let me manage the files in incoming.

To use this script, you will need xdialog and a few usual linux utilities like perl, grep and sed. I know, perl is not an utility, but as I know nothing to perl, for me it is. The perl part of this script is a generous donation from a guy on the gentoo forum.

To use it, download the attached file, extract it, and put ed2kmanage somewhere in your path.

In Firefox, load about:config, and change the following:
Code: [Select]
pref("network.protocol-handler.app.ed2k", "/path/to/ed2kmanage &");

The final & is needed if you are using firemule, and want to send the links to amule from a forum thread with mass of them. Without it, firefox will just exhaust all of your memory at light speed.

After clicking on an ed2k link, the script will open a Xdialog window that will let you browse and choose a directory for later move, and another xdialog window will let you choose if you want a symlink from the moved file to amule's share directory. It will also send the ed2k link to ed2k for download by aMule.
At that time, it will also write what you want to do in some file for later use.

Some time later, the file will be in Incoming. Open a console and run
Code: [Select]
ed2kmanage -m
This will move the file and create the symlink (if it was wanted before).

The files created by ed2kmanage are 
~/.aMule/man_globalfilelist is the list of files they was put in queue, it grow when new files are added.
~/.aMule/man_movefilelist is the list of files waiting to be moved, it grow when new files are added  and shrink when downloaded files are moved.
~/.aMule/man_movedfilelist is the list of files that was already moved.
It is also 2 temporary files in /tmp.

With those files, ed2kmanage will know, when you click on a link, if the corresponding file is already downloading or downloaded_and_moved. In the later case, it will ask you if you want to download it again.

It is also possible to use this script from the console in order to add new links to manahe, one at a time:
Code: [Select]
ed2kmanage <ed2k_link>
A last work about this script and firemule. ed2kmanage will memorize the last choosed directory. So, when you are in a thread with multiple ed2k links, click on the first link, choose the directory and if you want a symlink. After that, right click and choose "Download all by firemule". You will have just to click on OK on the dialogs.

As you know, it can be difficult to make a bash script to work with file names. It is more than one year ago than I am using this script and it work in most (if not all) cases for me. But as always with free software, I make no guaranty of any kind.  :)
Logged

Dominique

  • Approved Newbie
  • *
  • Karma: 4
  • Offline Offline
  • Posts: 23
  • Ask me!
Re: Manage the files in incoming
« Reply #1 on: February 05, 2011, 03:27:51 PM »

I forget, this script is protected by the Gnu license.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

The first part of the script is variables initialization. You can tailor some directories here, and the emplacement/name of the temporary files.
Logged