thankful icon indicating copy to clipboard operation
thankful copied to clipboard

Try out the Youtube API, see if we can get watch history

Open Powersource opened this issue 5 years ago • 4 comments

This would help a ton with mobile support. Tracking what's happening inside other apps doesn't work, but if the app tracks itself, we don't need to.

We have a file called lib/youtube_api.js but it hasn't gotten too far.

Powersource avatar Jul 18 '18 14:07 Powersource

The problem is how to call the YouTube API since we'd need to keep API credentials private which can't be done in our extension. I've been thinking about this in ActivityWatch before and come across the same issue, there might be a way around it, but I'm not sure.

ErikBjare avatar Jul 19 '18 11:07 ErikBjare

How much effort is it for a user to get a personal API key?

Powersource avatar Jul 19 '18 12:07 Powersource

@Powersource Quite a bit, might be acceptable for powerusers but really a terrible experience.

ErikBjare avatar Jul 19 '18 13:07 ErikBjare

Assuming there is some workable solution to the API key issue, the watch history used to be accessible as a pseudo-playlist under /channels/list -> contentDetails.relatedPlaylists.watchHistory. This seems to have been deprecated now though. Seems there is no sanctioned workaround, though it may be possible to manually GET and parse https://www.youtube.com/feed/history. This would at the very least require permissions in the manifest, and might be a bit of a pain since it needs to send the cookie along.

vlthr avatar Jul 19 '18 13:07 vlthr