Skip to content

Commit

Permalink
scripts: note to further investigate in download_blob_from_peer
Browse files Browse the repository at this point in the history
Currently `lbrynet blob get <hash>` 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).
  • Loading branch information
belikor committed Jul 9, 2021
1 parent 8c79740 commit 4ebe4ce
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion scripts/download_blob_from_peer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
"""A simple script that attempts to directly download a single blob.
To Do:
------
Currently `lbrynet blob get <hash>` 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
Expand Down Expand Up @@ -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 <blob_hash> [host url:port]
if __name__ == "__main__":
if len(sys.argv) < 2:
print("usage: download_blob_from_peer.py <blob_hash> [host_url:port]")
sys.exit(1)

url = 'reflector.lbry.com:5567'
if len(sys.argv) > 2:
url = sys.argv[2]
Expand Down

0 comments on commit 4ebe4ce

Please sign in to comment.