Closed ajayyy closed 3 years ago
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.)
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.
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.
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.
@FireMasterK Thanks, but I don't want to leak the videoID to any 3rd party services, since the extension now uses https://github.com/ajayyy/SponsorBlockServer/issues/25 to prevent leaking the videoID to the SponsorBlock server.
In that case, you could consider using the innertube api for this which should have this information.
This might only work or the initial video.
Adding &html5=1
seems to make the API work again
The API previously used to get channel IDs doesn't work anymore (https://github.com/ajayyy/SponsorBlock/issues/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.