xd1936
xd1936

Reputation: 1180

Save aria2 generated .torrent file with magnet's "dn" name?

Aria2 has the ability to specify a magnet URI and it will save a torrent file. This file gets saved with a name of the hex encoded info hash with suffix .torrent.

Magnet URIs have an option for ?dn=, which is a Display Name. Is it possible to use this name when saving the torrent, so that

aria2c -d . --bt-metadata-only=true --bt-save-metadata=true "magnet:?xt=urn:btih:cf7da7ab4d4e6125567bd979994f13bb1f23dddd&dn=ubuntu-18.04.2-desktop-amd64.iso"

outputs ubuntu-18.04.2-desktop-amd64.iso.torrent instead of cf7da7ab4d4e6125567bd979994f13bb1f23dddd.torrent?

Upvotes: 0

Views: 1552

Answers (1)

rifaqat
rifaqat

Reputation: 311

I couldn't find any direct option, but there is a workaround

aria2c -S, --show-files[=true|false]

Print file listing of .torrent, .meta4 and .metalink file and exit. More detailed information will be listed in case of torrent file.

Using this and some greping, cutting you could do something like this..

mv hash.torrent  "`aria2c -S hash.torrent | grep Name | cut -c7-`.torrent"

Upvotes: 1

Related Questions