Skip to content

Commit c07c369

Browse files
committed
add libtorrent pyinstaller hook
1 parent 5be990f commit c07c369

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

scripts/hook-libtorrent.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
Hook for libtorrent.
3+
"""
4+
5+
import os
6+
import glob
7+
import os.path
8+
from PyInstaller.utils.hooks import get_module_file_attribute
9+
from PyInstaller import compat
10+
11+
12+
def get_binaries():
13+
if compat.is_win:
14+
files = ('c:/Windows/System32/libssl-1_1-x64.dll', 'c:/Windows/System32/libcrypto-1_1-x64.dll')
15+
for file in files:
16+
if not os.path.isfile(file):
17+
print(f"MISSING {file}")
18+
return [(file, '.') for file in files]
19+
return []
20+
21+
22+
binaries = get_binaries()
23+
for file in glob.glob(os.path.join(get_module_file_attribute('libtorrent'), 'libtorrent*pyd*')):
24+
binaries.append((file, 'libtorrent'))

0 commit comments

Comments
 (0)