audio/video/image stream types
This commit is contained in:
parent
1cb696fb5c
commit
c708c1db07
4 changed files with 340 additions and 161 deletions
|
@ -1869,12 +1869,14 @@ class Daemon(metaclass=JSONRPCServerType):
|
|||
|
||||
Usage:
|
||||
publish (<name> | --name=<name>) (<bid> | --bid=<bid>) (<file_path> | --file_path=<file_path>)
|
||||
(<stream_type> | --stream_type=<stream_type>)
|
||||
[--tags=<tags>...] [--allow_duplicate_name=<allow_duplicate_name>]
|
||||
[--fee_currency=<fee_currency>] [--fee_amount=<fee_amount>] [--fee_address=<fee_address>]
|
||||
[--title=<title>] [--description=<description>] [--author=<author>] [--language=<language>]
|
||||
[--license=<license>] [--license_url=<license_url>] [--thumbnail_url=<thumbnail_url>]
|
||||
[--release_time=<release_time>] [--duration=<duration>]
|
||||
[--video_width=<video_width>] [--video_height=<video_height>]
|
||||
[--release_time=<release_time>] [--stream_type=<stream_type>]
|
||||
[--video_width=<video_width>] [--video_height=<video_height>] [--video_duration=<video_duration>]
|
||||
[--image_width=<image_width>] [--image_height=<image_height>] [--audio_duration=<audio_duration>]
|
||||
[--channel_id=<channel_id>] [--channel_account_id=<channel_account_id>...]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>] [--preview]
|
||||
|
||||
|
@ -1903,8 +1905,15 @@ class Daemon(metaclass=JSONRPCServerType):
|
|||
--release_time=<duration> : (int) original public release of content, seconds since UNIX epoch
|
||||
--duration=<duration> : (int) audio/video duration in seconds, an attempt will be made to
|
||||
calculate this automatically if not provided
|
||||
--stream_type=<stream_type> : (str) type of stream
|
||||
--image_width=<image_width> : (int) image width
|
||||
--image_height=<image_height> : (int) image height
|
||||
--video_width=<video_width> : (int) video width
|
||||
--video_height=<video_height> : (int) video height
|
||||
--video_duration=<duration> : (int) video duration in seconds, an attempt will be made to
|
||||
calculate this automatically if not provided
|
||||
--audio_duration=<duration> : (int) audio duration in seconds, an attempt will be made to
|
||||
calculate this automatically if not provided
|
||||
--channel_id=<channel_id> : (str) claim id of the publisher channel
|
||||
--channel_account_id=<channel_id>: (str) one or more account ids for accounts to look in
|
||||
for channel certificates, defaults to all accounts.
|
||||
|
@ -1971,8 +1980,9 @@ class Daemon(metaclass=JSONRPCServerType):
|
|||
[--fee_currency=<fee_currency>] [--fee_amount=<fee_amount>] [--fee_address=<fee_address>]
|
||||
[--title=<title>] [--description=<description>] [--author=<author>] [--language=<language>]
|
||||
[--license=<license>] [--license_url=<license_url>] [--thumbnail_url=<thumbnail_url>]
|
||||
[--release_time=<release_time>] [--duration=<duration>]
|
||||
[--video_width=<video_width>] [--video_height=<video_height>]
|
||||
[--release_time=<release_time>] [--stream_type=<stream_type>]
|
||||
[--video_width=<video_width>] [--video_height=<video_height>] [--video_duration=<video_duration>]
|
||||
[--image_width=<image_width>] [--image_height=<image_height>] [--audio_duration=<audio_duration>]
|
||||
[--channel_id=<channel_id>] [--channel_account_id=<channel_account_id>...] [--clear-channel]
|
||||
[--account_id=<account_id>] [--claim_address=<claim_address>] [--preview]
|
||||
|
||||
|
@ -1998,10 +2008,15 @@ class Daemon(metaclass=JSONRPCServerType):
|
|||
--license_url=<license_url> : (str) publication license url
|
||||
--thumbnail_url=<thumbnail_url>: (str) thumbnail url
|
||||
--release_time=<duration> : (int) original public release of content, seconds since UNIX epoch
|
||||
--duration=<duration> : (int) audio/video duration in seconds, an attempt will be made to
|
||||
calculate this automatically if not provided
|
||||
--stream_type=<stream_type> : (str) type of stream
|
||||
--image_width=<image_width> : (int) image width
|
||||
--image_height=<image_height> : (int) image height
|
||||
--video_width=<video_width> : (int) video width
|
||||
--video_height=<video_height> : (int) video height
|
||||
--video_duration=<duration> : (int) video duration in seconds, an attempt will be made to
|
||||
calculate this automatically if not provided
|
||||
--audio_duration=<duration> : (int) audio duration in seconds, an attempt will be made to
|
||||
calculate this automatically if not provided
|
||||
--channel_id=<channel_id> : (str) claim id of the publisher channel
|
||||
--clear-channel : (bool) remove channel signature
|
||||
--channel_account_id=<channel_id>: (str) one or more account ids for accounts to look in
|
||||
|
|
|
@ -82,28 +82,25 @@ class Claim(Signable):
|
|||
return claim
|
||||
|
||||
|
||||
class Video:
|
||||
class Dimmensional:
|
||||
|
||||
__slots__ = '_video',
|
||||
|
||||
def __init__(self, video_message):
|
||||
self._video = video_message
|
||||
__slots__ = ()
|
||||
|
||||
@property
|
||||
def width(self) -> int:
|
||||
return self._video.width
|
||||
return self.message.width
|
||||
|
||||
@width.setter
|
||||
def width(self, width: int):
|
||||
self._video.width = width
|
||||
self.message.width = width
|
||||
|
||||
@property
|
||||
def height(self) -> int:
|
||||
return self._video.height
|
||||
return self.message.height
|
||||
|
||||
@height.setter
|
||||
def height(self, height: int):
|
||||
self._video.height = height
|
||||
self.message.height = height
|
||||
|
||||
@property
|
||||
def dimensions(self) -> Tuple[int, int]:
|
||||
|
@ -111,7 +108,51 @@ class Video:
|
|||
|
||||
@dimensions.setter
|
||||
def dimensions(self, dimensions: Tuple[int, int]):
|
||||
self._video.width, self._video.height = dimensions
|
||||
self.message.width, self.message.height = dimensions
|
||||
|
||||
|
||||
class Playable:
|
||||
|
||||
__slots__ = ()
|
||||
|
||||
@property
|
||||
def duration(self) -> int:
|
||||
return self.message.duration
|
||||
|
||||
@duration.setter
|
||||
def duration(self, duration: int):
|
||||
self.message.duration = duration
|
||||
|
||||
def set_duration_from_path(self, file_path):
|
||||
try:
|
||||
file_metadata = binary_file_metadata(binary_file_parser(file_path))
|
||||
self.duration = file_metadata.getValues('duration')[0].seconds
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
class Image(Dimmensional):
|
||||
|
||||
__slots__ = 'message',
|
||||
|
||||
def __init__(self, image_message):
|
||||
self.message = image_message
|
||||
|
||||
|
||||
class Video(Dimmensional, Playable):
|
||||
|
||||
__slots__ = 'message',
|
||||
|
||||
def __init__(self, video_message):
|
||||
self.message = video_message
|
||||
|
||||
|
||||
class Audio(Playable):
|
||||
|
||||
__slots__ = 'message',
|
||||
|
||||
def __init__(self, audio_message):
|
||||
self.message = audio_message
|
||||
|
||||
|
||||
class File:
|
||||
|
@ -226,6 +267,10 @@ class BaseClaimSubType:
|
|||
def __init__(self, claim: Claim):
|
||||
self.claim = claim or Claim()
|
||||
|
||||
@property
|
||||
def tags(self) -> List:
|
||||
return self.message.tags
|
||||
|
||||
@property
|
||||
def title(self) -> str:
|
||||
return self.message.title
|
||||
|
@ -242,14 +287,6 @@ class BaseClaimSubType:
|
|||
def description(self, description: str):
|
||||
self.message.description = description
|
||||
|
||||
@property
|
||||
def language(self) -> str:
|
||||
return self.message.language
|
||||
|
||||
@language.setter
|
||||
def language(self, language: str):
|
||||
self.message.language = language
|
||||
|
||||
@property
|
||||
def thumbnail_url(self) -> str:
|
||||
return self.message.thumbnail_url
|
||||
|
@ -259,8 +296,12 @@ class BaseClaimSubType:
|
|||
self.message.thumbnail_url = thumbnail_url
|
||||
|
||||
@property
|
||||
def tags(self) -> List:
|
||||
return self.message.tags
|
||||
def language(self) -> str:
|
||||
return self.message.language
|
||||
|
||||
@language.setter
|
||||
def language(self, language: str):
|
||||
self.message.language = language
|
||||
|
||||
def to_dict(self):
|
||||
return MessageToDict(self.message, preserving_proto_field_name=True)
|
||||
|
@ -340,19 +381,35 @@ class Stream(BaseClaimSubType):
|
|||
self.message = self.claim.stream_message
|
||||
|
||||
def update(
|
||||
self, file_path=None, duration=None,
|
||||
self, file_path=None, stream_type=None,
|
||||
fee_currency=None, fee_amount=None, fee_address=None,
|
||||
video_height=None, video_width=None,
|
||||
**kwargs):
|
||||
|
||||
duration_was_not_set = True
|
||||
sub_types = ('image', 'video', 'audio')
|
||||
for key in list(kwargs.keys()):
|
||||
for sub_type in sub_types:
|
||||
if key.startswith(f'{sub_type}_'):
|
||||
stream_type = sub_type
|
||||
sub_obj = getattr(self, sub_type)
|
||||
sub_obj_attr = key[len(f'{sub_type}_'):]
|
||||
setattr(sub_obj, sub_obj_attr, kwargs.pop(key))
|
||||
if sub_obj_attr == 'duration':
|
||||
duration_was_not_set = False
|
||||
break
|
||||
|
||||
if stream_type is not None:
|
||||
if stream_type not in sub_types:
|
||||
raise Exception(
|
||||
f"stream_type of '{stream_type}' is not valid, must be one of: {sub_types}"
|
||||
)
|
||||
|
||||
sub_obj = getattr(self, stream_type)
|
||||
if duration_was_not_set and file_path and isinstance(sub_obj, Playable):
|
||||
sub_obj.set_duration_from_path(file_path)
|
||||
|
||||
super().update(**kwargs)
|
||||
|
||||
if video_height is not None:
|
||||
self.video.height = video_height
|
||||
|
||||
if video_width is not None:
|
||||
self.video.width = video_width
|
||||
|
||||
if file_path is not None:
|
||||
self.media_type = guess_media_type(file_path)
|
||||
if not os.path.isfile(file_path):
|
||||
|
@ -371,31 +428,6 @@ class Stream(BaseClaimSubType):
|
|||
else:
|
||||
raise Exception(f'Unknown currency type: {fee_currency}')
|
||||
|
||||
if duration is not None:
|
||||
self.duration = duration
|
||||
elif file_path is not None:
|
||||
try:
|
||||
file_metadata = binary_file_metadata(binary_file_parser(file_path))
|
||||
self.duration = file_metadata.getValues('duration')[0].seconds
|
||||
except:
|
||||
pass
|
||||
|
||||
@property
|
||||
def video(self) -> Video:
|
||||
return Video(self.message.video)
|
||||
|
||||
@property
|
||||
def file(self) -> File:
|
||||
return File(self.message.file)
|
||||
|
||||
@property
|
||||
def fee(self) -> Fee:
|
||||
return Fee(self.message.fee)
|
||||
|
||||
@property
|
||||
def has_fee(self) -> bool:
|
||||
return self.message.HasField('fee')
|
||||
|
||||
@property
|
||||
def hash(self) -> str:
|
||||
return hexlify(self.message.hash).decode()
|
||||
|
@ -420,14 +452,6 @@ class Stream(BaseClaimSubType):
|
|||
def author(self, author: str):
|
||||
self.message.author = author
|
||||
|
||||
@property
|
||||
def media_type(self) -> str:
|
||||
return self.message.media_type
|
||||
|
||||
@media_type.setter
|
||||
def media_type(self, media_type: str):
|
||||
self.message.media_type = media_type
|
||||
|
||||
@property
|
||||
def license(self) -> str:
|
||||
return self.message.license
|
||||
|
@ -444,14 +468,6 @@ class Stream(BaseClaimSubType):
|
|||
def license_url(self, license_url: str):
|
||||
self.message.license_url = license_url
|
||||
|
||||
@property
|
||||
def duration(self) -> int:
|
||||
return self.message.duration
|
||||
|
||||
@duration.setter
|
||||
def duration(self, duration: int):
|
||||
self.message.duration = duration
|
||||
|
||||
@property
|
||||
def release_time(self) -> int:
|
||||
return self.message.release_time
|
||||
|
@ -459,3 +475,35 @@ class Stream(BaseClaimSubType):
|
|||
@release_time.setter
|
||||
def release_time(self, release_time: int):
|
||||
self.message.release_time = release_time
|
||||
|
||||
@property
|
||||
def media_type(self) -> str:
|
||||
return self.message.media_type
|
||||
|
||||
@media_type.setter
|
||||
def media_type(self, media_type: str):
|
||||
self.message.media_type = media_type
|
||||
|
||||
@property
|
||||
def fee(self) -> Fee:
|
||||
return Fee(self.message.fee)
|
||||
|
||||
@property
|
||||
def has_fee(self) -> bool:
|
||||
return self.message.HasField('fee')
|
||||
|
||||
@property
|
||||
def file(self) -> File:
|
||||
return File(self.message.file)
|
||||
|
||||
@property
|
||||
def image(self) -> Image:
|
||||
return Image(self.message.image)
|
||||
|
||||
@property
|
||||
def video(self) -> Video:
|
||||
return Video(self.message.video)
|
||||
|
||||
@property
|
||||
def audio(self) -> Audio:
|
||||
return Audio(self.message.audio)
|
||||
|
|
|
@ -19,7 +19,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
|
|||
package='pb',
|
||||
syntax='proto3',
|
||||
serialized_options=None,
|
||||
serialized_pb=_b('\n\x0b\x63laim.proto\x12\x02pb\"M\n\x05\x43laim\x12\x1c\n\x06stream\x18\x01 \x01(\x0b\x32\n.pb.StreamH\x00\x12\x1e\n\x07\x63hannel\x18\x02 \x01(\x0b\x32\x0b.pb.ChannelH\x00\x42\x06\n\x04type\"\xb8\x01\n\x07\x43hannel\x12\x12\n\npublic_key\x18\x01 \x01(\x0c\x12\r\n\x05title\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x15\n\rcontact_email\x18\x04 \x01(\t\x12\x14\n\x0chomepage_url\x18\x05 \x01(\t\x12\x0c\n\x04tags\x18\x06 \x03(\t\x12\x15\n\rthumbnail_url\x18\x10 \x01(\t\x12\x11\n\tcover_url\x18\x11 \x01(\t\x12\x10\n\x08language\x18\x12 \x01(\t\"\xab\x02\n\x06Stream\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\x10\n\x08language\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x0e\n\x06\x61uthor\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x12\n\nmedia_type\x18\x06 \x01(\t\x12\x0f\n\x07license\x18\x07 \x01(\t\x12\x16\n\x04\x66ile\x18\x08 \x01(\x0b\x32\x08.pb.File\x12\x14\n\x03\x66\x65\x65\x18\x10 \x01(\x0b\x32\x07.pb.Fee\x12\x13\n\x0blicense_url\x18\x11 \x01(\t\x12\x15\n\rthumbnail_url\x18\x12 \x01(\t\x12\x10\n\x08\x64uration\x18\x13 \x01(\r\x12\x0c\n\x04tags\x18\x14 \x03(\t\x12\x14\n\x0crelease_time\x18\x15 \x01(\x03\x12\x18\n\x05video\x18\x16 \x01(\x0b\x32\t.pb.Video\"h\n\x03\x46\x65\x65\x12\"\n\x08\x63urrency\x18\x01 \x01(\x0e\x32\x10.pb.Fee.Currency\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x03 \x01(\x04\"\x1c\n\x08\x43urrency\x12\x07\n\x03LBC\x10\x00\x12\x07\n\x03USD\x10\x01\"\"\n\x04\x46ile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x04\"&\n\x05Video\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\rb\x06proto3')
|
||||
serialized_pb=_b('\n\x0b\x63laim.proto\x12\x02pb\"M\n\x05\x43laim\x12\x1c\n\x06stream\x18\x01 \x01(\x0b\x32\n.pb.StreamH\x00\x12\x1e\n\x07\x63hannel\x18\x02 \x01(\x0b\x32\x0b.pb.ChannelH\x00\x42\x06\n\x04type\"\xb8\x01\n\x07\x43hannel\x12\x12\n\npublic_key\x18\x01 \x01(\x0c\x12\x0c\n\x04tags\x18\x02 \x03(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x15\n\rthumbnail_url\x18\x05 \x01(\t\x12\x10\n\x08language\x18\x06 \x01(\t\x12\x15\n\rcontact_email\x18\x07 \x01(\t\x12\x14\n\x0chomepage_url\x18\x08 \x01(\t\x12\x11\n\tcover_url\x18\t \x01(\t\"\xdb\x02\n\x06Stream\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\x0c\n\x04tags\x18\x02 \x03(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x15\n\rthumbnail_url\x18\x05 \x01(\t\x12\x10\n\x08language\x18\x06 \x01(\t\x12\x0e\n\x06\x61uthor\x18\x07 \x01(\t\x12\x0f\n\x07license\x18\x08 \x01(\t\x12\x13\n\x0blicense_url\x18\t \x01(\t\x12\x14\n\x0crelease_time\x18\n \x01(\x03\x12\x12\n\nmedia_type\x18\r \x01(\t\x12\x14\n\x03\x66\x65\x65\x18\x0e \x01(\x0b\x32\x07.pb.Fee\x12\x16\n\x04\x66ile\x18\x0f \x01(\x0b\x32\x08.pb.File\x12\x1a\n\x05image\x18\x10 \x01(\x0b\x32\t.pb.ImageH\x00\x12\x1a\n\x05video\x18\x11 \x01(\x0b\x32\t.pb.VideoH\x00\x12\x1a\n\x05\x61udio\x18\x12 \x01(\x0b\x32\t.pb.AudioH\x00\x42\x06\n\x04type\"h\n\x03\x46\x65\x65\x12\"\n\x08\x63urrency\x18\x01 \x01(\x0e\x32\x10.pb.Fee.Currency\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\x0c\x12\x0e\n\x06\x61mount\x18\x03 \x01(\x04\"\x1c\n\x08\x43urrency\x12\x07\n\x03LBC\x10\x00\x12\x07\n\x03USD\x10\x01\"\"\n\x04\x46ile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04size\x18\x02 \x01(\x04\"&\n\x05Image\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\"8\n\x05Video\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\x12\x10\n\x08\x64uration\x18\x03 \x01(\r\"\x19\n\x05\x41udio\x12\x10\n\x08\x64uration\x18\x01 \x01(\rb\x06proto3')
|
||||
)
|
||||
|
||||
|
||||
|
@ -41,8 +41,8 @@ _FEE_CURRENCY = _descriptor.EnumDescriptor(
|
|||
],
|
||||
containing_type=None,
|
||||
serialized_options=None,
|
||||
serialized_start=663,
|
||||
serialized_end=691,
|
||||
serialized_start=711,
|
||||
serialized_end=739,
|
||||
)
|
||||
_sym_db.RegisterEnumDescriptor(_FEE_CURRENCY)
|
||||
|
||||
|
@ -103,57 +103,57 @@ _CHANNEL = _descriptor.Descriptor(
|
|||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='title', full_name='pb.Channel.title', index=1,
|
||||
number=2, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
name='tags', full_name='pb.Channel.tags', index=1,
|
||||
number=2, type=9, cpp_type=9, label=3,
|
||||
has_default_value=False, default_value=[],
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='description', full_name='pb.Channel.description', index=2,
|
||||
name='title', full_name='pb.Channel.title', index=2,
|
||||
number=3, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='contact_email', full_name='pb.Channel.contact_email', index=3,
|
||||
name='description', full_name='pb.Channel.description', index=3,
|
||||
number=4, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='homepage_url', full_name='pb.Channel.homepage_url', index=4,
|
||||
name='thumbnail_url', full_name='pb.Channel.thumbnail_url', index=4,
|
||||
number=5, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='tags', full_name='pb.Channel.tags', index=5,
|
||||
number=6, type=9, cpp_type=9, label=3,
|
||||
has_default_value=False, default_value=[],
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='thumbnail_url', full_name='pb.Channel.thumbnail_url', index=6,
|
||||
number=16, type=9, cpp_type=9, label=1,
|
||||
name='language', full_name='pb.Channel.language', index=5,
|
||||
number=6, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='cover_url', full_name='pb.Channel.cover_url', index=7,
|
||||
number=17, type=9, cpp_type=9, label=1,
|
||||
name='contact_email', full_name='pb.Channel.contact_email', index=6,
|
||||
number=7, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='language', full_name='pb.Channel.language', index=8,
|
||||
number=18, type=9, cpp_type=9, label=1,
|
||||
name='homepage_url', full_name='pb.Channel.homepage_url', index=7,
|
||||
number=8, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='cover_url', full_name='pb.Channel.cover_url', index=8,
|
||||
number=9, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
|
@ -190,9 +190,9 @@ _STREAM = _descriptor.Descriptor(
|
|||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='language', full_name='pb.Stream.language', index=1,
|
||||
number=2, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
name='tags', full_name='pb.Stream.tags', index=1,
|
||||
number=2, type=9, cpp_type=9, label=3,
|
||||
has_default_value=False, default_value=[],
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
|
@ -204,85 +204,92 @@ _STREAM = _descriptor.Descriptor(
|
|||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='author', full_name='pb.Stream.author', index=3,
|
||||
name='description', full_name='pb.Stream.description', index=3,
|
||||
number=4, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='description', full_name='pb.Stream.description', index=4,
|
||||
name='thumbnail_url', full_name='pb.Stream.thumbnail_url', index=4,
|
||||
number=5, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='media_type', full_name='pb.Stream.media_type', index=5,
|
||||
name='language', full_name='pb.Stream.language', index=5,
|
||||
number=6, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='license', full_name='pb.Stream.license', index=6,
|
||||
name='author', full_name='pb.Stream.author', index=6,
|
||||
number=7, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='file', full_name='pb.Stream.file', index=7,
|
||||
number=8, type=11, cpp_type=10, label=1,
|
||||
name='license', full_name='pb.Stream.license', index=7,
|
||||
number=8, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='license_url', full_name='pb.Stream.license_url', index=8,
|
||||
number=9, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='release_time', full_name='pb.Stream.release_time', index=9,
|
||||
number=10, type=3, cpp_type=2, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='media_type', full_name='pb.Stream.media_type', index=10,
|
||||
number=13, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='fee', full_name='pb.Stream.fee', index=11,
|
||||
number=14, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='fee', full_name='pb.Stream.fee', index=8,
|
||||
name='file', full_name='pb.Stream.file', index=12,
|
||||
number=15, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='image', full_name='pb.Stream.image', index=13,
|
||||
number=16, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='license_url', full_name='pb.Stream.license_url', index=9,
|
||||
number=17, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='thumbnail_url', full_name='pb.Stream.thumbnail_url', index=10,
|
||||
number=18, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='duration', full_name='pb.Stream.duration', index=11,
|
||||
number=19, type=13, cpp_type=3, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='tags', full_name='pb.Stream.tags', index=12,
|
||||
number=20, type=9, cpp_type=9, label=3,
|
||||
has_default_value=False, default_value=[],
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='release_time', full_name='pb.Stream.release_time', index=13,
|
||||
number=21, type=3, cpp_type=2, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='video', full_name='pb.Stream.video', index=14,
|
||||
number=22, type=11, cpp_type=10, label=1,
|
||||
number=17, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='audio', full_name='pb.Stream.audio', index=15,
|
||||
number=18, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
|
@ -298,9 +305,12 @@ _STREAM = _descriptor.Descriptor(
|
|||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
_descriptor.OneofDescriptor(
|
||||
name='type', full_name='pb.Stream.type',
|
||||
index=0, containing_type=None, fields=[]),
|
||||
],
|
||||
serialized_start=286,
|
||||
serialized_end=585,
|
||||
serialized_end=633,
|
||||
)
|
||||
|
||||
|
||||
|
@ -345,8 +355,8 @@ _FEE = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=587,
|
||||
serialized_end=691,
|
||||
serialized_start=635,
|
||||
serialized_end=739,
|
||||
)
|
||||
|
||||
|
||||
|
@ -383,8 +393,46 @@ _FILE = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=693,
|
||||
serialized_end=727,
|
||||
serialized_start=741,
|
||||
serialized_end=775,
|
||||
)
|
||||
|
||||
|
||||
_IMAGE = _descriptor.Descriptor(
|
||||
name='Image',
|
||||
full_name='pb.Image',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='width', full_name='pb.Image.width', index=0,
|
||||
number=1, type=13, cpp_type=3, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='height', full_name='pb.Image.height', index=1,
|
||||
number=2, type=13, cpp_type=3, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=777,
|
||||
serialized_end=815,
|
||||
)
|
||||
|
||||
|
||||
|
@ -409,6 +457,13 @@ _VIDEO = _descriptor.Descriptor(
|
|||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='duration', full_name='pb.Video.duration', index=2,
|
||||
number=3, type=13, cpp_type=3, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
|
@ -421,8 +476,39 @@ _VIDEO = _descriptor.Descriptor(
|
|||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=729,
|
||||
serialized_end=767,
|
||||
serialized_start=817,
|
||||
serialized_end=873,
|
||||
)
|
||||
|
||||
|
||||
_AUDIO = _descriptor.Descriptor(
|
||||
name='Audio',
|
||||
full_name='pb.Audio',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='duration', full_name='pb.Audio.duration', index=0,
|
||||
number=1, type=13, cpp_type=3, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=875,
|
||||
serialized_end=900,
|
||||
)
|
||||
|
||||
_CLAIM.fields_by_name['stream'].message_type = _STREAM
|
||||
|
@ -433,9 +519,20 @@ _CLAIM.fields_by_name['stream'].containing_oneof = _CLAIM.oneofs_by_name['type']
|
|||
_CLAIM.oneofs_by_name['type'].fields.append(
|
||||
_CLAIM.fields_by_name['channel'])
|
||||
_CLAIM.fields_by_name['channel'].containing_oneof = _CLAIM.oneofs_by_name['type']
|
||||
_STREAM.fields_by_name['file'].message_type = _FILE
|
||||
_STREAM.fields_by_name['fee'].message_type = _FEE
|
||||
_STREAM.fields_by_name['file'].message_type = _FILE
|
||||
_STREAM.fields_by_name['image'].message_type = _IMAGE
|
||||
_STREAM.fields_by_name['video'].message_type = _VIDEO
|
||||
_STREAM.fields_by_name['audio'].message_type = _AUDIO
|
||||
_STREAM.oneofs_by_name['type'].fields.append(
|
||||
_STREAM.fields_by_name['image'])
|
||||
_STREAM.fields_by_name['image'].containing_oneof = _STREAM.oneofs_by_name['type']
|
||||
_STREAM.oneofs_by_name['type'].fields.append(
|
||||
_STREAM.fields_by_name['video'])
|
||||
_STREAM.fields_by_name['video'].containing_oneof = _STREAM.oneofs_by_name['type']
|
||||
_STREAM.oneofs_by_name['type'].fields.append(
|
||||
_STREAM.fields_by_name['audio'])
|
||||
_STREAM.fields_by_name['audio'].containing_oneof = _STREAM.oneofs_by_name['type']
|
||||
_FEE.fields_by_name['currency'].enum_type = _FEE_CURRENCY
|
||||
_FEE_CURRENCY.containing_type = _FEE
|
||||
DESCRIPTOR.message_types_by_name['Claim'] = _CLAIM
|
||||
|
@ -443,7 +540,9 @@ DESCRIPTOR.message_types_by_name['Channel'] = _CHANNEL
|
|||
DESCRIPTOR.message_types_by_name['Stream'] = _STREAM
|
||||
DESCRIPTOR.message_types_by_name['Fee'] = _FEE
|
||||
DESCRIPTOR.message_types_by_name['File'] = _FILE
|
||||
DESCRIPTOR.message_types_by_name['Image'] = _IMAGE
|
||||
DESCRIPTOR.message_types_by_name['Video'] = _VIDEO
|
||||
DESCRIPTOR.message_types_by_name['Audio'] = _AUDIO
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
Claim = _reflection.GeneratedProtocolMessageType('Claim', (_message.Message,), dict(
|
||||
|
@ -481,6 +580,13 @@ File = _reflection.GeneratedProtocolMessageType('File', (_message.Message,), dic
|
|||
))
|
||||
_sym_db.RegisterMessage(File)
|
||||
|
||||
Image = _reflection.GeneratedProtocolMessageType('Image', (_message.Message,), dict(
|
||||
DESCRIPTOR = _IMAGE,
|
||||
__module__ = 'claim_pb2'
|
||||
# @@protoc_insertion_point(class_scope:pb.Image)
|
||||
))
|
||||
_sym_db.RegisterMessage(Image)
|
||||
|
||||
Video = _reflection.GeneratedProtocolMessageType('Video', (_message.Message,), dict(
|
||||
DESCRIPTOR = _VIDEO,
|
||||
__module__ = 'claim_pb2'
|
||||
|
@ -488,5 +594,12 @@ Video = _reflection.GeneratedProtocolMessageType('Video', (_message.Message,), d
|
|||
))
|
||||
_sym_db.RegisterMessage(Video)
|
||||
|
||||
Audio = _reflection.GeneratedProtocolMessageType('Audio', (_message.Message,), dict(
|
||||
DESCRIPTOR = _AUDIO,
|
||||
__module__ = 'claim_pb2'
|
||||
# @@protoc_insertion_point(class_scope:pb.Audio)
|
||||
))
|
||||
_sym_db.RegisterMessage(Audio)
|
||||
|
||||
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
|
|
|
@ -69,14 +69,14 @@ class ChannelCommands(CommandTestCase):
|
|||
|
||||
async def test_setting_channel_fields(self):
|
||||
values = {
|
||||
'tags': ["cool", "awesome"],
|
||||
'title': "Cool Channel",
|
||||
'description': "Best channel on LBRY.",
|
||||
'contact_email': "human@email.com",
|
||||
'tags': ["cool", "awesome"],
|
||||
'cover_url': "https://co.ol/cover.png",
|
||||
'homepage_url': "https://co.ol",
|
||||
'thumbnail_url': "https://co.ol/thumbnail.png",
|
||||
'language': "en"
|
||||
'language': "en",
|
||||
'contact_email': "human@email.com",
|
||||
'homepage_url': "https://co.ol",
|
||||
'cover_url': "https://co.ol/cover.png",
|
||||
}
|
||||
|
||||
# create new channel with all fields set
|
||||
|
@ -333,18 +333,21 @@ class ClaimCommands(CommandTestCase):
|
|||
|
||||
async def test_setting_claim_fields(self):
|
||||
values = {
|
||||
'tags': ["cool", "awesome"],
|
||||
'title': "Cool Content",
|
||||
'description': "Best content on LBRY.",
|
||||
'author': "Jules Verne",
|
||||
'thumbnail_url': "https://co.ol/thumbnail.png",
|
||||
'language': "en",
|
||||
'tags': ["cool", "awesome"],
|
||||
|
||||
'author': "Jules Verne",
|
||||
'license': 'Public Domain',
|
||||
'license_url': "https://co.ol/license",
|
||||
'release_time': 123456,
|
||||
|
||||
'fee_currency': 'usd',
|
||||
'fee_amount': '2.99',
|
||||
'fee_address': 'mmCsWAiXMUVecFQ3fVzUwvpT9XFMXno2Ca',
|
||||
'license_url': "https://co.ol/license",
|
||||
'thumbnail_url': "https://co.ol/thumbnail.png",
|
||||
'release_time': 123456,
|
||||
|
||||
'video_width': 800,
|
||||
'video_height': 600
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue