From 4ebe4ce1b79d9fb844c3bedf40b07676bd55b4d3 Mon Sep 17 00:00:00 2001 From: belikor Date: Tue, 6 Jul 2021 00:54:42 -0500 Subject: [PATCH] scripts: note to further investigate in `download_blob_from_peer` Currently `lbrynet blob get ` does not work to download single blobs which are not already present in the system. The function locks up and never returns. It only works for blobs that are in the `blobfiles` directory already. This bug is reported in lbryio/lbry-sdk, issue #2070. Maybe this script can be investigated, and certain parts can be added to `lbry.extras.daemon.daemon.jsonrpc_blob_get` in order to solve the previous issue, and finally download single blobs from the network (peers or reflector servers). --- scripts/download_blob_from_peer.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/download_blob_from_peer.py b/scripts/download_blob_from_peer.py index 3418ab1f8..ae6721dbf 100644 --- a/scripts/download_blob_from_peer.py +++ b/scripts/download_blob_from_peer.py @@ -1,3 +1,19 @@ +"""A simple script that attempts to directly download a single blob. + +To Do: +------ +Currently `lbrynet blob get ` does not work to download single blobs +which are not already present in the system. The function locks up and +never returns. +It only works for blobs that are in the `blobfiles` directory already. + +This bug is reported in lbryio/lbry-sdk, issue #2070. + +Maybe this script can be investigated, and certain parts can be added to +`lbry.extras.daemon.daemon.jsonrpc_blob_get` +in order to solve the previous issue, and finally download single blobs +from the network (peers or reflector servers). +""" import sys import os import asyncio @@ -47,7 +63,11 @@ async def main(blob_hash: str, url: str): print(f"deleted {blob_hash}") -if __name__ == "__main__": # usage: python download_blob_from_peer.py [host url:port] +if __name__ == "__main__": + if len(sys.argv) < 2: + print("usage: download_blob_from_peer.py [host_url:port]") + sys.exit(1) + url = 'reflector.lbry.com:5567' if len(sys.argv) > 2: url = sys.argv[2]