diff --git a/1_obtain_osm_data.py b/1_obtain_osm_data.py index 7f6b8e4..23d119c 100644 --- a/1_obtain_osm_data.py +++ b/1_obtain_osm_data.py @@ -1,4 +1,4 @@ -import libtorrent as lt +import libtorrent import time import sys from datetime import datetime @@ -9,7 +9,7 @@ config = __import__("0_config") def main(): print(datetime.now().isoformat(timespec='minutes')) - ses = lt.session({'listen_interfaces': '0.0.0.0:6881'}) + ses = libtorrent.session({'listen_interfaces': '0.0.0.0:6881'}) torrent_file_directory = config.cache_folder() filename = 'planet-latest.osm.pbf.torrent' @@ -19,7 +19,7 @@ def main(): url = 'https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf.torrent' osm_bot_abstraction_layer.util_download_file.download_file_if_not_present_already(url, torrent_file_directory, filename) - info = lt.torrent_info(torrent_file_directory + filename) + info = libtorrent.torrent_info(torrent_file_directory + filename) h = ses.add_torrent({'ti': info, 'save_path': config.planet_download_folder()}) s = h.status() print('starting', s.name) @@ -33,7 +33,7 @@ def main(): alerts = ses.pop_alerts() for a in alerts: - if a.category() & lt.alert.category_t.error_notification: + if a.category() & libtorrent.alert.category_t.error_notification: print(a) sys.stdout.flush()