Skip to content

Commit c240c97

Browse files
committed
fix(generate-proto): Use forceLong=string option
Noticed YouTube returning very large int64 values, causing the protobuf library to throw.
1 parent 4d0a4a0 commit c240c97

20 files changed

Lines changed: 211 additions & 341 deletions

dev-scripts/generate-proto.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if (!protoFiles.length) {
4545
}
4646

4747
protoFiles.forEach((file) => {
48-
const command = `protoc --proto_path=${protoDir} --plugin=protoc-gen-ts=${protocGenTs} --ts_opt=env=browser --ts_opt=importSuffix=.js --ts_out=${outDir} --ts_opt=outputJsonMethods=false --ts_opt=outputPartialMethods=false --ts_opt=removeEnumPrefix=true ${file}`;
48+
const command = `protoc --proto_path=${protoDir} --plugin=protoc-gen-ts=${protocGenTs} --ts_opt=env=browser --ts_opt=forceLong=string --ts_opt=importSuffix=.js --ts_out=${outDir} --ts_opt=outputJsonMethods=false --ts_opt=outputPartialMethods=false --ts_opt=removeEnumPrefix=true ${file}`;
4949
exec(command, (error, _stdout, stderr) => {
5050
if (error) {
5151
console.error(`Error compiling ${file}:`, stderr);

protos/generated/misc/common.ts

Lines changed: 4 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/generated/video_streaming/buffered_range.ts

Lines changed: 12 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)