def __init__(self,
              rowid,
              stream_hash,
              peer_finder,
              rate_limiter,
              blob_manager,
              stream_info_manager,
              lbry_file_manager,
              payment_rate_manager,
              wallet,
              download_directory,
              file_name=None):
     EncryptedFileSaver.__init__(self, stream_hash, peer_finder,
                                 rate_limiter, blob_manager,
                                 stream_info_manager, payment_rate_manager,
                                 wallet, download_directory, file_name)
     self.sd_hash = None
     self.txid = None
     self.nout = None
     self.outpoint = None
     self.name = None
     self.claim_id = None
     self.rowid = rowid
     self.lbry_file_manager = lbry_file_manager
     self._saving_status = False
    def test_setup_output(self):
        file_name = 'encrypted_file_saver_test.tmp'
        file_name_hex = file_name.encode('hex')
        self.assertFalse(os.path.isfile(file_name))

        # create file in the temporary trial folder
        stream_hash = ''
        peer_finder = None
        rate_limiter = None
        blob_manager = None
        stream_info_manager = None
        payment_rate_manager = None
        wallet = None
        download_directory = '.'
        key = ''

        saver = EncryptedFileSaver(stream_hash, peer_finder, rate_limiter,
                                   blob_manager, stream_info_manager,
                                   payment_rate_manager, wallet,
                                   download_directory, key, file_name_hex,
                                   file_name_hex)

        yield saver._setup_output()
        self.assertTrue(os.path.isfile(file_name))
        saver._close_output()
 def __init__(self, rowid, stream_hash, peer_finder, rate_limiter, blob_manager,
              stream_info_manager, lbry_file_manager, payment_rate_manager, wallet,
              download_directory, sd_hash=None, key=None, stream_name=None,
              suggested_file_name=None):
     EncryptedFileSaver.__init__(self, stream_hash, peer_finder,
                                 rate_limiter, blob_manager,
                                 stream_info_manager,
                                 payment_rate_manager, wallet,
                                 download_directory, key, stream_name, suggested_file_name)
     self.sd_hash = sd_hash
     self.rowid = rowid
     self.lbry_file_manager = lbry_file_manager
     self._saving_status = False
 def _start(self):
     yield EncryptedFileSaver._start(self)
     status = yield self._save_status()
     log_status(self.sd_hash, status)
     if self.mirror:
         self.mirror.download_stream(self.stream_hash, self.sd_hash)
     defer.returnValue(status)
Exemple #5
0
 def __init__(self, rowid, stream_hash, peer_finder, rate_limiter, blob_manager, storage, lbry_file_manager,
              payment_rate_manager, wallet, download_directory, file_name, stream_name, sd_hash, key,
              suggested_file_name):
     EncryptedFileSaver.__init__(
         self, stream_hash, peer_finder, rate_limiter, blob_manager, storage, payment_rate_manager, wallet,
         download_directory, key, stream_name, file_name
     )
     self.sd_hash = sd_hash
     self.rowid = rowid
     self.suggested_file_name = binascii.unhexlify(suggested_file_name)
     self.lbry_file_manager = lbry_file_manager
     self._saving_status = False
     self.claim_id = None
     self.outpoint = None
     self.claim_name = None
     self.txid = None
     self.nout = None
     self.channel_claim_id = None
     self.channel_name = None
     self.metadata = None
 def __init__(self,
              rowid,
              stream_hash,
              peer_finder,
              rate_limiter,
              blob_manager,
              stream_info_manager,
              lbry_file_manager,
              payment_rate_manager,
              wallet,
              download_directory,
              sd_hash=None,
              key=None,
              stream_name=None,
              suggested_file_name=None):
     EncryptedFileSaver.__init__(self, stream_hash, peer_finder,
                                 rate_limiter, blob_manager,
                                 stream_info_manager, payment_rate_manager,
                                 wallet, download_directory, key,
                                 stream_name, suggested_file_name)
     self.sd_hash = sd_hash
     self.rowid = rowid
     self.lbry_file_manager = lbry_file_manager
     self._saving_status = False
    def test_setup_output(self):
        file_name = 'encrypted_file_saver_test.tmp'
        file_name_hex = file_name.encode('hex')
        self.assertFalse(os.path.isfile(file_name))

        # create file in the temporary trial folder
        stream_hash = ''
        peer_finder = None
        rate_limiter = None
        blob_manager = None
        stream_info_manager = None
        payment_rate_manager = None
        wallet = None
        download_directory = '.'
        key = ''

        saver = EncryptedFileSaver(stream_hash, peer_finder, rate_limiter, blob_manager,
                                   stream_info_manager, payment_rate_manager, wallet,
                                   download_directory, key,
                                   file_name_hex, file_name_hex)

        yield saver._setup_output()
        self.assertTrue(os.path.isfile(file_name))
        saver._close_output()
Exemple #8
0
 def _start(self):
     yield EncryptedFileSaver._start(self)
     yield self.load_file_attributes()
     status = yield self._save_status()
     log_status(self.sd_hash, status)
     defer.returnValue(status)
 def _start(self):
     yield EncryptedFileSaver._start(self)
     status = yield self._save_status()
     log_status(self.sd_hash, status)
     defer.returnValue(status)
 def _start(self):
     yield EncryptedFileSaver._start(self)
     status = yield self._save_status()
     log_status(self.sd_hash, status)
     defer.returnValue(status)