diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26f8db4..f5c94b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@main with: submodules: recursive - #token: ${{ secrets.SUBMODULE_TOKEN }} + token: ${{ secrets.SUBMODULE_TOKEN }} - name: Set up Node.js uses: actions/setup-node@main with: diff --git a/.gitmodules b/.gitmodules index 868a2ec..6ec9c63 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "src/utils"] path = src/utils url = https://github.com/NanoCat-Me/utils.git +[submodule "src/protobuf"] + path = src/protobuf + url = https://github.com/DualSubs/protobuf.git diff --git a/package-lock.json b/package-lock.json index c9e7ea4..d661b23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,13 @@ { "name": "@dualsubs/youtube", - "version": "1.5.2", + "version": "1.5.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dualsubs/youtube", - "version": "1.5.2", + "version": "1.5.3", + "license": "Apache-2.0", "devDependencies": { "@iringo/arguments-builder": "^1.7.4", "@iringo/sgmoudle-tools": "^1.2.1", diff --git a/src/protobuf b/src/protobuf new file mode 160000 index 0000000..3381046 --- /dev/null +++ b/src/protobuf @@ -0,0 +1 @@ +Subproject commit 3381046ed9e3099c9aa9eb323c3be1870ce6d7ce diff --git a/src/protobuf/browse.request.d.ts b/src/protobuf/browse.request.d.ts deleted file mode 100644 index 7b468f0..0000000 --- a/src/protobuf/browse.request.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -// @generated by protobuf-ts 2.9.1 with parameter long_type_string,output_javascript,optimize_code_size -// @generated from protobuf file "browse.request.proto" (syntax proto3) -// tslint:disable -import { MessageType } from "@protobuf-ts/runtime"; -/** - * https://youtubei.googleapis.com/youtubei/v1/browse - * - * @generated from protobuf message Browse - */ -export interface Browse { - /** - * @generated from protobuf field: Context context = 1; - */ - context?: Context; - /** - * @generated from protobuf field: string browseId = 2; - */ - browseId: string; -} -/** - * @generated from protobuf message Context - */ -export interface Context { - /** - * @generated from protobuf field: Client client = 1; - */ - client?: Client; - /** - * @generated from protobuf field: AdSignalsInfo adSignalsInfo = 9; - */ - adSignalsInfo?: AdSignalsInfo; -} -/** - * @generated from protobuf message Client - */ -export interface Client { - /** - * @generated from protobuf field: optional string hl = 1; - */ - hl?: string; - /** - * @generated from protobuf field: optional string gl = 2; - */ - gl?: string; - /** - * @generated from protobuf field: string deviceMake = 12; - */ - deviceMake: string; - /** - * @generated from protobuf field: string deviceModel = 13; - */ - deviceModel: string; - /** - * string visitorData = 14; - * string userAgent = 15; - * - * @generated from protobuf field: int32 clientName = 16; - */ - clientName: number; - /** - * @generated from protobuf field: string clientVersion = 17; - */ - clientVersion: string; - /** - * string browserVersion = 17; - * - * @generated from protobuf field: string osName = 18; - */ - osName: string; - /** - * @generated from protobuf field: string osVersion = 19; - */ - osVersion: string; - /** - * int32 screenWidthPoints = 37; //?? - * int32 screenHeightPoints = 38; //?? - * optional int32 screenPixelDensity = 41 //?? - * int32 screenWidthPoints = 55; //?? - * int32 screenHeightPoints = 56; //?? - * configInfo configInfo = 62; - * optional int32 screenDensityFloat = 65; //?? - * optional int32 utcOffsetMinutes = 63; - * userInterfaceThemType userInterfaceTheme = 78; //?? - * - * @generated from protobuf field: string timeZone = 80; - */ - timeZone: string; -} -/** - * @generated from protobuf message AdSignalsInfo - */ -export interface AdSignalsInfo { - /** - * @generated from protobuf field: map params = 1; - */ - params: { - [key: string]: string; - }; -} -declare class Browse$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message Browse - */ -export declare const Browse: Browse$Type; -declare class Context$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message Context - */ -export declare const Context: Context$Type; -declare class Client$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message Client - */ -export declare const Client: Client$Type; -declare class AdSignalsInfo$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message AdSignalsInfo - */ -export declare const AdSignalsInfo: AdSignalsInfo$Type; -export {}; diff --git a/src/protobuf/browse.request.js b/src/protobuf/browse.request.js deleted file mode 100644 index f6b7d7d..0000000 --- a/src/protobuf/browse.request.js +++ /dev/null @@ -1,65 +0,0 @@ -// @generated by protobuf-ts 2.9.1 with parameter long_type_string,output_javascript,optimize_code_size -// @generated from protobuf file "browse.request.proto" (syntax proto3) -// tslint:disable -// @generated by protobuf-ts 2.9.1 with parameter long_type_string,output_javascript,optimize_code_size -// @generated from protobuf file "browse.request.proto" (syntax proto3) -// tslint:disable -import { MessageType } from "@protobuf-ts/runtime"; -// @generated message type with reflection information, may provide speed optimized methods -class Browse$Type extends MessageType { - constructor() { - super("Browse", [ - { no: 1, name: "context", kind: "message", T: () => Context }, - { no: 2, name: "browseId", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } -} -/** - * @generated MessageType for protobuf message Browse - */ -export const Browse = new Browse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Context$Type extends MessageType { - constructor() { - super("Context", [ - { no: 1, name: "client", kind: "message", T: () => Client }, - { no: 9, name: "adSignalsInfo", kind: "message", T: () => AdSignalsInfo } - ]); - } -} -/** - * @generated MessageType for protobuf message Context - */ -export const Context = new Context$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Client$Type extends MessageType { - constructor() { - super("Client", [ - { no: 1, name: "hl", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "gl", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "deviceMake", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "deviceModel", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 16, name: "clientName", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 17, name: "clientVersion", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 18, name: "osName", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 19, name: "osVersion", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 80, name: "timeZone", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } -} -/** - * @generated MessageType for protobuf message Client - */ -export const Client = new Client$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AdSignalsInfo$Type extends MessageType { - constructor() { - super("AdSignalsInfo", [ - { no: 1, name: "params", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } - ]); - } -} -/** - * @generated MessageType for protobuf message AdSignalsInfo - */ -export const AdSignalsInfo = new AdSignalsInfo$Type(); diff --git a/src/protobuf/browse.request.proto b/src/protobuf/browse.request.proto deleted file mode 100644 index 87d310d..0000000 --- a/src/protobuf/browse.request.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; - -// option optimize_for = CODE_SIZE; - -// https://youtubei.googleapis.com/youtubei/v1/browse -message Browse { - Context context = 1; - string browseId = 2; -}; - -message Context { - Client client = 1; - AdSignalsInfo adSignalsInfo = 9; -}; - -message Client { - optional string hl = 1; - optional string gl = 2; - string deviceMake = 12; - string deviceModel = 13; - // string visitorData = 14; - // string userAgent = 15; - int32 clientName = 16; - string clientVersion = 17; - // string browserVersion = 17; - string osName = 18; - string osVersion = 19; - // int32 screenWidthPoints = 37; //?? - // int32 screenHeightPoints = 38; //?? - // optional int32 screenPixelDensity = 41 //?? - // int32 screenWidthPoints = 55; //?? - // int32 screenHeightPoints = 56; //?? - // configInfo configInfo = 62; - // optional int32 screenDensityFloat = 65; //?? - // optional int32 utcOffsetMinutes = 63; - // userInterfaceThemType userInterfaceTheme = 78; //?? - string timeZone = 80; -}; - -message AdSignalsInfo { map params = 1; }; diff --git a/src/protobuf/browse.response.d.ts b/src/protobuf/browse.response.d.ts deleted file mode 100644 index 8cee458..0000000 --- a/src/protobuf/browse.response.d.ts +++ /dev/null @@ -1,461 +0,0 @@ -// @generated by protobuf-ts 2.9.1 with parameter long_type_string,output_javascript,optimize_code_size -// @generated from protobuf file "browse.response.proto" (syntax proto3) -// tslint:disable -import { MessageType } from "@protobuf-ts/runtime"; -/** - * https://youtubei.googleapis.com/youtubei/v1/browse - * - * @generated from protobuf message Browse - */ -export interface Browse { - /** - * Context responseContext = 1; - * - * @generated from protobuf field: Renderers contents = 9; - */ - contents?: Renderers; - /** - * @generated from protobuf field: Renderers continuationContents = 10; - */ - continuationContents?: Renderers; -} -/** - * - * message Context { - * repeated ServiceTrackingParams serviceTrackingParams = 6; - * int32 maxAgeSeconds = 7; - * }; - * - * @generated from protobuf message Renderers - */ -export interface Renderers { - /** - * @generated from protobuf field: SectionListRenderer sectionListRenderer = 49399797; - */ - sectionListRenderer?: SectionListRenderer; - /** - * @generated from protobuf field: n4F50195462 n4F50195462 = 50195462; - */ - n4F50195462?: n4F50195462; - /** - * n6F51431404 n6F51431404 = 51431404; - * n4F51845067 n4F51845067 = 51845067; - * - * @generated from protobuf field: SingleColumnBrowseResultsRenderer singleColumnBrowseResultsRenderer = 58173949; - */ - singleColumnBrowseResultsRenderer?: SingleColumnBrowseResultsRenderer; - /** - * @generated from protobuf field: MusicSideAlignedItemRenderer musicSideAlignedItemRenderer = 90823135; - */ - musicSideAlignedItemRenderer?: MusicSideAlignedItemRenderer; - /** - * @generated from protobuf field: GridRenderer gridRenderer = 91303872; - */ - gridRenderer?: GridRenderer; - /** - * @generated from protobuf field: n6F153515154 n6F153515154 = 153515154; - */ - n6F153515154?: n6F153515154; - /** - * n11F172035250 n11F172035250 = 172035250; - * n7F172660663 n7F172660663 = 172660663; - * - * @generated from protobuf field: MusicDescriptionShelfRenderer musicDescriptionShelfRenderer = 221496734; - */ - musicDescriptionShelfRenderer?: MusicDescriptionShelfRenderer; -} -/** - * - * message ServiceTrackingParams { - * //serviceType service = 1; - * map params = 2; - * }; - * - * @generated from protobuf message SingleColumnBrowseResultsRenderer - */ -export interface SingleColumnBrowseResultsRenderer { - /** - * @generated from protobuf field: repeated Tabs tabs = 1; - */ - tabs: Tabs[]; -} -/** - * @generated from protobuf message MusicSideAlignedItemRenderer - */ -export interface MusicSideAlignedItemRenderer { - /** - * @generated from protobuf field: repeated Renderers startItems = 1; - */ - startItems: Renderers[]; -} -/** - * @generated from protobuf message GridRenderer - */ -export interface GridRenderer { - /** - * @generated from protobuf field: repeated Renderers items = 1; - */ - items: Renderers[]; -} -/** - * @generated from protobuf message Tabs - */ -export interface Tabs { - /** - * @generated from protobuf field: TabRenderer tabRenderer = 58174010; - */ - tabRenderer?: TabRenderer; -} -/** - * @generated from protobuf message TabRenderer - */ -export interface TabRenderer { - /** - * @generated from protobuf field: optional string title = 2; - */ - title?: string; - /** - * @generated from protobuf field: bool selected = 3; - */ - selected: boolean; - /** - * @generated from protobuf field: Renderers content = 4; - */ - content?: Renderers; - /** - * @generated from protobuf field: optional string tabIdentifier = 11; - */ - tabIdentifier?: string; -} -/** - * @generated from protobuf message SectionListRenderer - */ -export interface SectionListRenderer { - /** - * @generated from protobuf field: repeated Renderers contents = 1; - */ - contents: Renderers[]; - /** - * @generated from protobuf field: Renderers header = 6; - */ - header?: Renderers; -} -/** - * sectionListRenderer ?? musicDescriptionShelfRenderer - * - * @generated from protobuf message n4F50195462 - */ -export interface n4F50195462 { - /** - * @generated from protobuf field: repeated Renderers n5F1 = 1; - */ - n5F1: Renderers[]; -} -/** - * - * message n4F51845067 { - * Renderers n5F5 = 5; - * }; - * - * message n6F51431404 { - * repeated Renderers n5F1 = 1; - * }; - * - * @generated from protobuf message MusicDescriptionShelfRenderer - */ -export interface MusicDescriptionShelfRenderer { - /** - * @generated from protobuf field: Description description = 3; - */ - description?: Description; - /** - * @generated from protobuf field: Footer footer = 10; - */ - footer?: Footer; -} -/** - * @generated from protobuf message Description - */ -export interface Description { - /** - * n6F1 n6F1 = 1; // Runs - * - * @generated from protobuf field: repeated Runs runs = 1; - */ - runs: Runs[]; -} -/** - * description? - * - * @generated from protobuf message n6F153515154 - */ -export interface n6F153515154 { - /** - * @generated from protobuf field: n7F172660663 n7F172660663 = 172660663; - */ - n7F172660663?: n7F172660663; -} -/** - * @generated from protobuf message n7F172660663 - */ -export interface n7F172660663 { - /** - * @generated from protobuf field: n8F1 n8F1 = 1; - */ - n8F1?: n8F1; -} -/** - * @generated from protobuf message Footer - */ -export interface Footer { - /** - * Origin origin = 1; - * - * @generated from protobuf field: repeated Runs runs = 1; - */ - runs: Runs[]; -} -/** - * content? - * - * @generated from protobuf message n8F1 - */ -export interface n8F1 { - /** - * @generated from protobuf field: n9F168777401 n9F168777401 = 168777401; - */ - n9F168777401?: n9F168777401; -} -/** - * - * message n8F2 { // header? - * n9F183314536 n9F183314536 = 183314536; - * }; - * - * message n8F3 { - * n8F1 n8F1 = 1; - * n8F2 n8F2 = 2; - * }; - * - * message Origin { // runs - * string originText = 1; //text - * }; - * - * @generated from protobuf message n9F168777401 - */ -export interface n9F168777401 { - /** - * n10F3 n10F3 = 3; - * - * @generated from protobuf field: n10F5 n10F5 = 5; - */ - n10F5?: n10F5; -} -/** - * @generated from protobuf message n10F5 - */ -export interface n10F5 { - /** - * @generated from protobuf field: n11F465160965 n11F465160965 = 465160965; - */ - n11F465160965?: n11F465160965; -} -/** - * @generated from protobuf message n11F465160965 - */ -export interface n11F465160965 { - /** - * @generated from protobuf field: n12F4 n12F4 = 4; - */ - n12F4?: n12F4; -} -/** - * Name - * - * @generated from protobuf message n12F4 - */ -export interface n12F4 { - /** - * @generated from protobuf field: repeated n13F1 n13F1 = 1; - */ - n13F1: n13F1[]; - /** - * @generated from protobuf field: string originText = 2; - */ - originText: string; -} -/** - * Runs - * - * @generated from protobuf message n13F1 - */ -export interface n13F1 { - /** - * @generated from protobuf field: string f1 = 1; - */ - f1: string; -} -/** - * - * message n11F172035250 { - * string type = 1; - * }; - * - * Runs - * - * @generated from protobuf message Runs - */ -export interface Runs { - /** - * @generated from protobuf field: string text = 1; - */ - text: string; -} -declare class Browse$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message Browse - */ -export declare const Browse: Browse$Type; -declare class Renderers$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message Renderers - */ -export declare const Renderers: Renderers$Type; -declare class SingleColumnBrowseResultsRenderer$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message SingleColumnBrowseResultsRenderer - */ -export declare const SingleColumnBrowseResultsRenderer: SingleColumnBrowseResultsRenderer$Type; -declare class MusicSideAlignedItemRenderer$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message MusicSideAlignedItemRenderer - */ -export declare const MusicSideAlignedItemRenderer: MusicSideAlignedItemRenderer$Type; -declare class GridRenderer$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message GridRenderer - */ -export declare const GridRenderer: GridRenderer$Type; -declare class Tabs$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message Tabs - */ -export declare const Tabs: Tabs$Type; -declare class TabRenderer$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message TabRenderer - */ -export declare const TabRenderer: TabRenderer$Type; -declare class SectionListRenderer$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message SectionListRenderer - */ -export declare const SectionListRenderer: SectionListRenderer$Type; -declare class n4F50195462$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message n4F50195462 - */ -export declare const n4F50195462: n4F50195462$Type; -declare class MusicDescriptionShelfRenderer$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message MusicDescriptionShelfRenderer - */ -export declare const MusicDescriptionShelfRenderer: MusicDescriptionShelfRenderer$Type; -declare class Description$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message Description - */ -export declare const Description: Description$Type; -declare class n6F153515154$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message n6F153515154 - */ -export declare const n6F153515154: n6F153515154$Type; -declare class n7F172660663$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message n7F172660663 - */ -export declare const n7F172660663: n7F172660663$Type; -declare class Footer$Type extends MessageType