googlevideo 2.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -9
- package/README.md +127 -66
- package/dist/protos/generated/misc/common.d.ts +180 -21
- package/dist/protos/generated/misc/common.js +277 -147
- package/dist/protos/generated/misc/common.js.map +1 -0
- package/dist/protos/generated/video_streaming/buffered_range.d.ts +10 -25
- package/dist/protos/generated/video_streaming/buffered_range.js +21 -166
- package/dist/protos/generated/video_streaming/buffered_range.js.map +1 -0
- package/dist/protos/generated/video_streaming/client_abr_state.d.ts +34 -45
- package/dist/protos/generated/video_streaming/client_abr_state.js +209 -350
- package/dist/protos/generated/video_streaming/client_abr_state.js.map +1 -0
- package/dist/protos/generated/video_streaming/crypto_params.d.ts +2 -24
- package/dist/protos/generated/video_streaming/crypto_params.js +2 -86
- package/dist/protos/generated/video_streaming/crypto_params.js.map +1 -0
- package/dist/protos/generated/video_streaming/format_initialization_metadata.d.ts +6 -21
- package/dist/protos/generated/video_streaming/format_initialization_metadata.js +32 -95
- package/dist/protos/generated/video_streaming/format_initialization_metadata.js.map +1 -0
- package/dist/protos/generated/video_streaming/format_selection_config.d.ts +12 -0
- package/dist/protos/generated/video_streaming/format_selection_config.js +68 -0
- package/dist/protos/generated/video_streaming/format_selection_config.js.map +1 -0
- package/dist/protos/generated/video_streaming/innertube_request.d.ts +25 -0
- package/dist/protos/generated/video_streaming/innertube_request.js +186 -0
- package/dist/protos/generated/video_streaming/innertube_request.js.map +1 -0
- package/dist/protos/generated/video_streaming/live_metadata.d.ts +20 -0
- package/dist/protos/generated/video_streaming/live_metadata.js +153 -0
- package/dist/protos/generated/video_streaming/live_metadata.js.map +1 -0
- package/dist/protos/generated/video_streaming/media_capabilities.d.ts +0 -15
- package/dist/protos/generated/video_streaming/media_capabilities.js +2 -122
- package/dist/protos/generated/video_streaming/media_capabilities.js.map +1 -0
- package/dist/protos/generated/video_streaming/media_header.d.ts +5 -27
- package/dist/protos/generated/video_streaming/media_header.js +28 -151
- package/dist/protos/generated/video_streaming/media_header.js.map +1 -0
- package/dist/protos/generated/video_streaming/next_request_policy.d.ts +3 -15
- package/dist/protos/generated/video_streaming/next_request_policy.js +32 -50
- package/dist/protos/generated/video_streaming/next_request_policy.js.map +1 -0
- package/dist/protos/generated/video_streaming/onesie_header.d.ts +7 -22
- package/dist/protos/generated/video_streaming/onesie_header.js +16 -137
- package/dist/protos/generated/video_streaming/onesie_header.js.map +1 -0
- package/dist/protos/generated/video_streaming/onesie_header_type.d.ts +9 -25
- package/dist/protos/generated/video_streaming/onesie_header_type.js +17 -176
- package/dist/protos/generated/video_streaming/onesie_header_type.js.map +1 -0
- package/dist/protos/generated/video_streaming/onesie_innertube_request.d.ts +15 -0
- package/dist/protos/generated/video_streaming/{onesie_player_request.js → onesie_innertube_request.js} +10 -54
- package/dist/protos/generated/video_streaming/onesie_innertube_request.js.map +1 -0
- package/dist/protos/generated/video_streaming/onesie_innertube_response.d.ts +15 -0
- package/dist/protos/generated/video_streaming/{onesie_player_response.js → onesie_innertube_response.js} +6 -58
- package/dist/protos/generated/video_streaming/onesie_innertube_response.js.map +1 -0
- package/dist/protos/generated/video_streaming/onesie_proxy_status.d.ts +18 -0
- package/dist/protos/generated/video_streaming/onesie_proxy_status.js +25 -0
- package/dist/protos/generated/video_streaming/onesie_proxy_status.js.map +1 -0
- package/dist/protos/generated/video_streaming/onesie_request.d.ts +7 -17
- package/dist/protos/generated/video_streaming/onesie_request.js +28 -89
- package/dist/protos/generated/video_streaming/onesie_request.js.map +1 -0
- package/dist/protos/generated/video_streaming/playback_cookie.d.ts +2 -17
- package/dist/protos/generated/video_streaming/playback_cookie.js +6 -47
- package/dist/protos/generated/video_streaming/playback_cookie.js.map +1 -0
- package/dist/protos/generated/video_streaming/playback_start_policy.d.ts +0 -15
- package/dist/protos/generated/video_streaming/playback_start_policy.js +2 -66
- package/dist/protos/generated/video_streaming/playback_start_policy.js.map +1 -0
- package/dist/protos/generated/video_streaming/reload_player_response.d.ts +14 -0
- package/dist/protos/generated/video_streaming/reload_player_response.js +73 -0
- package/dist/protos/generated/video_streaming/reload_player_response.js.map +1 -0
- package/dist/protos/generated/video_streaming/request_cancellation_policy.d.ts +0 -15
- package/dist/protos/generated/video_streaming/request_cancellation_policy.js +2 -66
- package/dist/protos/generated/video_streaming/request_cancellation_policy.js.map +1 -0
- package/dist/protos/generated/video_streaming/request_identifier.d.ts +10 -0
- package/dist/protos/generated/video_streaming/request_identifier.js +41 -0
- package/dist/protos/generated/video_streaming/request_identifier.js.map +1 -0
- package/dist/protos/generated/video_streaming/sabr_context_sending_policy.d.ts +12 -0
- package/dist/protos/generated/video_streaming/sabr_context_sending_policy.js +86 -0
- package/dist/protos/generated/video_streaming/sabr_context_sending_policy.js.map +1 -0
- package/dist/protos/generated/video_streaming/sabr_context_update.d.ts +48 -0
- package/dist/protos/generated/video_streaming/sabr_context_update.js +242 -0
- package/dist/protos/generated/video_streaming/sabr_context_update.js.map +1 -0
- package/dist/protos/generated/video_streaming/sabr_error.d.ts +0 -15
- package/dist/protos/generated/video_streaming/sabr_error.js +2 -29
- package/dist/protos/generated/video_streaming/sabr_error.js.map +1 -0
- package/dist/protos/generated/video_streaming/sabr_redirect.d.ts +0 -15
- package/dist/protos/generated/video_streaming/sabr_redirect.js +2 -22
- package/dist/protos/generated/video_streaming/sabr_redirect.js.map +1 -0
- package/dist/protos/generated/video_streaming/snackbar_message.d.ts +10 -0
- package/dist/protos/generated/video_streaming/snackbar_message.js +41 -0
- package/dist/protos/generated/video_streaming/snackbar_message.js.map +1 -0
- package/dist/protos/generated/video_streaming/stream_protection_status.d.ts +1 -16
- package/dist/protos/generated/video_streaming/stream_protection_status.js +6 -33
- package/dist/protos/generated/video_streaming/stream_protection_status.js.map +1 -0
- package/dist/protos/generated/video_streaming/streamer_context.d.ts +11 -28
- package/dist/protos/generated/video_streaming/streamer_context.js +33 -383
- package/dist/protos/generated/video_streaming/streamer_context.js.map +1 -0
- package/dist/protos/generated/video_streaming/time_range.d.ts +2 -17
- package/dist/protos/generated/video_streaming/time_range.js +9 -41
- package/dist/protos/generated/video_streaming/time_range.js.map +1 -0
- package/dist/protos/generated/video_streaming/ump_part_id.d.ts +58 -0
- package/dist/protos/generated/video_streaming/ump_part_id.js +89 -0
- package/dist/protos/generated/video_streaming/ump_part_id.js.map +1 -0
- package/dist/protos/generated/video_streaming/video_playback_abr_request.d.ts +21 -36
- package/dist/protos/generated/video_streaming/video_playback_abr_request.js +67 -343
- package/dist/protos/generated/video_streaming/video_playback_abr_request.js.map +1 -0
- package/dist/src/core/{ChunkedDataBuffer.d.ts → CompositeBuffer.d.ts} +8 -8
- package/dist/src/core/{ChunkedDataBuffer.js → CompositeBuffer.js} +32 -27
- package/dist/src/core/CompositeBuffer.js.map +1 -0
- package/dist/src/core/SabrStream.d.ts +356 -0
- package/dist/src/core/SabrStream.js +958 -0
- package/dist/src/core/SabrStream.js.map +1 -0
- package/dist/src/core/SabrStreamingAdapter.d.ts +158 -0
- package/dist/src/core/SabrStreamingAdapter.js +496 -0
- package/dist/src/core/SabrStreamingAdapter.js.map +1 -0
- package/dist/src/core/SabrUmpProcessor.d.ts +53 -0
- package/dist/src/core/SabrUmpProcessor.js +234 -0
- package/dist/src/core/SabrUmpProcessor.js.map +1 -0
- package/dist/src/core/UmpReader.d.ts +30 -0
- package/dist/src/core/UmpReader.js +122 -0
- package/dist/src/core/UmpReader.js.map +1 -0
- package/dist/src/core/UmpWriter.d.ts +16 -0
- package/dist/src/core/UmpWriter.js +56 -0
- package/dist/src/core/UmpWriter.js.map +1 -0
- package/dist/src/exports/protos.d.ts +1 -0
- package/dist/src/exports/protos.js +2 -0
- package/dist/src/exports/protos.js.map +1 -0
- package/dist/src/exports/sabr-stream.d.ts +2 -0
- package/dist/src/exports/sabr-stream.js +2 -0
- package/dist/src/exports/sabr-stream.js.map +1 -0
- package/dist/src/exports/sabr-streaming-adapter.d.ts +3 -0
- package/dist/src/exports/sabr-streaming-adapter.js +3 -0
- package/dist/src/exports/sabr-streaming-adapter.js.map +1 -0
- package/dist/src/exports/ump.d.ts +3 -0
- package/dist/src/exports/ump.js +4 -0
- package/dist/src/exports/ump.js.map +1 -0
- package/dist/src/exports/utils.d.ts +1 -0
- package/dist/src/exports/utils.js +2 -0
- package/dist/src/exports/utils.js.map +1 -0
- package/dist/src/types/sabrStreamTypes.d.ts +102 -0
- package/dist/src/types/sabrStreamTypes.js +2 -0
- package/dist/src/types/sabrStreamTypes.js.map +1 -0
- package/dist/src/types/sabrStreamingAdapterTypes.d.ts +93 -0
- package/dist/src/types/sabrStreamingAdapterTypes.js +2 -0
- package/dist/src/types/sabrStreamingAdapterTypes.js.map +1 -0
- package/dist/src/types/shared.d.ts +64 -0
- package/dist/src/types/shared.js +2 -0
- package/dist/src/types/shared.js.map +1 -0
- package/dist/src/utils/CacheManager.d.ts +32 -0
- package/dist/src/utils/CacheManager.js +131 -0
- package/dist/src/utils/CacheManager.js.map +1 -0
- package/dist/src/utils/EventEmitterLike.d.ts +5 -0
- package/dist/src/utils/EventEmitterLike.js +51 -10
- package/dist/src/utils/EventEmitterLike.js.map +1 -0
- package/dist/src/utils/Logger.d.ts +30 -0
- package/dist/src/utils/Logger.js +80 -0
- package/dist/src/utils/Logger.js.map +1 -0
- package/dist/src/utils/Protos.d.ts +21 -13
- package/dist/src/utils/Protos.js +22 -13
- package/dist/src/utils/Protos.js.map +1 -0
- package/dist/src/utils/RequestMetadataManager.d.ts +15 -0
- package/dist/src/utils/RequestMetadataManager.js +48 -0
- package/dist/src/utils/RequestMetadataManager.js.map +1 -0
- package/dist/src/utils/formatKeyUtils.d.ts +45 -0
- package/dist/src/utils/formatKeyUtils.js +77 -0
- package/dist/src/utils/formatKeyUtils.js.map +1 -0
- package/dist/src/utils/index.d.ts +5 -3
- package/dist/src/utils/index.js +6 -2
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/sabrStreamUtils.d.ts +28 -0
- package/dist/src/utils/sabrStreamUtils.js +76 -0
- package/dist/src/utils/sabrStreamUtils.js.map +1 -0
- package/dist/src/utils/shared.d.ts +43 -0
- package/dist/src/utils/shared.js +108 -0
- package/dist/src/utils/shared.js.map +1 -0
- package/package.json +88 -61
- package/dist/protos/generated/video_streaming/encrypted_player_request.d.ts +0 -37
- package/dist/protos/generated/video_streaming/encrypted_player_request.js +0 -239
- package/dist/protos/generated/video_streaming/onesie_player_request.d.ts +0 -31
- package/dist/protos/generated/video_streaming/onesie_player_response.d.ts +0 -29
- package/dist/protos/generated/video_streaming/proxy_status.d.ts +0 -16
- package/dist/protos/generated/video_streaming/proxy_status.js +0 -86
- package/dist/src/core/ServerAbrStream.d.ts +0 -38
- package/dist/src/core/ServerAbrStream.js +0 -272
- package/dist/src/core/UMP.d.ts +0 -10
- package/dist/src/core/UMP.js +0 -109
- package/dist/src/core/index.d.ts +0 -3
- package/dist/src/core/index.js +0 -3
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -4
- package/dist/src/utils/helpers.d.ts +0 -63
- package/dist/src/utils/helpers.js +0 -101
- package/dist/src/utils/types.d.ts +0 -65
- package/dist/src/utils/types.js +0 -1
package/LICENSE
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 LuanRT
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 LuanRT
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,66 +1,127 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
(
|
|
66
|
-
|
|
1
|
+
# GoogleVideo
|
|
2
|
+
[](https://jsr.io/@luanrt/googlevideo)
|
|
3
|
+
[](https://www.npmjs.com/package/googlevideo)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
|
|
6
|
+
A collection of modules for working with YouTube's proprietary video streaming protocols (UMP/SABR). It can be used to build clients or to integrate with existing media players (e.g., [Shaka Player](https://shaka-player-demo.appspot.com/docs/api/index.html)).
|
|
7
|
+
|
|
8
|
+
[API Reference →](https://ytjs.dev/googlevideo/api)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# NPM
|
|
14
|
+
npm install googlevideo
|
|
15
|
+
|
|
16
|
+
# JSR / Deno
|
|
17
|
+
npx jsr add @luanrt/googlevideo
|
|
18
|
+
deno add jsr:@luanrt/googlevideo
|
|
19
|
+
|
|
20
|
+
# GitHub
|
|
21
|
+
npm install LuanRT/googlevideo
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Basic Usage
|
|
25
|
+
Below is a basic example using the UMP modules to create a buffer, write parts, and process them:
|
|
26
|
+
|
|
27
|
+
> [!NOTE]
|
|
28
|
+
> More advanced usage examples can be found in the [/examples](./examples/) directory.
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { CompositeBuffer, UmpReader, UmpWriter } from 'googlevideo/ump';
|
|
32
|
+
import { MediaHeader, UMPPartId } from 'googlevideo/protos';
|
|
33
|
+
import { concatenateChunks } from 'googlevideo/utils';
|
|
34
|
+
import { Part } from 'googlevideo/shared-types';
|
|
35
|
+
|
|
36
|
+
function handleMediaHeader(part: Part) {
|
|
37
|
+
const mediaHeader = MediaHeader.decode(concatenateChunks(part.data.chunks));
|
|
38
|
+
console.log('Media Header:', mediaHeader);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function handleMedia(part: Part) {
|
|
42
|
+
const headerId = part.data.getUint8(0);
|
|
43
|
+
console.log(`Media Part (Associated Header ID: ${headerId}):`, part.data.split(1).remainingBuffer.getLength(), 'bytes');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function handleMediaEnd(part: Part) {
|
|
47
|
+
const headerId = part.data.getUint8(0);
|
|
48
|
+
console.log(`Media End Part (Associated Header ID: ${headerId}):`, part.data.split(1).remainingBuffer.getLength(), 'bytes');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const umpPartHandlers = new Map<UMPPartId, (part: Part) => void>([
|
|
52
|
+
[ UMPPartId.MEDIA_HEADER, handleMediaHeader ],
|
|
53
|
+
[ UMPPartId.MEDIA, handleMedia ],
|
|
54
|
+
[ UMPPartId.MEDIA_END, handleMediaEnd ]
|
|
55
|
+
]);
|
|
56
|
+
|
|
57
|
+
const buffer = mockUmpData();
|
|
58
|
+
const reader = new UmpReader(buffer);
|
|
59
|
+
|
|
60
|
+
reader.read((part) => {
|
|
61
|
+
const handler = umpPartHandlers.get(part.type);
|
|
62
|
+
if (handler) {
|
|
63
|
+
handler(part);
|
|
64
|
+
} else {
|
|
65
|
+
console.warn(`No handler for part type: ${part.type}`);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Generates a mock UMP data buffer containing a MEDIA_HEADER, and respective MEDIA and MEDIA_END parts.
|
|
71
|
+
* This group represents a single audio segment, which is what you would typically see
|
|
72
|
+
* in a real UMP stream.
|
|
73
|
+
*/
|
|
74
|
+
function mockUmpData(): CompositeBuffer {
|
|
75
|
+
const buffer = new CompositeBuffer();
|
|
76
|
+
const writer = new UmpWriter(buffer);
|
|
77
|
+
|
|
78
|
+
const audioHeaderId = 0;
|
|
79
|
+
|
|
80
|
+
const partsToWrite: [UMPPartId, Uint8Array][] = [
|
|
81
|
+
[
|
|
82
|
+
UMPPartId.MEDIA_HEADER,
|
|
83
|
+
MediaHeader.encode({
|
|
84
|
+
headerId: audioHeaderId,
|
|
85
|
+
videoId: "sOa4VVlI9tE",
|
|
86
|
+
itag: 141,
|
|
87
|
+
lmt: 1645502668395260,
|
|
88
|
+
xtags: "",
|
|
89
|
+
startRange: 5463800,
|
|
90
|
+
isInitSeg: false,
|
|
91
|
+
sequenceNumber: 0,
|
|
92
|
+
durationMs: 0,
|
|
93
|
+
formatId: {
|
|
94
|
+
itag: 141,
|
|
95
|
+
lastModified: 1645502668395260,
|
|
96
|
+
xtags: ""
|
|
97
|
+
},
|
|
98
|
+
contentLength: 963966,
|
|
99
|
+
}).finish()
|
|
100
|
+
],
|
|
101
|
+
[ UMPPartId.MEDIA, new Uint8Array([ audioHeaderId, ...new Uint8Array(827609).fill(0) ]) ],
|
|
102
|
+
[ UMPPartId.MEDIA, new Uint8Array([ audioHeaderId, ...new Uint8Array(136357).fill(0) ]) ],
|
|
103
|
+
[ UMPPartId.MEDIA_END, new Uint8Array([ audioHeaderId ]) ]
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
for (const [type, data] of partsToWrite) {
|
|
107
|
+
writer.write(type, data);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return buffer;
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Expected output:
|
|
115
|
+
```
|
|
116
|
+
Media Header: { ... }
|
|
117
|
+
Media Part (Associated Header ID: 0): 827609 bytes
|
|
118
|
+
Media Part (Associated Header ID: 0): 136357 bytes
|
|
119
|
+
Media End Part (Associated Header ID: 0): 0 bytes
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
Distributed under the [MIT](./LICENSE) License.
|
|
124
|
+
|
|
125
|
+
<p align="right">
|
|
126
|
+
(<a href="#top">back to top</a>)
|
|
127
|
+
</p>
|
|
@@ -1,5 +1,167 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
export declare const protobufPackage = "misc";
|
|
3
|
+
export declare enum CompressionType {
|
|
4
|
+
UNKNOWN = 0,
|
|
5
|
+
GZIP = 1,
|
|
6
|
+
BROTLI = 2,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export declare enum AudioQuality {
|
|
10
|
+
UNKNOWN = 0,
|
|
11
|
+
ULTRALOW = 5,
|
|
12
|
+
LOW = 10,
|
|
13
|
+
MEDIUM = 20,
|
|
14
|
+
HIGH = 30,
|
|
15
|
+
UNRECOGNIZED = -1
|
|
16
|
+
}
|
|
17
|
+
export declare enum VideoQualitySetting {
|
|
18
|
+
UNKNOWN = 0,
|
|
19
|
+
HIGHER_QUALITY = 1,
|
|
20
|
+
DATA_SAVER = 2,
|
|
21
|
+
ADVANCED_MENU = 3,
|
|
22
|
+
UNRECOGNIZED = -1
|
|
23
|
+
}
|
|
24
|
+
export declare enum PlaybackAudioRouteOutputType {
|
|
25
|
+
UNKNOWN = 0,
|
|
26
|
+
LINE_OUT = 1,
|
|
27
|
+
HEADPHONES = 2,
|
|
28
|
+
BLUETOOTH_A2DP = 3,
|
|
29
|
+
BUILT_IN_RECEIVER = 4,
|
|
30
|
+
BUILT_IN_SPEAKER = 5,
|
|
31
|
+
HDMI = 6,
|
|
32
|
+
AIR_PLAY = 7,
|
|
33
|
+
BLUETOOTH_LE = 8,
|
|
34
|
+
BLUETOOTH_HFP = 9,
|
|
35
|
+
USB_AUDIO = 10,
|
|
36
|
+
CAR_PLAY = 11,
|
|
37
|
+
ANDROID_AUDIO = 12,
|
|
38
|
+
UNRECOGNIZED = -1
|
|
39
|
+
}
|
|
40
|
+
export declare enum NetworkMeteredState {
|
|
41
|
+
UNKNOWN = 0,
|
|
42
|
+
UNMETERED = 1,
|
|
43
|
+
METERED = 2,
|
|
44
|
+
UNRECOGNIZED = -1
|
|
45
|
+
}
|
|
46
|
+
export declare enum SeekSource {
|
|
47
|
+
UNKNOWN = 0,
|
|
48
|
+
TIMESTAMP_IN_COMMENTS = 1,
|
|
49
|
+
TIMESTAMP_IN_DESCRIPTION = 2,
|
|
50
|
+
MACRO_MARKER_LIST_ITEM = 3,
|
|
51
|
+
DOUBLE_TAP_TO_SEEK = 4,
|
|
52
|
+
DOUBLE_TAP_TO_SKIP_CHAPTER = 5,
|
|
53
|
+
PICK_UP_PLAY_HEAD = 6,
|
|
54
|
+
SLIDE_ON_SCRUBBER_BAR = 7,
|
|
55
|
+
SLIDE_ON_PLAYER = 8,
|
|
56
|
+
SABR_PARTIAL_CHUNK = 9,
|
|
57
|
+
SABR_SEEK_TO_HEAD = 10,
|
|
58
|
+
SABR_LIVE_DVR_USER_SEEK = 11,
|
|
59
|
+
SABR_SEEK_TO_DVR_LOWER_BOUND = 12,
|
|
60
|
+
SABR_SEEK_TO_DVR_UPPER_BOUND = 13,
|
|
61
|
+
SSDAI_INTERNAL = 14,
|
|
62
|
+
START_PLAYBACK = 15,
|
|
63
|
+
SABR_ACCURATE_SEEK = 17,
|
|
64
|
+
START_PLAYBACK_SEEK_TO_END = 18,
|
|
65
|
+
IOS_PLAYER_REMOVED_SEGMENTS = 19,
|
|
66
|
+
IOS_PLAYER_SEGMENT_LIST = 20,
|
|
67
|
+
IOS_PLAYER_ITEM_SEEK = 21,
|
|
68
|
+
IOS_PLAYER_ITEM_SEEK_TO_END = 22,
|
|
69
|
+
IOS_PLAYER_SEEK_TO_END_TO_RESYNC = 23,
|
|
70
|
+
IOS_SEEK_ACCESSIBILITY_BUTTON = 24,
|
|
71
|
+
FINE_SCRUBBER_SLIDE_ON_FILMSTRIP = 25,
|
|
72
|
+
FINE_SCRUBBER_TAP_ON_FILMSTRIP = 26,
|
|
73
|
+
FINE_SCRUBBER_SLIDE_ON_SCRUBBER_BAR = 27,
|
|
74
|
+
SEEK_BUTTON_ON_PLAYER_CONTROL = 28,
|
|
75
|
+
SABR_INGESTION_WALL_TIME_SEEK = 29,
|
|
76
|
+
PLAYER_VIEW_REPARENT_INTERNAL = 30,
|
|
77
|
+
PRESS_REWIND_PLAY_BACK_CONTROL = 31,
|
|
78
|
+
PRESS_FAST_FORWARD_PLAY_BACK_CONTROL = 32,
|
|
79
|
+
PRESS_LIVE_SYNC_ICON = 33,
|
|
80
|
+
PEG_TO_LIVE = 34,
|
|
81
|
+
ANDROID_MEDIA_SESSION = 35,
|
|
82
|
+
TAP_ON_REPLAY_ACTION = 36,
|
|
83
|
+
AUTOMATIC_REPLAY_ACTION = 37,
|
|
84
|
+
NON_USER_SEEK_TO_PREVIOUS = 38,
|
|
85
|
+
NON_USER_SEEK_TO_NEXT = 39,
|
|
86
|
+
HIGHLIGHTS_TAP_PREVIOUS_PLAY = 66,
|
|
87
|
+
HIGHLIGHTS_TAP_NEXT_PLAY = 40,
|
|
88
|
+
HIGHLIGHTS_TAP_HIDDEN_NEXT_PLAY = 41,
|
|
89
|
+
HIGHLIGHTS_TAP_LIST_ITEM = 42,
|
|
90
|
+
HIGHLIGHTS_AUTOMATIC_NEXT_PLAY = 43,
|
|
91
|
+
HIGHLIGHTS_SEEK_TO_FIRST_PLAY = 44,
|
|
92
|
+
HIGHLIGHTS_SEEK_TO_END = 45,
|
|
93
|
+
SEGMENTS_TAP_LIST_ITEM = 46,
|
|
94
|
+
PIP_FAST_FORWARD_BUTTON = 47,
|
|
95
|
+
PIP_REWIND_BUTTON = 48,
|
|
96
|
+
PIP_RESUME_ON_HEAD = 49,
|
|
97
|
+
MOVING_CLIP_FRAME = 50,
|
|
98
|
+
RESUME_CLIP_PREVIOUS_POSITION = 51,
|
|
99
|
+
SEEK_TO_NEXT_CHAPTER = 52,
|
|
100
|
+
SEEK_TO_PREVIOUS_CHAPTER = 53,
|
|
101
|
+
IOS_SHAREPLAY_PAUSE = 54,
|
|
102
|
+
IOS_SHAREPLAY_SEEK = 55,
|
|
103
|
+
IOS_SHAREPLAY_SYNC_RESPONSE = 56,
|
|
104
|
+
SEEK_TO_HEAD_IMMERSIVE_LIVE_VIDEO = 57,
|
|
105
|
+
SEEK_TO_START_OF_LOOPING_RANGE_OF_SHORTS = 58,
|
|
106
|
+
SABR_SEEK_TO_CLOSEST_KEYFRAME = 59,
|
|
107
|
+
SEEK_TO_END_OF_LOOPING_RANGE_OF_SHORTS = 60,
|
|
108
|
+
CLIP_SLIDE_ON_FLIMSTRIP = 61,
|
|
109
|
+
PICK_UP_CLIP_SLIDER = 62,
|
|
110
|
+
FINE_SCRUBBER_CANCELLED = 63,
|
|
111
|
+
INLINE_PLAYER_SEEK_CHAPTER = 64,
|
|
112
|
+
INLINE_PLAYER_SEEK_SECONDS = 65,
|
|
113
|
+
HIGHLIGHTS_PLAYER_EXIT_FULLSCREEN = 67,
|
|
114
|
+
LARGE_CONTROLS_FORWARD_BUTTON = 68,
|
|
115
|
+
LARGE_CONTROLS_REWIND_BUTTON = 69,
|
|
116
|
+
LARGE_CONTROLS_SCRUBBER_BAR = 70,
|
|
117
|
+
SEEK_BACKWARD_5S = 71,
|
|
118
|
+
SEEK_FORWARD_5S = 72,
|
|
119
|
+
SEEK_BACKWARD_10S = 73,
|
|
120
|
+
SEEK_FORWARD_10S = 74,
|
|
121
|
+
SEEK_FORWARD_60S = 75,
|
|
122
|
+
SEEK_BACKWARD_60S = 76,
|
|
123
|
+
SEEK_TO_NEXT_FRAME = 77,
|
|
124
|
+
SEEK_TO_PREV_FRAME = 78,
|
|
125
|
+
KEYBOARD_SEEK_TO_BEGINNING = 79,
|
|
126
|
+
KEYBOARD_SEEK_TO_END = 80,
|
|
127
|
+
SEEK_PERCENT_OF_VIDEO = 81,
|
|
128
|
+
HIDDEN_FAST_FORWARD_BUTTON = 82,
|
|
129
|
+
HIDDEN_REWIND_BUTTON = 83,
|
|
130
|
+
TIMESTAMP = 84,
|
|
131
|
+
LR_MEDIA_SESSION_SEEK = 87,
|
|
132
|
+
MIDROLLS_WITH_TIME_RANGE = 88,
|
|
133
|
+
SKIP_AD = 89,
|
|
134
|
+
SEEK_TO_PREVIOUS = 90,
|
|
135
|
+
SEEK_TO_NEXT = 91,
|
|
136
|
+
LR_QUICK_SEEK = 92,
|
|
137
|
+
ONESIE_LIVE = 93,
|
|
138
|
+
LR_PLAYER_CONTROL_ACTION = 94,
|
|
139
|
+
UNPLUGGED_LENS_START_CLIP = 95,
|
|
140
|
+
LR_KEY_PLAYS = 96,
|
|
141
|
+
SSAP_AD_FMT_FATAL = 97,
|
|
142
|
+
TVHTML5_INPUT_SOURCE_KEY_EVENT = 98,
|
|
143
|
+
TVHTML5_INPUT_SOURCE_CONTROLS = 99,
|
|
144
|
+
TVHTML5_INPUT_SOURCE_TOUCH = 100,
|
|
145
|
+
TVHTML5_INPUT_SOURCE_TOUCHPAD = 101,
|
|
146
|
+
SEEK_TO_HEAD = 102,
|
|
147
|
+
AUTOMATIC_PREVIEW_REPLAY_ACTION = 103,
|
|
148
|
+
H5_MEDIA_ELEMENT_EVENT = 104,
|
|
149
|
+
H5_WORKAROUND_SEEK = 105,
|
|
150
|
+
MINIPLAYER_REWIND_BUTTON = 106,
|
|
151
|
+
MINIPLAYER_FAST_FORWARD_BUTTON = 107,
|
|
152
|
+
SABR_RELOAD_PLAYER_RESPONSE_TOKEN_SEEK = 108,
|
|
153
|
+
SLIDE_ON_SCRUBBER_BAR_CHAPTER = 109,
|
|
154
|
+
ANDROID_CLEAR_BUFFER = 110,
|
|
155
|
+
UNRECOGNIZED = -1
|
|
156
|
+
}
|
|
157
|
+
export declare enum OnesieRequestTarget {
|
|
158
|
+
UNKNOWN = 0,
|
|
159
|
+
ENCRYPTED_PLAYER_SERVICE = 1,
|
|
160
|
+
ENCRYPTED_WATCH_SERVICE_DEPRECATED = 2,
|
|
161
|
+
ENCRYPTED_WATCH_SERVICE = 3,
|
|
162
|
+
INNERTUBE_ENCRYPTED_SERVICE = 4,
|
|
163
|
+
UNRECOGNIZED = -1
|
|
164
|
+
}
|
|
3
165
|
export interface HttpHeader {
|
|
4
166
|
name?: string | undefined;
|
|
5
167
|
value?: string | undefined;
|
|
@@ -9,39 +171,36 @@ export interface FormatId {
|
|
|
9
171
|
lastModified?: number | undefined;
|
|
10
172
|
xtags?: string | undefined;
|
|
11
173
|
}
|
|
12
|
-
export interface
|
|
174
|
+
export interface Range {
|
|
175
|
+
legacyStart?: number | undefined;
|
|
176
|
+
legacyEnd?: number | undefined;
|
|
13
177
|
start?: number | undefined;
|
|
14
178
|
end?: number | undefined;
|
|
15
179
|
}
|
|
16
|
-
export interface
|
|
17
|
-
|
|
18
|
-
|
|
180
|
+
export interface IdentifierToken {
|
|
181
|
+
requestNumber?: number | undefined;
|
|
182
|
+
field5?: number | undefined;
|
|
19
183
|
}
|
|
20
184
|
export interface KeyValuePair {
|
|
21
185
|
key?: string | undefined;
|
|
22
186
|
value?: string | undefined;
|
|
23
187
|
}
|
|
188
|
+
export interface AuthorizedFormat {
|
|
189
|
+
trackType?: number | undefined;
|
|
190
|
+
isHdr?: boolean | undefined;
|
|
191
|
+
}
|
|
192
|
+
export interface PlaybackAuthorization {
|
|
193
|
+
authorizedFormats: AuthorizedFormat[];
|
|
194
|
+
sabrLicenseConstraint?: Uint8Array | undefined;
|
|
195
|
+
}
|
|
24
196
|
export declare const HttpHeader: MessageFns<HttpHeader>;
|
|
25
197
|
export declare const FormatId: MessageFns<FormatId>;
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
198
|
+
export declare const Range: MessageFns<Range>;
|
|
199
|
+
export declare const IdentifierToken: MessageFns<IdentifierToken>;
|
|
28
200
|
export declare const KeyValuePair: MessageFns<KeyValuePair>;
|
|
29
|
-
|
|
30
|
-
export
|
|
31
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
32
|
-
} : Partial<T>;
|
|
33
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
34
|
-
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
35
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
36
|
-
} & {
|
|
37
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
38
|
-
};
|
|
201
|
+
export declare const AuthorizedFormat: MessageFns<AuthorizedFormat>;
|
|
202
|
+
export declare const PlaybackAuthorization: MessageFns<PlaybackAuthorization>;
|
|
39
203
|
export interface MessageFns<T> {
|
|
40
204
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
41
205
|
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
42
|
-
fromJSON(object: any): T;
|
|
43
|
-
toJSON(message: T): unknown;
|
|
44
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
45
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
46
206
|
}
|
|
47
|
-
export {};
|