mirror of
https://codeberg.org/matkoniecz/list_how_openstreetmap_can_be_improved_with_alltheplaces_data.git
synced 2025-04-11 10:09:29 +02:00
expand libtorrent
This commit is contained in:
parent
1827c90894
commit
df11af8552
1 changed files with 4 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue