diff options
| author | Xe Iaso <me@xeiaso.net> | 2024-02-29 22:55:03 -0500 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2024-02-29 22:55:03 -0500 |
| commit | 7854f16ef4071ef3bd2f7574a45462f53291a4be (patch) | |
| tree | d57f1d576a7078f9f055bf015ce0ab6fe2ddfc02 | |
| parent | b68809b34da8c8db0ff8861b2b70ed81665c79fe (diff) | |
| download | x-7854f16ef4071ef3bd2f7574a45462f53291a4be.tar.xz x-7854f16ef4071ef3bd2f7574a45462f53291a4be.zip | |
proto: add top-level folder for protobuf definitions
Signed-off-by: Xe Iaso <me@xeiaso.net>
| -rw-r--r-- | proto/sanguisuga.proto | 54 | ||||
| -rw-r--r-- | proto/sanguisuga/sanguisuga.pb.go | 631 | ||||
| -rw-r--r-- | proto/sanguisuga/sanguisuga.slog.go | 32 | ||||
| -rw-r--r-- | proto/sanguisuga/sanguisuga.twirp.go | 3293 | ||||
| -rw-r--r-- | proto/uplodr.proto | 27 | ||||
| -rw-r--r-- | proto/uplodr/uplodr.pb.go | 378 | ||||
| -rw-r--r-- | proto/uplodr/uplodr_grpc.pb.go | 146 | ||||
| -rw-r--r-- | proto/yeetfile.js | 36 |
8 files changed, 4597 insertions, 0 deletions
diff --git a/proto/sanguisuga.proto b/proto/sanguisuga.proto new file mode 100644 index 0000000..12a27d2 --- /dev/null +++ b/proto/sanguisuga.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; +package within.website.x.sanguisuga; +option go_package = "within.website/x/proto/sanguisuga"; + +import "google/protobuf/empty.proto"; + +message Show { + string title = 1; + string disk_path = 2; + string quality = 3; +} + +message Shows { + repeated Show shows = 1; +} + +message TVSnatch { + string category = 1; + string name = 2; + bool freeleech = 3; + string torrent_id = 4; +} + +message TVSnatches { + repeated TVSnatch snatches = 1; +} + +message AnimeSnatch { + string fname = 1; + string show_name = 2; + string episode = 3; + string resolution = 4; + string crc32 = 5; + string bot_name = 6; + string pack_id = 7; +} + +message AnimeSnatches { + repeated AnimeSnatch snatches = 1; +} + +service TV { + rpc List(google.protobuf.Empty) returns (Shows) {}; + rpc Track(Show) returns (google.protobuf.Empty) {}; + rpc Untrack(Show) returns (google.protobuf.Empty) {}; + rpc Snatches(google.protobuf.Empty) returns (TVSnatches) {}; +} + +service Anime { + rpc List(google.protobuf.Empty) returns (Shows) {}; + rpc Track(Show) returns (google.protobuf.Empty) {}; + rpc Untrack(Show) returns (google.protobuf.Empty) {}; + rpc Snatches(google.protobuf.Empty) returns (AnimeSnatches) {}; +}
\ No newline at end of file diff --git a/proto/sanguisuga/sanguisuga.pb.go b/proto/sanguisuga/sanguisuga.pb.go new file mode 100644 index 0000000..ad619a6 --- /dev/null +++ b/proto/sanguisuga/sanguisuga.pb.go @@ -0,0 +1,631 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.24.4 +// source: sanguisuga.proto + +package sanguisuga + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Show struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + DiskPath string `protobuf:"bytes,2,opt,name=disk_path,json=diskPath,proto3" json:"disk_path,omitempty"` + Quality string `protobuf:"bytes,3,opt,name=quality,proto3" json:"quality,omitempty"` +} + +func (x *Show) Reset() { + *x = Show{} + if protoimpl.UnsafeEnabled { + mi := &file_sanguisuga_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Show) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Show) ProtoMessage() {} + +func (x *Show) ProtoReflect() protoreflect.Message { + mi := &file_sanguisuga_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Show.ProtoReflect.Descriptor instead. +func (*Show) Descriptor() ([]byte, []int) { + return file_sanguisuga_proto_rawDescGZIP(), []int{0} +} + +func (x *Show) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Show) GetDiskPath() string { + if x != nil { + return x.DiskPath + } + return "" +} + +func (x *Show) GetQuality() string { + if x != nil { + return x.Quality + } + return "" +} + +type Shows struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Shows []*Show `protobuf:"bytes,1,rep,name=shows,proto3" json:"shows,omitempty"` +} + +func (x *Shows) Reset() { + *x = Shows{} + if protoimpl.UnsafeEnabled { + mi := &file_sanguisuga_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Shows) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Shows) ProtoMessage() {} + +func (x *Shows) ProtoReflect() protoreflect.Message { + mi := &file_sanguisuga_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Shows.ProtoReflect.Descriptor instead. +func (*Shows) Descriptor() ([]byte, []int) { + return file_sanguisuga_proto_rawDescGZIP(), []int{1} +} + +func (x *Shows) GetShows() []*Show { + if x != nil { + return x.Shows + } + return nil +} + +type TVSnatch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Category string `protobuf:"bytes,1,opt,name=category,proto3" json:"category,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Freeleech bool `protobuf:"varint,3,opt,name=freeleech,proto3" json:"freeleech,omitempty"` + TorrentId string `protobuf:"bytes,4,opt,name=torrent_id,json=torrentId,proto3" json:"torrent_id,omitempty"` +} + +func (x *TVSnatch) Reset() { + *x = TVSnatch{} + if protoimpl.UnsafeEnabled { + mi := &file_sanguisuga_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TVSnatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TVSnatch) ProtoMessage() {} + +func (x *TVSnatch) ProtoReflect() protoreflect.Message { + mi := &file_sanguisuga_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TVSnatch.ProtoReflect.Descriptor instead. +func (*TVSnatch) Descriptor() ([]byte, []int) { + return file_sanguisuga_proto_rawDescGZIP(), []int{2} +} + +func (x *TVSnatch) GetCategory() string { + if x != nil { + return x.Category + } + return "" +} + +func (x *TVSnatch) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *TVSnatch) GetFreeleech() bool { + if x != nil { + return x.Freeleech + } + return false +} + +func (x *TVSnatch) GetTorrentId() string { + if x != nil { + return x.TorrentId + } + return "" +} + +type TVSnatches struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Snatches []*TVSnatch `protobuf:"bytes,1,rep,name=snatches,proto3" json:"snatches,omitempty"` +} + +func (x *TVSnatches) Reset() { + *x = TVSnatches{} + if protoimpl.UnsafeEnabled { + mi := &file_sanguisuga_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TVSnatches) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TVSnatches) ProtoMessage() {} + +func (x *TVSnatches) ProtoReflect() protoreflect.Message { + mi := &file_sanguisuga_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TVSnatches.ProtoReflect.Descriptor instead. +func (*TVSnatches) Descriptor() ([]byte, []int) { + return file_sanguisuga_proto_rawDescGZIP(), []int{3} +} + +func (x *TVSnatches) GetSnatches() []*TVSnatch { + if x != nil { + return x.Snatches + } + return nil +} + +type AnimeSnatch struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Fname string `protobuf:"bytes,1,opt,name=fname,proto3" json:"fname,omitempty"` + ShowName string `protobuf:"bytes,2,opt,name=show_name,json=showName,proto3" json:"show_name,omitempty"` + Episode string `protobuf:"bytes,3,opt,name=episode,proto3" json:"episode,omitempty"` + Resolution string `protobuf:"bytes,4,opt,name=resolution,proto3" json:"resolution,omitempty"` + Crc32 string `protobuf:"bytes,5,opt,name=crc32,proto3" json:"crc32,omitempty"` + BotName string `protobuf:"bytes,6,opt,name=bot_name,json=botName,proto3" json:"bot_name,omitempty"` + PackId string `protobuf:"bytes,7,opt,name=pack_id,json=packId,proto3" json:"pack_id,omitempty"` +} + +func (x *AnimeSnatch) Reset() { + *x = AnimeSnatch{} + if protoimpl.UnsafeEnabled { + mi := &file_sanguisuga_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnimeSnatch) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnimeSnatch) ProtoMessage() {} + +func (x *AnimeSnatch) ProtoReflect() protoreflect.Message { + mi := &file_sanguisuga_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnimeSnatch.ProtoReflect.Descriptor instead. +func (*AnimeSnatch) Descriptor() ([]byte, []int) { + return file_sanguisuga_proto_rawDescGZIP(), []int{4} +} + +func (x *AnimeSnatch) GetFname() string { + if x != nil { + return x.Fname + } + return "" +} + +func (x *AnimeSnatch) GetShowName() string { + if x != nil { + return x.ShowName + } + return "" +} + +func (x *AnimeSnatch) GetEpisode() string { + if x != nil { + return x.Episode + } + return "" +} + +func (x *AnimeSnatch) GetResolution() string { + if x != nil { + return x.Resolution + } + return "" +} + +func (x *AnimeSnatch) GetCrc32() string { + if x != nil { + return x.Crc32 + } + return "" +} + +func (x *AnimeSnatch) GetBotName() string { + if x != nil { + return x.BotName + } + return "" +} + +func (x *AnimeSnatch) GetPackId() string { + if x != nil { + return x.PackId + } + return "" +} + +type AnimeSnatches struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Snatches []*AnimeSnatch `protobuf:"bytes,1,rep,name=snatches,proto3" json:"snatches,omitempty"` +} + +func (x *AnimeSnatches) Reset() { + *x = AnimeSnatches{} + if protoimpl.UnsafeEnabled { + mi := &file_sanguisuga_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnimeSnatches) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnimeSnatches) ProtoMessage() {} + +func (x *AnimeSnatches) ProtoReflect() protoreflect.Message { + mi := &file_sanguisuga_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnimeSnatches.ProtoReflect.Descriptor instead. +func (*AnimeSnatches) Descriptor() ([]byte, []int) { + return file_sanguisuga_proto_rawDescGZIP(), []int{5} +} + +func (x *AnimeSnatches) GetSnatches() []*AnimeSnatch { + if x != nil { + return x.Snatches + } + return nil +} + +var File_sanguisuga_proto protoreflect.FileDescriptor + +var file_sanguisuga_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x73, 0x61, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x1b, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, + 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x73, 0x61, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x1a, + 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x53, 0x0a, 0x04, + 0x53, 0x68, 0x6f, 0x77, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x69, + 0x73, 0x6b, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, + 0x69, 0x73, 0x6b, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, + 0x79, 0x22, 0x40, 0x0a, 0x05, 0x53, 0x68, 0x6f, 0x77, 0x73, 0x12, 0x37, 0x0a, 0x05, 0x73, 0x68, + 0x6f, 0x77, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x77, 0x69, 0x74, 0x68, + 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x73, 0x61, 0x6e, + 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x05, 0x73, 0x68, + 0x6f, 0x77, 0x73, 0x22, 0x77, 0x0a, 0x08, 0x54, 0x56, 0x53, 0x6e, 0x61, 0x74, 0x63, 0x68, 0x12, + 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x65, 0x65, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x65, 0x65, 0x63, 0x68, 0x12, 0x1d, 0x0a, + 0x0a, 0x74, 0x6f, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x74, 0x6f, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x4f, 0x0a, 0x0a, + 0x54, 0x56, 0x53, 0x6e, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x08, 0x73, 0x6e, + 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x77, + 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, + 0x73, 0x61, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, 0x54, 0x56, 0x53, 0x6e, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22, 0xc4, 0x01, + 0x0a, 0x0b, 0x41, 0x6e, 0x69, 0x6d, 0x65, 0x53, 0x6e, 0x61, 0x74, 0x63, 0x68, 0x12, 0x14, 0x0a, + 0x05, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, + 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x72, + 0x63, 0x33, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x72, 0x63, 0x33, 0x32, + 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6f, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x62, 0x6f, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, + 0x61, 0x63, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, + 0x63, 0x6b, 0x49, 0x64, 0x22, 0x55, 0x0a, 0x0d, 0x41, 0x6e, 0x69, 0x6d, 0x65, 0x53, 0x6e, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x08, 0x73, 0x6e, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, + 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x73, 0x61, 0x6e, 0x67, 0x75, + 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, 0x41, 0x6e, 0x69, 0x6d, 0x65, 0x53, 0x6e, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x32, 0xa7, 0x02, 0x0a, 0x02, + 0x54, 0x56, 0x12, 0x44, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x22, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, + 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x73, 0x61, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, + 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x73, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, + 0x6b, 0x12, 0x21, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, + 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x73, 0x61, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, + 0x53, 0x68, 0x6f, 0x77, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x46, + 0x0a, 0x07, 0x55, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x21, 0x2e, 0x77, 0x69, 0x74, 0x68, + 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x73, 0x61, 0x6e, + 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x74, 0x63, 0x68, + 0x65, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x27, 0x2e, 0x77, 0x69, 0x74, + 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x73, 0x61, + 0x6e, 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, 0x54, 0x56, 0x53, 0x6e, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x73, 0x22, 0x00, 0x32, 0xad, 0x02, 0x0a, 0x05, 0x41, 0x6e, 0x69, 0x6d, 0x65, 0x12, + 0x44, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x22, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, + 0x2e, 0x78, 0x2e, 0x73, 0x61, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, 0x53, 0x68, + 0x6f, 0x77, 0x73, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x21, + 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, + 0x78, 0x2e, 0x73, 0x61, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, 0x53, 0x68, 0x6f, + 0x77, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x07, 0x55, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x21, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, + 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x73, 0x61, 0x6e, 0x67, 0x75, 0x69, + 0x73, 0x75, 0x67, 0x61, 0x2e, 0x53, 0x68, 0x6f, 0x77, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2a, 0x2e, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, + 0x2e, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2e, 0x78, 0x2e, 0x73, 0x61, 0x6e, 0x67, 0x75, + 0x69, 0x73, 0x75, 0x67, 0x61, 0x2e, 0x41, 0x6e, 0x69, 0x6d, 0x65, 0x53, 0x6e, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x73, 0x22, 0x00, 0x42, 0x23, 0x5a, 0x21, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x2e, + 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x2f, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x73, 0x61, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x75, 0x67, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_sanguisuga_proto_rawDescOnce sync.Once + file_sanguisuga_proto_rawDescData = file_sanguisuga_proto_rawDesc +) + +func file_sanguisuga_proto_rawDescGZIP() []byte { + file_sanguisuga_proto_rawDescOnce.Do(func() { + file_sanguisuga_proto_rawDescData = protoimpl.X.CompressGZIP(file_sanguisuga_proto_rawDescData) + }) + return file_sanguisuga_proto_rawDescData +} + +var file_sanguisuga_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_sanguisuga_proto_goTypes = []interface{}{ + (*Show)(nil), // 0: within.website.x.sanguisuga.Show + (*Shows)(nil), // 1: within.website.x.sanguisuga.Shows + (*TVSnatch)(nil), // 2: within.website.x.sanguisuga.TVSnatch + (*TVSnatches)(nil), // 3: within.website.x.sanguisuga.TVSnatches + (*AnimeSnatch)(nil), // 4: within.website.x.sanguisuga.AnimeSnatch + (*AnimeSnatches)(nil), // 5: within.website.x.sanguisuga.AnimeSnatches + (*emptypb.Empty)(nil), // 6: google.protobuf.Empty +} +var file_sanguisuga_proto_depIdxs = []int32{ + 0, // 0: within.website.x.sanguisuga.Shows.shows:type_name -> within.website.x.sanguisuga.Show + 2, // 1: within.website.x.sanguisuga.TVSnatches.snatches:type_name -> within.website.x.sanguisuga.TVSnatch + 4, // 2: within.website.x.sanguisuga.AnimeSnatches.snatches:type_name -> within.website.x.sanguisuga.AnimeSnatch + 6, // 3: within.website.x.sanguisuga.TV.List:input_type -> google.protobuf.Empty + 0, // 4: within.website.x.sanguisuga.TV.Track:input_type -> within.website.x.sanguisuga.Show + 0, // 5: within.website.x.sanguisuga.TV.Untrack:input_type -> within.website.x.sanguisuga.Show + 6, // 6: within.website.x.sanguisuga.TV.Snatches:input_type -> google.protobuf.Empty + 6, // 7: within.website.x.sanguisuga.Anime.List:input_type -> google.protobuf.Empty + 0, // 8: within.website.x.sanguisuga.Anime.Track:input_type -> within.website.x.sanguisuga.Show + 0, // 9: within.website.x.sanguisuga.Anime.Untrack:input_type -> within.website.x.sanguisuga.Show + 6, // 10: within.website.x.sanguisuga.Anime.Snatches:input_type -> google.protobuf.Empty + 1, // 11: within.website.x.sanguisuga.TV.List:output_type -> within.website.x.sanguisuga.Shows + 6, // 12: within.website.x.sanguisuga.TV.Track:output_type -> google.protobuf.Empty + 6, // 13: within.website.x.sanguisuga.TV.Untrack:output_type -> google.protobuf.Empty + 3, // 14: within.website.x.sanguisuga.TV.Snatches:output_type -> within.website.x.sanguisuga.TVSnatches + 1, // 15: within.website.x.sanguisuga.Anime.List:output_type -> within.website.x.sanguisuga.Shows + 6, // 16: within.website.x.sanguisuga.Anime.Track:output_type -> google.protobuf.Empty + 6, // 17: within.website.x.sanguisuga.Anime.Untrack:output_type -> google.protobuf.Empty + 5, // 18: within.website.x.sanguisuga.Anime.Snatches:output_type -> within.website.x.sanguisuga.AnimeSnatches + 11, // [11:19] is the sub-list for method output_type + 3, // [3:11] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_sanguisuga_proto_init() } +func file_sanguisuga_proto_init() { + if File_sanguisuga_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sanguisuga_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Show); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sanguisuga_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Shows); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sanguisuga_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TVSnatch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sanguisuga_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TVSnatches); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sanguisuga_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnimeSnatch); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sanguisuga_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnimeSnatches); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sanguisuga_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_sanguisuga_proto_goTypes, + DependencyIndexes: file_sanguisuga_proto_depIdxs, + MessageInfos: file_sanguisuga_proto_msgTypes, + }.Build() + File_sanguisuga_proto = out.File + file_sanguisuga_proto_rawDesc = nil + file_sanguisuga_proto_goTypes = nil + file_sanguisuga_proto_depIdxs = nil +} diff --git a/proto/sanguisuga/sanguisuga.slog.go b/proto/sanguisuga/sanguisuga.slog.go new file mode 100644 index 0000000..79a899c --- /dev/null +++ b/proto/sanguisuga/sanguisuga.slog.go @@ -0,0 +1,32 @@ +package sanguisuga + +import "log/slog" + +func (s *Show) LogValue() slog.Value { + return slog.GroupValue( + slog.String("title", s.GetTitle()), + slog.String("disk_path", s.GetDiskPath()), + slog.String("quality", s.GetQuality()), + ) +} + +func (tvs *TVSnatch) LogValue() slog.Value { + return slog.GroupValue( + slog.String("category", tvs.GetCategory()), + slog.String("name", tvs.GetName()), + slog.Bool("freeleech", tvs.GetFreeleech()), + slog.String("torrent_id", tvs.GetTorrentId()), + ) +} + +func (as *AnimeSnatch) LogValue() slog.Value { + return slog.GroupValue( + slog.String("fname", as.GetFname()), + slog.String("show_name", as.GetShowName()), + slog.String("episode", as.GetEpisode()), + slog.String("resolution", as.GetResolution()), + slog.String("crc32", as.GetCrc32()), + slog.String("bot_name", as.GetBotName()), + slog.String("pack_id", as.GetPackId()), + ) +} diff --git a/proto/sanguisuga/sanguisuga.twirp.go b/proto/sanguisuga/sanguisuga.twirp.go new file mode 100644 index 0000000..3f43cb2 --- /dev/null +++ b/proto/sanguisuga/sanguisuga.twirp.go @@ -0,0 +1,3293 @@ +// Code generated by protoc-gen-twirp v8.1.3, DO NOT EDIT. +// source: sanguisuga.proto + +package sanguisuga + +import context "context" +import fmt "fmt" +import http "net/http" +import io "io" +import json "encoding/json" +import strconv "strconv" +import strings "strings" + +import protojson "google.golang.org/protobuf/encoding/protojson" +import proto "google.golang.org/protobuf/proto" +import twirp "github.com/twitchtv/twirp" +import ctxsetters "github.com/twitchtv/twirp/ctxsetters" + +import google_protobuf "google.golang.org/protobuf/types/known/emptypb" + +import bytes "bytes" +import errors "errors" +import path "path" +import url "net/url" + +// Version compatibility assertion. +// If the constant is not defined in the package, that likely means +// the package needs to be updated to work with this generated code. +// See https://twitchtv.github.io/twirp/docs/version_matrix.html +const _ = twirp.TwirpPackageMinVersion_8_1_0 + +// ============ +// TV Interface +// ============ + +type TV interface { + List(context.Context, *google_protobuf.Empty) (*Shows, error) + + Track(context.Context, *Show) (*google_protobuf.Empty, error) + + Untrack(context.Context, *Show) (*google_protobuf.Empty, error) + + Snatches(context.Context, *google_protobuf.Empty) (*TVSnatches, error) +} + +// ================== +// TV Protobuf Client +// ================== + +type tVProtobufClient struct { + client HTTPClient + urls [4]string + interceptor twirp.Interceptor + opts twirp.ClientOptions +} + +// NewTVProtobufClient creates a Protobuf client that implements the TV interface. +// It communicates using Protobuf and can be configured with a custom HTTPClient. +func NewTVProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) TV { + if c, ok := client.(*http.Client); ok { + client = withoutRedirects(c) + } + + clientOpts := twirp.ClientOptions{} + for _, o := range opts { + o(&clientOpts) + } + + // Using ReadOpt allows backwards and forwards compatibility with new options in the future + literalURLs := false + _ = clientOpts.ReadOpt("literalURLs", &literalURLs) + var pathPrefix string + if ok := clientOpts.ReadOpt("pathPrefix", &pathPrefix); !ok { + pathPrefix = "/twirp" // default prefix + } + + // Build method URLs: <baseURL>[<prefix>]/<package>.<Service>/<Method> + serviceURL := sanitizeBaseURL(baseURL) + serviceURL += baseServicePath(pathPrefix, "within.website.x.sanguisuga", "TV") + urls := [4]string{ + serviceURL + "List", + serviceURL + "Track", + serviceURL + "Untrack", + serviceURL + "Snatches", + } + + return &tVProtobufClient{ + client: client, + urls: urls, + interceptor: twirp.ChainInterceptors(clientOpts.Interceptors...), + opts: clientOpts, + } +} + +func (c *tVProtobufClient) List(ctx context.Context, in *google_protobuf.Empty) (*Shows, error) { + ctx = ctxsetters.WithPackageName(ctx, "within.website.x.sanguisuga") + ctx = ctxsetters.WithServiceName(ctx, "TV") + ctx = ctxsetters.WithMethodName(ctx, "List") + caller := c.callList + if c.interceptor != nil { + caller = func(ctx context.Context, req *google_protobuf.Empty) (*Shows, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*google_protobuf.Empty) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*google_protobuf.Empty) when calling interceptor") + } + return c.callList(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*Shows) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*Shows) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *tVProtobufClient) callList(ctx context.Context, in *google_protobuf.Empty) (*Shows, error) { + out := new(Shows) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[0], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *tVProtobufClient) Track(ctx context.Context, in *Show) (*google_protobuf.Empty, error) { + ctx = ctxsetters.WithPackageName(ctx, "within.website.x.sanguisuga") + ctx = ctxsetters.WithServiceName(ctx, "TV") + ctx = ctxsetters.WithMethodName(ctx, "Track") + caller := c.callTrack + if c.interceptor != nil { + caller = func(ctx context.Context, req *Show) (*google_protobuf.Empty, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*Show) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*Show) when calling interceptor") + } + return c.callTrack(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*google_protobuf.Empty) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*google_protobuf.Empty) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *tVProtobufClient) callTrack(ctx context.Context, in *Show) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[1], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *tVProtobufClient) Untrack(ctx context.Context, in *Show) (*google_protobuf.Empty, error) { + ctx = ctxsetters.WithPackageName(ctx, "within.website.x.sanguisuga") + ctx = ctxsetters.WithServiceName(ctx, "TV") + ctx = ctxsetters.WithMethodName(ctx, "Untrack") + caller := c.callUntrack + if c.interceptor != nil { + caller = func(ctx context.Context, req *Show) (*google_protobuf.Empty, error) { + resp, err := c.interceptor( + func(ctx context.Context, req interface{}) (interface{}, error) { + typedReq, ok := req.(*Show) + if !ok { + return nil, twirp.InternalError("failed type assertion req.(*Show) when calling interceptor") + } + return c.callUntrack(ctx, typedReq) + }, + )(ctx, req) + if resp != nil { + typedResp, ok := resp.(*google_protobuf.Empty) + if !ok { + return nil, twirp.InternalError("failed type assertion resp.(*google_protobuf.Empty) when calling interceptor") + } + return typedResp, err + } + return nil, err + } + } + return caller(ctx, in) +} + +func (c *tVProtobufClient) callUntrack(ctx context.Context, in *Show) (*google_protobuf.Empty, error) { + out := new(google_protobuf.Empty) + ctx, err := doProtobufRequest(ctx, c.client, c.opts.Hooks, c.urls[2], in, out) + if err != nil { + twerr, ok := err.(twirp.Error) + if !ok { + twerr = twirp.InternalErrorWith(err) + } + callClientError(ctx, c.opts.Hooks, twerr) + return nil, err + } + + callClientResponseReceived(ctx, c.opts.Hooks) + + return out, nil +} + +func (c *tVProtobufClient) Snatches(ctx context.Context, in *google_protobuf.Empty) (*TVSnatches, error) { + ctx = ctxsetters.WithPackageName(ctx, "within.website.x.sanguisuga") + ctx = ctxsetters.WithServiceName(ctx, "TV") + ctx = ctxsetters.WithMethodName(ctx, "Snatches") + caller := c.callSnatches + if c.interceptor != nil { + caller = func(ctx context.Context, req *google_protobuf.Empty) (*TVSnatches, error) { + resp, err := c.inte |
