Skip to main content

A DHT crawler framework using asyncio.

Project description

A DHT crawler framework using asyncio.

Usage

from maga import Maga

import logging
logging.basicConfig(level=logging.INFO)


class Crawler(Maga):
    async def handler(self, infohash, addr):
        logging.info(addr)
        logging.info(infohash)


# Or, if you want to have more control

class Crawler(Maga):
    async def handle_get_peers(self, infohash, addr):
        logging.info(addr)
        logging.info(infohash)

    async def handle_announce_peer(self, infohash, addr):
        logging.info(addr)
        logging.info(infohash)


crawler = Crawler()
crawler.run(6881)

ChangeLog

Version 2.0.0

  • Add handle_get_peers, handle_announce_peer function.
  • Add addr param in handler

Project details


Download files

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

Files for Maga, version 2.0.1
Filename, size File type Python version Upload date Hashes
Filename, size Maga-2.0.1-py2.py3-none-any.whl (4.4 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size Maga-2.0.1.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View
Filename, size Maga-2.0.1.zip (6.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page