Skip to content

Commit

Permalink
add libtorrent pyinstaller hook
Browse files Browse the repository at this point in the history
  • Loading branch information
shyba committed Aug 18, 2022
1 parent 710888a commit ea3d987
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/hook-libtorrent.py
@@ -0,0 +1,24 @@
"""
Hook for libtorrent.
"""

import os
import glob
import os.path
from PyInstaller.utils.hooks import get_module_file_attribute
from PyInstaller import compat


def get_binaries():
if compat.is_win:
files = ('c:/Windows/System32/libssl-1_1-x64.dll', 'c:/Windows/System32/libcrypto-1_1-x64.dll')
for file in files:
if not os.path.isfile(file):
print(f"MISSING {file}")
return [(file, '.') for file in files]
return []


binaries = get_binaries()
for file in glob.glob(os.path.join(get_module_file_attribute('libtorrent'), 'libtorrent*pyd*')):
binaries.append((file, 'libtorrent'))

0 comments on commit ea3d987

Please sign in to comment.