weboob-devel/modules/bitedick/backend.py
Matthieu Rakotojaona b55d83e6ab Add btdigg backend
A resubmit of the previous one, this time with understandable name.
Copied the original submission text.

This is a simple backend for btdigg.org. This site is especially
interesting because it is not an indexer where uploaders add their
torrents; it crawls the DHT and listens to all infohashes being
exchanged by the nodes.

Because of this, btdigg.org provides no description and no torrent
files, only magnets. Moreover, there are no seeders and leechers
(although there is the number of peers in the swarms)

Note that there is no icon.

Signed-off-by: Matthieu Rakotojaona <matthieu.rakotojaona@gmail.com>
Signed-off-by: Romain Bignon <romain@symlink.me>
2014-01-29 11:46:57 +01:00

38 lines
1,016 B
Python

# -*- coding: utf-8 -*-
from weboob.capabilities.torrent import ICapTorrent
from weboob.tools.backend import BaseBackend
from .browser import BTDiggBrowser
__all__ = ['BTDiggBackend']
class BTDiggBackend(BaseBackend, ICapTorrent):
NAME = 'btdigg'
MAINTAINER = u'Matthieu Rakotojaona'
EMAIL = 'matthieu.rakotojaona@gmail.com'
VERSION = '0.i'
DESCRIPTION = 'The BitTorrent DHT search engine.'
LICENSE = 'CC0'
BROWSER = BTDiggBrowser
def create_default_browser(self):
return self.create_browser()
def get_torrent(self, id):
return self.browser.get_torrent(id)
def get_torrent_file(self, id):
return self.browser.get_torrent_file(id)
def iter_torrents(self, pattern):
return self.browser.iter_torrents(pattern.replace(' ', '+'))
#def fill_torrent(self, torrent, fields):
# if 'description' in fields or fields == None:
# return self.get_torrent(torrent.id)
#OBJECTS = {
# Torrent:fill_torrent
#}