Last active
August 29, 2015 14:05
-
-
Save cas--/a4be1a9275231a255131 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import libtorrent as lt | |
import time | |
session = lt.session(flags=0) | |
print('Session started: ', lt.version) | |
h = session.add_torrent({'ti': lt.torrent_info('../T1.torrent'), 'save_path': './lt_test_data'}) | |
h.auto_managed(False) | |
session.set_alert_mask(lt.alert.category_t.error_notification | lt.alert.category_t.status_notification) | |
session.listen_on(15814, 15814) | |
proxy_settings = lt.proxy_settings() | |
proxy_settings.hostname = u'' | |
proxy_settings.port = 0 | |
session.set_i2p_proxy(proxy_settings) | |
time.sleep(1) | |
alerts = session.pop_alerts() | |
for alert in alerts: | |
print(type(alert).__name__, alert.message()) | |
print('Exiting...') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment