diff --git a/lbry/extras/daemon/json_response_encoder.py b/lbry/extras/daemon/json_response_encoder.py index 75eacdb9a..bb4aefc41 100644 --- a/lbry/extras/daemon/json_response_encoder.py +++ b/lbry/extras/daemon/json_response_encoder.py @@ -285,7 +285,7 @@ class JSONResponseEncoder(JSONEncoder): else: total_bytes_lower_bound = total_bytes = managed_stream.torrent_length result = { - 'streaming_url': None, + 'streaming_url': managed_stream.stream_url, 'completed': managed_stream.completed, 'file_name': None, 'download_directory': None, @@ -326,7 +326,6 @@ class JSONResponseEncoder(JSONEncoder): } if is_stream: result.update({ - 'streaming_url': managed_stream.stream_url, 'stream_hash': managed_stream.stream_hash, 'stream_name': managed_stream.stream_name, 'suggested_file_name': managed_stream.suggested_file_name, @@ -340,10 +339,6 @@ class JSONResponseEncoder(JSONEncoder): 'reflector_progress': managed_stream.reflector_progress, 'uploading_to_reflector': managed_stream.uploading_to_reflector }) - else: - result.update({ - 'streaming_url': f'file://{managed_stream.full_path}', - }) if output_exists: result.update({ 'file_name': managed_stream.file_name, diff --git a/lbry/file/source.py b/lbry/file/source.py index ba5bb311f..519327629 100644 --- a/lbry/file/source.py +++ b/lbry/file/source.py @@ -99,9 +99,9 @@ class ManagedDownloadSource: def completed(self): raise NotImplementedError() - # @property - # def stream_url(self): - # return f"http://{self.config.streaming_host}:{self.config.streaming_port}/stream/{self.sd_hash} + @property + def stream_url(self): + return f"http://{self.config.streaming_host}:{self.config.streaming_port}/stream/{self.identifier}" @property def finished(self) -> bool: diff --git a/lbry/stream/managed_stream.py b/lbry/stream/managed_stream.py index a6be77ce4..b08962820 100644 --- a/lbry/stream/managed_stream.py +++ b/lbry/stream/managed_stream.py @@ -104,10 +104,6 @@ class ManagedStream(ManagedDownloadSource): def completed(self): return self.written_bytes >= self.descriptor.lower_bound_decrypted_length() - @property - def stream_url(self): - return f"http://{self.config.streaming_host}:{self.config.streaming_port}/stream/{self.sd_hash}" - async def update_status(self, status: str): assert status in [self.STATUS_RUNNING, self.STATUS_STOPPED, self.STATUS_FINISHED] self._status = status