Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add VOD Support #465

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ type Config struct {
type Streamer struct {
User string `yaml:"name"`
Quality string `yaml:"quality"`
VOD bool `yaml:"vod"`
}
63 changes: 38 additions & 25 deletions stream_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def __init__(self, channel):
channel: A grpc.Channel.
"""
self.GetStream = channel.unary_unary(
'/protos.Stream/GetStream',
request_serializer=stream__pb2.StreamInfo.SerializeToString,
response_deserializer=stream__pb2.StreamResponse.FromString,
)
"/protos.Stream/GetStream",
request_serializer=stream__pb2.StreamInfo.SerializeToString,
response_deserializer=stream__pb2.StreamResponse.FromString,
)


class StreamServicer(object):
Expand All @@ -27,40 +27,53 @@ class StreamServicer(object):
def GetStream(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")


def add_StreamServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetStream': grpc.unary_unary_rpc_method_handler(
servicer.GetStream,
request_deserializer=stream__pb2.StreamInfo.FromString,
response_serializer=stream__pb2.StreamResponse.SerializeToString,
),
"GetStream": grpc.unary_unary_rpc_method_handler(
servicer.GetStream,
request_deserializer=stream__pb2.StreamInfo.FromString,
response_serializer=stream__pb2.StreamResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'protos.Stream', rpc_method_handlers)
"protos.Stream", rpc_method_handlers
)
server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
# This class is part of an EXPERIMENTAL API.
class Stream(object):
"""Missing associated documentation comment in .proto file."""

@staticmethod
def GetStream(request,
def GetStream(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/protos.Stream/GetStream',
"/protos.Stream/GetStream",
stream__pb2.StreamInfo.SerializeToString,
stream__pb2.StreamResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)
2 changes: 1 addition & 1 deletion streamdl_proto_srv.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ def get_stream(r):
if __name__ == "__main__":
try:
serve()
except KeyboardInterrupt as e:
except KeyboardInterrupt:
print("\nClosing Due To Keyboard Interrupt...")