1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-09 09:59:51 +01:00

fix "copy magnet to clipboard" error

The info hash can contain uppercase hex digits as well.
This commit is contained in:
Michele Guerini Rocco 2020-05-18 13:55:02 +02:00
parent 890d6a7d85
commit f115bfd8d3
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450

View File

@ -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))