Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[info][external] innertube fetching #1257

Closed
mchangrh opened this issue Apr 1, 2022 · 0 comments
Closed

[info][external] innertube fetching #1257

mchangrh opened this issue Apr 1, 2022 · 0 comments

Comments

@mchangrh
Copy link
Contributor

mchangrh commented Apr 1, 2022

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
@mchangrh mchangrh closed this as completed Apr 1, 2022
mchangrh added a commit to mchangrh/SponsorBlock that referenced this issue Apr 1, 2022
- purge getVideoInfo as data structure is outdated + currently impossible ajayyy#1257
- remove additional regex check on getChannelID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant