Use script.module.libtorrent to import libtorrent

In order to support more systems (especially the ones where the
libtorrent python bindings cannot be installed manually), the add-on
script.module.libtorrent is now used to import libtorrent.
This commit is contained in:
Thomas 2021-05-19 17:18:00 +00:00
parent 2dc6e8a29f
commit 6f3759a928
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@
<import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.addon.signals" version="0.0.3"/>
<import addon="script.module.requests" version="2.22.0"/>
<import addon="script.module.libtorrent" version="1.2.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="main.py">
<provides>video</provides>

View File

@ -145,7 +145,7 @@ if __name__ == "__main__":
# Import libtorrent here to manage when the library is not installed
try:
import libtorrent
from python_libtorrent import libtorrent
LIBTORRENT_IMPORTED = True
except ImportError as exception:
LIBTORRENT_IMPORTED = False