According to this answer [1], YouTube Watch Later access through YouTube API v3 seems very limited, so I think I'm going to restrict this question to adding to a playlist instead.
Anyways, this is what I think the workflow to achieve this would be:
Loop through the pages of videos in a channel with YouTube API. Something like this:
https://www.googleapis.com/youtube/v3/channels?part=contentDetails&key={{YOUTUBE_API_KEY}}&forUsername={{CHANNEL_USERNAME}}&order=date&maxResults=50But I'm getting a weird response like this (I used Veritasium's channel for this example):
{"kind": "youtube#channelListResponse","etag": "rKBMFgDUZ01YcV1szgI433m_NI4","pageInfo": {"totalResults": 1,"resultsPerPage": 50 },"items": [ {"kind": "youtube#channel","etag": "fdmldzetq8235Eh_T--brsjat6M","id": "UCHnyfMqiRRG1u-2MsSQLbXA","contentDetails": {"relatedPlaylists": {"likes": "","uploads": "UUHnyfMqiRRG1u-2MsSQLbXA" } } } ]}Use YouTube API to add all videos to a playlist (need OAuth key?). Is it even possible?
If you can, I would greatly appreciate a script for this. I personally typically use TypeScript or Bash for doing these types of scripts, but whatever language will suffice.
References
- Is there a way to get the "Watch Later" playlist using YouTube API v3?
- YouTube API to fetch all videos on a channel
- The answers on this one seem very odd, cause the question is about all videos on a channel, but the answers are mostly about all videos in playlists.