In order to use the YouTube API and access your account, an OAuth authentication is required. This is done one time and the received refresh token saved in a file on your server.
The OAuth process also requires a client ID (OAUTH_CLIENTID
) and secret (OAUTH_CLIENTSECRET
) (see config.php
). Please get your own key by creating a new project on Google Console.
The problem with the YouTube API v3 is, that it is not possible to only request all new subscription videos. This was possible in the past, directly as RSS feed.
What I'm doing now, is request all activities which includes all subscription videos and filter by upload. But since a request is limited to maximal 50 results at a time, a lot of not-video-upload-activities may push out video uploads.
To counter this, you can go to youtube.com/subscription_manager, select all, and choose to only have uploads shown in your activity feed.
- Create a new project, for example call it yt-nsv.
- In APIs & auth > APIs enable YouTube Data API v3. Disable everything else.
- In APIs & auth > Credentials create a new Client ID for a web application.
- Should the application fail to create the file specified by
OAUTH_REFRESHTOKEN_FILE
(seeconfig.php
), just create it yourself and set its permissions to 666.
- Only for 1 user.