Skip to main content
Help us improve Python packaging – donate today!

Get metadata from DHT network

Project Description

Get metadata from DHT network. A BEP-9 implementation on Python 3.5+

Usage

import asyncio
from mala import get_metadata

loop = asyncio.get_event_loop()
metainfo = loop.run_until_complete(get_metadata(
    'infohash', 'ip', 'port', loop=self.loop
)

Or, use with Maga

from maga import Maga
from mala import get_metadata


class Crawler(Maga):
    async def handle_get_peers(self, infohash, addr):
        pass

    async def handle_announce_peer(self, infohash, addr, peer_addr):
        metainfo = await get_metadata(
            infohash, peer_addr[0], peer_addr[1], loop=self.loop
        )

crawler = Crawler()
crawler.run(port=0)

Release history Release notifications

This version
History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
Mala-0.1.0-py2.py3-none-any.whl (4.4 kB) Copy SHA256 hash SHA256 Wheel 3.5 Aug 16, 2016
Mala-0.1.0.tar.gz (4.1 kB) Copy SHA256 hash SHA256 Source None Aug 16, 2016
Mala-0.1.0.zip (6.7 kB) Copy SHA256 hash SHA256 Source None Aug 16, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page