Avdump2 on Linux: Difference between revisions

Added a python script
(Added instructions about missing Debian packages)
(Added a python script)
Line 91: Line 91:
   setterm -cursor on
   setterm -cursor on
fi
fi
</pre>
== Making Your Life Easier ==
When you made sure everything works fine, if you just want to easily hash files and generate ED2K links for adding new files, you could use this roughly-made Python 2 script. (best paired with Nautilus or Nemo actions)
Please note that this script relies on Zenity extension to display the dialog containing the generated ED2K links. If you get an error running this script, please make sure you have it installed.
<pre>
#!/usr/bin/python
import sys, os, subprocess
### EDIT THE FOLLOWING ACCORDING TO YOUR INFO
AVDUMP2CL_PATH = "/path/to/your/AVDump2CL.exe"
USERNAME = " "
API_KEY = " "
###
command = "mono %s --Auth=%s:%s --PrintEd2kLink -q" % (AVDUMP2CL_PATH, USERNAME, API_KEY)
for arg in sys.argv[1:]:
    command += " \"%s\"" % arg
output = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = output.stdout.readlines()
ed2k = ""
for line in output:
    if line[0:4] == "ed2k":
        ed2k += line
os.system("zenity --info --text '%s'" % ed2k.rstrip())
</pre>
</pre>


1

edit

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.