The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
Find a file
belikor 65323b4169 file_manager: raise new InvalidStreamURLError if the URL is invalid
When using `lbrynet get URL`, if the URL is not a valid URL
the function `url.URL.parse` will raise a `ValueError` exception
which will produce a whole backtrace.

For example, this is the case if we provide a channel name
with a forward slash but without a stream name.
```
lbrynet get @Non-existing/
```

```
Traceback (most recent call last):
  File "/opt/git/lbry-sdk/lbry/file/file_manager.py", line 84, in download_from_uri
    if not URL.parse(uri).has_stream:
  File "/opt/git/lbry-sdk/lbry/schema/url.py", line 114, in parse
    raise ValueError('Invalid LBRY URL')
ValueError: Invalid LBRY URL
WARNING  lbry.extras.daemon.daemon:1110: Error downloading Non-existing/: Invalid LBRY URL
```

Now we raise a new `InvalidStreamURLError` which can be trapped in the upper functions
that use `url.URL.parse` such as `FileManager.download_from_uri`.
If we do this the traceback won't be shown.
```
WARNING  lbry.file.file_manager:252:
Failed to download Non-existing/: Invalid LBRY stream URL: '@Non-existing/'
WARNING  lbry.extras.daemon.daemon:1110:
Error downloading Non-existing/: Invalid LBRY stream URL: '@Non-existing/'
```

This handles the case when trying to download only "channel" parts
without the claim part.
```
lbrynet get @Non-existing
lbrynet get @Non-existing/
lbrynet get Non-existing/
```
2022-03-15 15:34:08 -03:00
.github/workflows move test_transaction_commands, test_internal_transaction_api , and test_transactions into their own runner 2022-03-15 15:34:08 -03:00
docker add dockerfile for dht node 2022-03-15 15:34:07 -03:00
docs api.json: correct the error in the generated documentation 2022-03-15 15:34:06 -03:00
icons moved lbry up one level 2020-01-01 15:57:56 -05:00
lbry file_manager: raise new InvalidStreamURLError if the URL is invalid 2022-03-15 15:34:08 -03:00
scripts add option to set bootstrap_node 2022-03-15 15:34:07 -03:00
tests fix setting references on txos in extra_txos 2022-03-15 15:34:08 -03:00
.gitignore move test_claim_commands and test_resolve_command into new directory 2022-03-15 15:34:08 -03:00
CHANGELOG.md changelog note 2019-12-28 12:39:46 -05:00
CONTRIBUTING.md Update CONTRIBUTING.md 2019-04-01 16:12:49 -04:00
example_daemon_settings.yml moved lbry up one level 2020-01-01 15:57:56 -05:00
INSTALL.md Update INSTALL.md 2021-07-19 14:20:15 -04:00
lbry.png moved lbry up one level 2020-01-01 15:57:56 -05:00
LICENSE update year 2020-02-03 04:04:51 +07:00
Makefile fix makefile 2021-08-21 10:26:55 -04:00
MANIFEST.in split integration tests into three jobs 2020-01-01 15:57:56 -05:00
README.md update readme 2021-08-21 20:01:49 -04:00
SECURITY.md Create SECURITY.md 2021-04-15 15:21:17 -04:00
setup.cfg omit just node.py 2022-03-15 15:34:06 -03:00
setup.py update plyvel to 1.3.0 2022-03-15 15:34:07 -03:00
tox.ini move test_transaction_commands, test_internal_transaction_api , and test_transactions into their own runner 2022-03-15 15:34:08 -03:00

LBRY LBRY SDK build coverage

LBRY is a decentralized peer-to-peer protocol for publishing and accessing digital content. It utilizes the LBRY blockchain as a global namespace and database of digital content. Blockchain entries contain searchable content metadata, identities, rights and access rules. LBRY also provides a data network that consists of peers (seeders) uploading and downloading data from other peers, possibly in exchange for payments, as well as a distributed hash table used by peers to discover other peers.

LBRY SDK for Python is currently the most fully featured implementation of the LBRY Network protocols and includes many useful components and tools for building decentralized applications. Primary features and components include:

  • Built on Python 3.7 and asyncio.
  • Kademlia DHT (Distributed Hash Table) implementation for finding peers to download from and announcing to peers what we have to host (lbry.dht).
  • Blob exchange protocol for transferring encrypted blobs of content and negotiating payments (lbry.blob_exchange).
  • Protobuf schema for encoding and decoding metadata stored on the blockchain (lbry.schema).
  • Wallet implementation for the LBRY blockchain (lbry.wallet).
  • Daemon with a JSON-RPC API to ease building end user applications in any language and for automating various tasks (lbry.extras.daemon).

Installation

Our releases page contains pre-built binaries of the latest release, pre-releases, and past releases for macOS, Debian-based Linux, and Windows. Automated travis builds are also available for testing.

Usage

Run lbrynet start to launch the API server.

By default, lbrynet will provide a JSON-RPC server at http://localhost:5279. It is easy to interact with via cURL or sane programming languages.

Our quickstart guide provides a simple walkthrough and examples for learning.

With the daemon running, lbrynet commands will show you a list of commands.

The full API is documented here.

Running from source

Installing from source is also relatively painless. Full instructions are in INSTALL.md

Contributing

Contributions to this project are welcome, encouraged, and compensated. For more details, please check this link.

License

This project is MIT licensed. For the full license, see LICENSE.

Security

We take security seriously. Please contact security@lbry.com regarding any security issues. Our PGP key is here if you need it.

Contact

The primary contact for this project is @eukreign.

The documentation for the API can be found here.

Daemon defaults, ports, and other settings are documented here.

Settings can be configured using a daemon-settings.yml file. An example can be found here.