From 262b9a624bf4e0be4f91b117e87f1562cebb5a8e Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 30 Jan 2019 14:59:48 -0500 Subject: [PATCH] update file_reflect --- lbrynet/extras/daemon/Daemon.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lbrynet/extras/daemon/Daemon.py b/lbrynet/extras/daemon/Daemon.py index 00da28fad..20a46bcf4 100644 --- a/lbrynet/extras/daemon/Daemon.py +++ b/lbrynet/extras/daemon/Daemon.py @@ -6,6 +6,7 @@ import inspect import typing import aiohttp import base58 +import random from urllib.parse import urlencode, quote from typing import Callable, Optional, List from binascii import hexlify, unhexlify @@ -2788,7 +2789,15 @@ class Daemon(metaclass=JSONRPCServerType): (list) list of blobs reflected """ - raise NotImplementedError() + server, port = kwargs.get('server'), kwargs.get('port') + if server and port: + port = int(port) + else: + server, port = random.choice(self.conf.reflector_servers) + return await asyncio.gather(*[ + stream.upload_to_reflector(server, port) + for stream in self.stream_manager.get_filtered_streams(**kwargs) + ]) @requires(DHT_COMPONENT) async def jsonrpc_peer_ping(self, node_id, address, port):