From 6a4b65a796a8d997d7acc96ccac317b447e3cc43 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 28 Feb 2018 14:50:27 -0500 Subject: [PATCH] have `get` fail when given a channel uri before attempting to resolve --- lbrynet/daemon/Daemon.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index b461802f9..5353bef98 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -1626,6 +1626,10 @@ class Daemon(AuthJSONRPCServer): timeout = timeout if timeout is not None else self.download_timeout + parsed_uri = parse_lbry_uri(uri) + if parsed_uri.is_channel and not parsed_uri.path: + raise Exception("cannot download a channel claim, specify a /path") + resolved_result = yield self.session.wallet.resolve(uri) if resolved_result and uri in resolved_result: resolved = resolved_result[uri] @@ -1634,11 +1638,9 @@ class Daemon(AuthJSONRPCServer): if not resolved or 'value' not in resolved: if 'claim' not in resolved: - if 'certificate' in resolved: - raise Exception("Cannot use get on channels") - else: raise Exception( - "Failed to resolve stream at lbry://{}".format(uri.replace("lbry://", ""))) + "Failed to resolve stream at lbry://{}".format(uri.replace("lbry://", "")) + ) else: resolved = resolved['claim'] txid, nout, name = resolved['txid'], resolved['nout'], resolved['name']