mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-03 09:35:05 +00:00
chore: update comment action protobuf schemas
This commit is contained in:
@@ -161,25 +161,23 @@ class Proto {
|
||||
* @returns {string}
|
||||
*/
|
||||
static encodeCommentActionParams(type, args = {}) {
|
||||
const data = {
|
||||
type,
|
||||
comment_id: args.comment_id,
|
||||
video_id: args.video_id,
|
||||
|
||||
/* Maybe these can be safely removed? */
|
||||
unk_num: 2, unk_num_1: 0, unk_num_2: 0,
|
||||
unk_num_3: "0", unk_num_4: 0,
|
||||
unk_num_5: 12, unk_num_6: 0,
|
||||
}
|
||||
const data = {};
|
||||
|
||||
data.type = type;
|
||||
data.video_id = args.video_id || '';
|
||||
data.comment_id = args.comment_id || '';
|
||||
data.unk_num = 2;
|
||||
|
||||
if (args.hasOwnProperty('text')) {
|
||||
args.comment_id && (delete data.unk_num);
|
||||
|
||||
data.translate_comment_params = {
|
||||
params: {
|
||||
comment: {
|
||||
text: args.text
|
||||
}
|
||||
},
|
||||
comment_id: args.comment_id,
|
||||
comment_id: args.comment_id || '',
|
||||
target_language: args.target_language
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2329,10 +2329,6 @@ function definePeformCommentActionParams () {
|
||||
var len = encodings.int32.encodingLength(obj.type)
|
||||
length += 1 + len
|
||||
}
|
||||
if (defined(obj.unk_num)) {
|
||||
var len = encodings.int32.encodingLength(obj.unk_num)
|
||||
length += 1 + len
|
||||
}
|
||||
if (defined(obj.comment_id)) {
|
||||
var len = encodings.string.encodingLength(obj.comment_id)
|
||||
length += 1 + len
|
||||
@@ -2341,34 +2337,14 @@ function definePeformCommentActionParams () {
|
||||
var len = encodings.string.encodingLength(obj.video_id)
|
||||
length += 1 + len
|
||||
}
|
||||
if (defined(obj.unk_num_1)) {
|
||||
var len = encodings.int32.encodingLength(obj.unk_num_1)
|
||||
if (defined(obj.unk_num)) {
|
||||
var len = encodings.int32.encodingLength(obj.unk_num)
|
||||
length += 1 + len
|
||||
}
|
||||
if (defined(obj.unk_num_2)) {
|
||||
var len = encodings.int32.encodingLength(obj.unk_num_2)
|
||||
length += 1 + len
|
||||
}
|
||||
if (defined(obj.unk_num_3)) {
|
||||
var len = encodings.string.encodingLength(obj.unk_num_3)
|
||||
length += 1 + len
|
||||
}
|
||||
if (defined(obj.unk_num_4)) {
|
||||
var len = encodings.int32.encodingLength(obj.unk_num_4)
|
||||
length += 1 + len
|
||||
}
|
||||
if (defined(obj.unk_num_5)) {
|
||||
var len = encodings.int32.encodingLength(obj.unk_num_5)
|
||||
length += 2 + len
|
||||
}
|
||||
if (defined(obj.channel_id)) {
|
||||
var len = encodings.string.encodingLength(obj.channel_id)
|
||||
length += 2 + len
|
||||
}
|
||||
if (defined(obj.unk_num_6)) {
|
||||
var len = encodings.int32.encodingLength(obj.unk_num_6)
|
||||
length += 2 + len
|
||||
}
|
||||
if (defined(obj.translate_comment_params)) {
|
||||
var len = TranslateCommentParams.encodingLength(obj.translate_comment_params)
|
||||
length += varint.encodingLength(len)
|
||||
@@ -2386,11 +2362,6 @@ function definePeformCommentActionParams () {
|
||||
encodings.int32.encode(obj.type, buf, offset)
|
||||
offset += encodings.int32.encode.bytes
|
||||
}
|
||||
if (defined(obj.unk_num)) {
|
||||
buf[offset++] = 16
|
||||
encodings.int32.encode(obj.unk_num, buf, offset)
|
||||
offset += encodings.int32.encode.bytes
|
||||
}
|
||||
if (defined(obj.comment_id)) {
|
||||
buf[offset++] = 26
|
||||
encodings.string.encode(obj.comment_id, buf, offset)
|
||||
@@ -2401,30 +2372,9 @@ function definePeformCommentActionParams () {
|
||||
encodings.string.encode(obj.video_id, buf, offset)
|
||||
offset += encodings.string.encode.bytes
|
||||
}
|
||||
if (defined(obj.unk_num_1)) {
|
||||
buf[offset++] = 48
|
||||
encodings.int32.encode(obj.unk_num_1, buf, offset)
|
||||
offset += encodings.int32.encode.bytes
|
||||
}
|
||||
if (defined(obj.unk_num_2)) {
|
||||
buf[offset++] = 56
|
||||
encodings.int32.encode(obj.unk_num_2, buf, offset)
|
||||
offset += encodings.int32.encode.bytes
|
||||
}
|
||||
if (defined(obj.unk_num_3)) {
|
||||
buf[offset++] = 74
|
||||
encodings.string.encode(obj.unk_num_3, buf, offset)
|
||||
offset += encodings.string.encode.bytes
|
||||
}
|
||||
if (defined(obj.unk_num_4)) {
|
||||
buf[offset++] = 80
|
||||
encodings.int32.encode(obj.unk_num_4, buf, offset)
|
||||
offset += encodings.int32.encode.bytes
|
||||
}
|
||||
if (defined(obj.unk_num_5)) {
|
||||
buf[offset++] = 168
|
||||
buf[offset++] = 1
|
||||
encodings.int32.encode(obj.unk_num_5, buf, offset)
|
||||
if (defined(obj.unk_num)) {
|
||||
buf[offset++] = 16
|
||||
encodings.int32.encode(obj.unk_num, buf, offset)
|
||||
offset += encodings.int32.encode.bytes
|
||||
}
|
||||
if (defined(obj.channel_id)) {
|
||||
@@ -2433,12 +2383,6 @@ function definePeformCommentActionParams () {
|
||||
encodings.string.encode(obj.channel_id, buf, offset)
|
||||
offset += encodings.string.encode.bytes
|
||||
}
|
||||
if (defined(obj.unk_num_6)) {
|
||||
buf[offset++] = 240
|
||||
buf[offset++] = 1
|
||||
encodings.int32.encode(obj.unk_num_6, buf, offset)
|
||||
offset += encodings.int32.encode.bytes
|
||||
}
|
||||
if (defined(obj.translate_comment_params)) {
|
||||
buf[offset++] = 250
|
||||
buf[offset++] = 1
|
||||
@@ -2458,16 +2402,10 @@ function definePeformCommentActionParams () {
|
||||
var oldOffset = offset
|
||||
var obj = {
|
||||
type: 0,
|
||||
unk_num: 0,
|
||||
comment_id: "",
|
||||
video_id: "",
|
||||
unk_num_1: 0,
|
||||
unk_num_2: 0,
|
||||
unk_num_3: "",
|
||||
unk_num_4: 0,
|
||||
unk_num_5: 0,
|
||||
unk_num: 0,
|
||||
channel_id: "",
|
||||
unk_num_6: 0,
|
||||
translate_comment_params: null
|
||||
}
|
||||
while (true) {
|
||||
@@ -2483,10 +2421,6 @@ function definePeformCommentActionParams () {
|
||||
obj.type = encodings.int32.decode(buf, offset)
|
||||
offset += encodings.int32.decode.bytes
|
||||
break
|
||||
case 2:
|
||||
obj.unk_num = encodings.int32.decode(buf, offset)
|
||||
offset += encodings.int32.decode.bytes
|
||||
break
|
||||
case 3:
|
||||
obj.comment_id = encodings.string.decode(buf, offset)
|
||||
offset += encodings.string.decode.bytes
|
||||
@@ -2495,34 +2429,14 @@ function definePeformCommentActionParams () {
|
||||
obj.video_id = encodings.string.decode(buf, offset)
|
||||
offset += encodings.string.decode.bytes
|
||||
break
|
||||
case 6:
|
||||
obj.unk_num_1 = encodings.int32.decode(buf, offset)
|
||||
offset += encodings.int32.decode.bytes
|
||||
break
|
||||
case 7:
|
||||
obj.unk_num_2 = encodings.int32.decode(buf, offset)
|
||||
offset += encodings.int32.decode.bytes
|
||||
break
|
||||
case 9:
|
||||
obj.unk_num_3 = encodings.string.decode(buf, offset)
|
||||
offset += encodings.string.decode.bytes
|
||||
break
|
||||
case 10:
|
||||
obj.unk_num_4 = encodings.int32.decode(buf, offset)
|
||||
offset += encodings.int32.decode.bytes
|
||||
break
|
||||
case 21:
|
||||
obj.unk_num_5 = encodings.int32.decode(buf, offset)
|
||||
case 2:
|
||||
obj.unk_num = encodings.int32.decode(buf, offset)
|
||||
offset += encodings.int32.decode.bytes
|
||||
break
|
||||
case 23:
|
||||
obj.channel_id = encodings.string.decode(buf, offset)
|
||||
offset += encodings.string.decode.bytes
|
||||
break
|
||||
case 30:
|
||||
obj.unk_num_6 = encodings.int32.decode(buf, offset)
|
||||
offset += encodings.int32.decode.bytes
|
||||
break
|
||||
case 31:
|
||||
var len = varint.decode(buf, offset)
|
||||
offset += varint.decode.bytes
|
||||
|
||||
@@ -135,21 +135,11 @@ message CreateCommentReplyParams {
|
||||
|
||||
message PeformCommentActionParams {
|
||||
int32 type = 1;
|
||||
optional int32 unk_num = 2;
|
||||
|
||||
string comment_id = 3;
|
||||
string video_id = 5;
|
||||
|
||||
optional int32 unk_num_1 = 6;
|
||||
optional int32 unk_num_2 = 7;
|
||||
|
||||
optional string unk_num_3 = 9;
|
||||
|
||||
optional int32 unk_num_4 = 10;
|
||||
optional int32 unk_num_5 = 21;
|
||||
|
||||
optional int32 unk_num = 2;
|
||||
optional string channel_id = 23;
|
||||
optional int32 unk_num_6 = 30;
|
||||
|
||||
message TranslateCommentParams {
|
||||
message Params {
|
||||
|
||||
Reference in New Issue
Block a user