Ejemplo n.º 1
0
 def setUp(self):
     download_path = tmp_path = os.path.join(
         os.path.dirname(os.path.realpath(__file__)), 'subtmp')
     settings = {'Titulky.com': {'Titulkypass': '', 'Titulkyuser': ''}}
     self.seeker = SubsSeeker(download_path,
                              tmp_path,
                              captcha_cb,
                              delay_cb,
                              message_cb,
                              settings=settings,
                              debug=True)
Ejemplo n.º 2
0
def main():
    global stdout
    stdout = sys.stdout
    stderr = sys.stderr
    sys.stdout = open('/tmp/subssupport.log', 'w')
    sys.stderr = sys.stdout
    options = recieve()
    print 'recieved options: %r' % options
    from seek import SubsSeeker
    seeker = SubsSeeker(options.get('download_path', '/tmp/'),
                        options.get('tmp_path', '/tmp/'), captchaCB, delayCB,
                        messageCB, options.get('settings'))
    return searchSubtitles(seeker, options['search'])
Ejemplo n.º 3
0
def main():
    global stdout
    stdout = sys.stdout
    sys.stdout = open('/tmp/subssupport.log', 'w')
    sys.stderr = sys.stdout
    options = recieve()
    print('recieved options: %r' % options)
    try:
        from .seek import SubsSeeker
    except (ValueError, ImportError):
        from seek import SubsSeeker
    seeker = SubsSeeker(options.get('download_path', '/tmp/'),
                        options.get('tmp_path', '/tmp/'),
                        captchaCB, delayCB, messageCB,
                        options.get('settings'))
    if options.get('search'):
        return searchSubtitles(seeker, options['search'])
    elif options.get('download'):
        return downloadSubtitles(seeker, options['download'])
Ejemplo n.º 4
0
 def setUp(self):
     remove_files_in_dir(self.download_path)
     remove_files_in_dir(self.custom_path)
     remove_files_in_dir(self.temp_path)
     remove_files_in_dir(self.video_path)
     try:
         shutil.copyfile(os.path.join(test, 'utilsfiles', 'rarfile'),
                         ArchiveDownloadSeeker.subpath)
     except:
         pass
     try:
         shutil.copyfile(
             os.path.join(test, 'subfiles', 'test_microdvd.txt'),
             NotArchiveDownloadSeeker.subpath)
     except:
         pass
     providers = [ArchiveDownloadSeeker, NotArchiveDownloadSeeker]
     self.seeker = SubsSeeker(self.download_path,
                              self.temp_path,
                              captcha_cb,
                              delay_cb,
                              message_cb,
                              debug=True,
                              providers=providers)