def copy_magnet(self, link):
"""Copy magnetic link to clipboard.
This method is different from copylink_clipboard().
This method handles the --copy argument.
If --copy argument is supplied, magnetic link is copied to clipboard.
"""
from torrench.Torrench import Torrench
tr = Torrench()
if tr.check_copy():
try:
pyperclip.copy(link)
print("(Magnetic link copied to clipboard)")
except Exception as e:
print("(Unable to copy magnetic link to clipboard. Is [xclip] installed?)")
print("(See logs for details)")
self.logger.error(e)
else:
print("(use --copy to copy magnet to clipboard)")
评论列表
文章目录