• This repository has been archived on 22/Feb/2021
  • Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created about 9 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Another DHT crawler written in Python using asyncio

Maga

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(
            "Receive get peers message from DHT {}. Infohash: {}.".format(
                addr, infohash
            )
        )

    async def handle_announce_peer(self, infohash, addr, peer_addr):
        logging.info(
            "Receive announce peer message from DHT {}. Infohash: {}. Peer address:{}".format(
                addr, infohash, peer_addr
            )
        )


crawler = Crawler()
# Set port to 0 will use a random available port
crawler.run(port=0)

ChangeLog

Version 3.0.0

  • Add peer_addr param to handle_announce_peer method.
  • Don't raise NotImplementedError on handler

Version 2.0.1

  • Don't fail when signals are not implemented.( #3 )

Version 2.0.0

  • Add handle_get_peers, handle_announce_peer method.
  • Add addr param to handler

More Repositories

1

Catsup

A lightweight static website generator which aims to be simple and elegant.
Python
135
star
2

pixelmatch-py

A fast pixel-level image comparison library, originally created to compare screenshots in tests.
Python
108
star
3

PyWapFetion

A simple Fetion lib for Python.
Python
71
star
4

Gather

Just another forum.
JavaScript
67
star
5

WeRoBot-SAE-demo

Python
45
star
6

Dash.py

Helps you install python documents to Dash easily.
Python
37
star
7

bencoder.pyx

A fast bencode implementation in Cython
Python
29
star
8

fulltextrssplz

Make rss full text.
TypeScript
27
star
9

uestc-evaluate-teacher.js

电子科大评教脚本
JavaScript
27
star
10

Flask-WeRoBot

Adds WeRoBot support to Flask.
Python
26
star
11

mala

Get bittorrent metadata from DHT network
Python
23
star
12

kindle-sdr-cleaner

Clean useless .sdr folders in your Kindle.
Python
16
star
13

mypy-silent

Silence mypy by adding or removing code comments
Python
14
star
14

vuex-queries

Vuex-Queries helps you write query functions in Vuex
JavaScript
12
star
15

resubname

Python
11
star
16

parguments

A simple cli args parser for Python
Python
10
star
17

Django-WeRoBot

Adds WeRoBot support to Django.
Python
10
star
18

font-rename

Renames fonts to their internal name and unpacks .ttc/.otc files.
Python
9
star
19

stuScores

学生成绩管理系统
Vue
9
star
20

uestc_os_exp

UESTC 操作系统实验
C
7
star
21

django-utils-six

Forward compatibility django.utils.six for Django 3
Python
7
star
22

home-assistant-chinese-calendar

查看一天是不是法定节假日/法定工作日的 Home Assistant Sensor
Python
7
star
23

msgfmt-action

A GitHub action for Generate binary message catalog(.mo) from textual translation description(.po).
HCL
7
star
24

catsup-theme-clean

a theme for catsup.
CSS
6
star
25

uestc_network_programming

C
6
star
26

pre-commit-beancount-format

Format beancount files using bean-format
Python
6
star
27

shapaozi

Python
5
star
28

icourse163_autorate

中国大学 MOOC 自动互评
JavaScript
5
star
29

archi

Multi-format archive library based on libarchive
Cython
5
star
30

iEditor

A online editor
Python
5
star
31

abp-rules

My list of Adblock Plus rules
5
star
32

prettier-config

4
star
33

antd-typescript-boilerplate

For creating reproduction about Ant Design's TypeScript-related issue.
JavaScript
4
star
34

antd-iconfont

For use Ant Design's iconfont without alicdn.
4
star
35

babel-plugin-webpack-prefetch

JavaScript
4
star
36

pre-commit-pretty-format-json5

A pre-commit hook that checks that all your JSON5 files are pretty.
Python
4
star
37

userscripts

JavaScript
4
star
38

uestc_compiling_exp

电子科技大学 大二上 编译技术 实验代码
C
3
star
39

django-require-migration-name

require `name` in Django's `makemigrations`
Python
3
star
40

renovate-config

JavaScript
3
star
41

dingtalk-dianfan

工作日每天定时发送点饭提醒
Python
3
star
42

KVocabPal

View & export Kindle's vocabulary data
TypeScript
3
star
43

volmoe-pack

pack comic volumes for vol.moe
Python
3
star
44

Tornado-WeRoBot

Adds WeRoBot support to Tornado.
Python
3
star
45

Alfred-BaiduX

"让我帮你百度一下" 的 Alfred Workflow
2
star
46

Alfred-Mianliao

Mianliao fucks me everyday
Python
2
star
47

awesome-epic-exclusive-games

Python
2
star
48

diningcity-sms-to-ics

Python
2
star
49

uestc-eams-cleartimeout-userscript

清除电子科大教务系统 setTimeouts 的 Userscript,可以有效提升教务系统流畅性,减轻学校服务器压力,热爱成电从我做起
JavaScript
2
star
50

kmanga_mobi

mobi package extracted from kmanga
Python
1
star
51

3G-Fetion

一个使用Python+PySide制作的3G飞信客户端
Python
1
star
52

ShaPaoZi-Mobile

The mobile app of shapaozi.me
Java
1
star
53

ticker

Go
1
star
54

Waterspout

Python
1
star
55

gqueue

Python
1
star
56

catsup-theme-sealscript

a theme for catsup.
CSS
1
star
57

uestc_java_exp

Java 实验代码
Java
1
star
58

OpenerManifest

Set of rules powering Opener for iOS
1
star
59

uestc_mathexp

电子科技大学 大一数学实验 实验代码
MATLAB
1
star
60

catsup-theme-phase

JavaScript
1
star
61

yais

Yet Another Image Scraper
HTML
1
star
62

humanstxt

A python library for dealing with humans.txt
Python
1
star
63

gitlab-merge-request-auto-hide-whitespace-userscript

User Script for Adding `?w=1` for diff links in your GitLab Merge Request Page.
JavaScript
1
star
64

pointers-on-c

C
1
star