Commit graph

23 commits

Author SHA1 Message Date
belikor
9509acc490
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/
```
2021-10-15 08:59:37 -04:00
keikari
d9413039ec
Fix suggestion for issue #3240
L135: If `getattr()` returns `None`, use `""` instead to avoid error in issue #3240
2021-05-12 18:30:38 +03:00
Victor Shyba
7439893a2a fix get for sourceless claims 2021-03-14 10:11:42 -04:00
Lex Berezhny
8b55814ab2 fixes #2943 bug where get forced user to purchase their own priced stream 2021-01-22 07:51:13 -05:00
Akinwale Ariwodola
af94687d45 add download_path as a filter field for file_list 2020-05-17 10:32:26 +01:00
Jack Robison
bbded12923
fix node not being set on the downloader in some cases 2020-05-12 17:50:20 -04:00
Jack Robison
b000a40f28
add completed filter arg to file_list 2020-05-11 19:22:53 -04:00
Jack Robison
a469b8bc04
return streams matching all file_list filters rather than those matching any
-fix filter fields when using sets
2020-05-11 19:11:41 -04:00
Victor Shyba
de78876b1a fix test purchase 2020-05-07 04:04:55 -03:00
Victor Shyba
64c25b049c fixup get_filtered from rebase 2020-05-07 04:04:55 -03:00
Victor Shyba
a7c2408c0a fix and test delete with torrents 2020-05-07 04:04:55 -03:00
Victor Shyba
f602541ede fix not knowing a torrent exists 2020-05-07 04:04:55 -03:00
Victor Shyba
a2f8e7068e pylint 2020-05-07 04:04:54 -03:00
Victor Shyba
4d47873219 working file list after torrent get 2020-05-07 04:04:54 -03:00
Victor Shyba
cf985486e5 torrent test and misc fixes 2020-05-07 04:04:54 -03:00
Victor Shyba
dd26a96828 adds more torrent parts 2020-05-07 04:04:54 -03:00
Victor Shyba
6865ddfc12 torrent manager and torrent source 2020-05-07 04:04:54 -03:00
Victor Shyba
e888e69d4d fix unit tests 2020-05-07 04:04:54 -03:00
Victor Shyba
2089059792 pylint 2020-05-07 04:04:54 -03:00
Victor Shyba
27739e0364 fix save from resolve 2020-05-07 04:04:54 -03:00
Victor Shyba
543c75b293 wip 2020-05-07 04:04:54 -03:00
Jack Robison
814a0a123f file manager refactor 2020-05-07 04:04:54 -03:00
Jack Robison
179383540f ManagedDownloadSource and SourceManager refactor 2020-05-07 04:04:54 -03:00