Skip to content

Commit

Permalink
fix "copy magnet to clipboard" error
Browse files Browse the repository at this point in the history
The info hash can contain uppercase hex digits as well.
  • Loading branch information
rnhmjoj committed May 18, 2020
1 parent 890d6a7 commit f115bfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pirate/torrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit f115bfd

Please sign in to comment.