def GetYoutubePlaylistRPC(self, request, context): youtubeprovider = YoutubeProvider() try: res = youtubeprovider.getPlaylistItems(request) return ct_pb2.JsonString(json=res) except InvalidPlaylistInfoException as e: context.set_code(grpc.StatusCode.INVALID_ARGUMENT) context.set_details(e.message) return ct_pb2.JsonString()
def GetKalturaChannelEntriesRPC(self, request, context): kalturaprovider = KalturaProvider() try: res = kalturaprovider.getPlaylistItems(request) return ct_pb2.JsonString(json=res) except InvalidPlaylistInfoException as e: context.set_code(grpc.StatusCode.INVALID_ARGUMENT) context.set_details(e.message) return ct_pb2.JsonString()
def GetScenesRPC(self, request, context): res = scenedetector.find_scenes(request.filePath) return ct_pb2.JsonString(json=res)
def GetMediaInfoRPC(self, request, context): result = LogWorker(f"GetMediaInfo({request.filePath})", lambda: ffmpeg.getMediaInfo(request.filePath)) return ct_pb2.JsonString(json=result)