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

Investigate alternative video info API (used for determining if a video is new and whitelisting) #751

Closed
ajayyy opened this issue May 20, 2021 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@ajayyy
Copy link
Owner

ajayyy commented May 20, 2021

The API previously used to get channel IDs doesn't work anymore (#741). Right now, it is reading the channel ID from the page, but this is slow as that part of the page loads late. It also does not work on Invidious embeds.

Another method to determine this, such as by an API call, would solve this.

@ajayyy ajayyy added the help wanted Extra attention is needed label May 20, 2021
@fluffy-critter
Copy link

If you're able to do OAuth signin, the YouTube data API has videos.list; if you call it with a part of snippet, the returned data will include the channel ID.

However I think this approach does require registering your app with Google and there's a quota on it; by default you can only query this API 10,000 times a day, although you can ask Google to get that raised. (Although considering the nature of this extension they probably wouldn't be particularly happy to.)

@ajayyy
Copy link
Owner Author

ajayyy commented May 20, 2021

They don't like that it "modifies the YouTube UI", so refused my quota extension, so it will have to be through an unofficial API.

@fluffy-critter
Copy link

Yeah, that's unfortunate, but expected. Oh well. Hopefully you can find something... I've noticed that YouTube is lately very aggressive about detecting anything that looks like data scraping and they're going out of their way to prevent it. I wouldn't be surprised if they purposefully made the channel ID take longer to show up just to prevent things like this from working well.

@ajayyy ajayyy pinned this issue May 20, 2021
@FireMasterK
Copy link

You could give my API a try:
https://pipedapi.kavin.rocks/streams/dQw4w9WgXcQ

The channel id can be found in uploaderUrl in the JSON response.

I also have servers in 3 locations which should help you with latency, wherever it is.

@ajayyy
Copy link
Owner Author

ajayyy commented May 21, 2021

@FireMasterK Thanks, but I don't want to leak the videoID to any 3rd party services, since the extension now uses ajayyy/SponsorBlockServer#25 to prevent leaking the videoID to the SponsorBlock server.

@FireMasterK
Copy link

In that case, you could consider using the innertube api for this which should have this information.

@ajayyy ajayyy changed the title Investigate alternative video info API Investigate alternative video info API (used for determining if a video is new and whitelisting) May 21, 2021
@ajayyy
Copy link
Owner Author

ajayyy commented Jun 4, 2021

zerodytrash/Simple-YouTube-Age-Restriction-Bypass@1874086

This might only work or the initial video.

@ajayyy
Copy link
Owner Author

ajayyy commented Jun 11, 2021

Adding &html5=1 seems to make the API work again

@ajayyy ajayyy closed this as completed in ac037c6 Jun 11, 2021
@ajayyy ajayyy unpinned this issue Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants