示例#1
0
 def setUp(self):
     self.client = TMDBApiClient()
示例#2
0
# -*- coding: utf-8 -*-
from catalogs.info_clients.tmdbclient import TMDBApiClient

client = TMDBApiClient()

class TorrentInfo(object):
    def __init__(self, slug, label, seeders, leechers, kwargs):
        self.slug = slug
        self.label = label
        self.seeders = seeders
        self.leechers = leechers
        self.kwargs = kwargs

        self.description = None
        self.poster = None
        self.title = None

    def get_magnet(self):
        return self.kwargs['magnet']

    def get_torrent_file(self):
        return self.kwargs['torrent_file']

    def get_availability_rate(self) -> int:
        """
        returns integer which values are described below:
        0 - no chance to download torrent
        1 - little change to smooth movie watching
        2 - probably you can watch it
        3 - perfect chance. A lot of seeds
        """