Skip to content

Allow configuring playbackContext in getInfo #1103

@mmjee

Description

@mmjee

Describe your suggestion

In the example of playing a video from YouTube using InnerTube and GoogleVideo, the streaming data needs to be fetched with { adPlaybackContext: { pyv: true } } apparently. I don't know the significance of this but it doesn't work without this.

However, if I wanted to use InnerTube's getInfo to get the streaming data alongside other metadata, it doesn't pass this and doesn't allow configuring it to pass this. I made it work by simply hard-coding it in my fork but I think there needs to be a way to configure the playbackContext.

diff --git a/src/Innertube.ts b/src/Innertube.ts
index 62f3e93c..8ef0f324 100644
--- a/src/Innertube.ts
+++ b/src/Innertube.ts
@@ -91,6 +91,9 @@ export default class Innertube {
 
     const extra_payload: Record<string, any> = {
       playbackContext: {
+        adPlaybackContext: {
+          pyv: true
+        },
         contentPlaybackContext: {
           vis: 0,
           splay: false,

Other details

No response

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions