Skip to content

Instantly share code, notes, and snippets.

@sorrycc
Created February 24, 2012 09:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sorrycc/1899709 to your computer and use it in GitHub Desktop.
Save sorrycc/1899709 to your computer and use it in GitHub Desktop.
上传目录下的所有 torrent 文件到迅雷离线
#
# @fileoverview 上传目录下的所有 torrent 文件到迅雷离线.
# @author ChenCheng <sorrycc@gmail.com>
# @ref https://github.com/iambus/xunlei-lixian
#
tmpdir="path/to/tmp/directory";
script="path/to/xunlei-lixian/lixian_cli.py"
if [ ! -d "$tmpdir" ]; then
mkdir -p "$tmpdir";
fi
#python $script login
find ~/Downloads/ -name "*.torrent" | while read name; do
python $script add --torrent "$name"
mv "$name" "$tmpdir"
done
rm -rf "$tmpdir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment