Ejemplo n.º 1
0
 def parse_torrents(self, html):
     for (name, links, age) in EZTV.name_re.findall(html):
         quality = parse_quality(name)
         if self.quality and self.quality != quality:
             continue
         pub_date = (datetime.now() - Age.parse(age)).strftime("%Y%m%d%H%M%S")
         for link in EZTV.link_re.findall(links):
             yield Torrent(name = name,
                 source = 'eztv',
                 seeds = -1, leechs = -1,
                 size = -1,
                 files = -1,
                 quality = quality,
                 url = link,
                 date = datetime.now().strftime("%Y%m%d%H%M%S"),
                 pub_date = pub_date)
     return
Ejemplo n.º 2
0
 def __init__(self, **kwargs):
     "name, source, seeds, leechs, size, files, quality, url, date, pub_date"
     self.__dict__.update(kwargs)
     self.age = Age.from_timedelta(datetime.now() - datetime.strptime(self.pub_date, "%Y%m%d%H%M%S"))