From f115bfd8d3435496474ce0111e0ce909b4e049da Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Mon, 18 May 2020 13:55:02 +0200 Subject: [PATCH] fix "copy magnet to clipboard" error The info hash can contain uppercase hex digits as well. --- pirate/torrent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pirate/torrent.py b/pirate/torrent.py index 4798c4c..defccbc 100644 --- a/pirate/torrent.py +++ b/pirate/torrent.py @@ -236,7 +236,7 @@ def copy_magnets(printer, chosen_links, results): clipboard_text = '' for link in chosen_links: magnet = results[link]['magnet'] - info_hash = int(re.search(r'btih:([a-f0-9]{40})', magnet).group(1), 16) + info_hash = int(re.search(r'btih:([a-fA-F0-9]{40})', magnet).group(1), 16) clipboard_text += magnet + "\n" printer.print('Copying {:X} to clipboard'.format(info_hash))