Skip to content

[info][external] innertube fetching #1257

Closed
@mchangrh

Description

@mchangrh

This code was working as of March 31, 2022 - Keys might expire, endpoints might move & other factors apply

update - this can be done in the content script

security policies in place

the Origin header has to either be empty or contain the string "youtube" or "google"

request information

using keys provided by tombulled/innertube
with
url: www.youtube.com/youtubei/v1/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8
body:

context: {
  client: {
    clientName: "WEB",
    clientVersion: "2.20200720.00.02"
},
videoId: sponsorVideoID

response parsing

the original intention was to fetch the channelID and title from the innertube response

const ownerObj = resultData.contents.twoColumnWatchNextResults.results.results.contents[1].videoSecondaryInfoRenderer.owner.videoOwnerRenderer.title.runs[0]
const title = ownerObj.text
const channelID = ownerObj.navigationEndpoint.browseEndpoint.browseId

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions