belikor / lbrytools

Python library with useful methods built on top of the lbrynet client from the LBRY project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return only 'stream' claims when searching claims in a channel

belikor opened this issue · comments

Various operations such as download and delete can only be performed on downloadable content, that is, streams.

At the moment many functions depend on searching multiple claims from a channel by using search_ch.ch_search_latest.

Instead of returning all types (streams, reposts, collections, livestreams) from the search, we should add an option to only return streams:

claims = ch_search_latest("@some-chn", number=12, only_streams=False)
streams = ch_search_latest("@some-chn", number=12, only_streams=True)

This can be implemented by specifying the claim_type and using the has_source parameter in claim_search in lbrynet:

lbrynet claim search --channel=@some-chn --claim_type=stream --has_source=True

Livestreams are of type 'stream' but they don't have a source, so they are not downloadable, and should be avoided.