youtube-apiyoutube-data-api

Is it possible to get a one-off quota increase for the YouTube api?


I'm in a situation where I'm trying to add about ~4,000 videos to a YouTube playlist. With the cost-based quota system I can only add about 200 a day, which puts me at about three weeks for this project. Also the list of videos I need to add will continue to grow until I finalize the playlist as it is somewhat submission-based.

Is there some other endpoint I'm missing that would allow for the bulk addition of videos to a single playlist with a lower overall cost? Otherwise, what I'm mostly interest is learning if it possible to pay for a one-off increase and get one day of high quota points? The application for expansion seems to be for More Official Projects and not just someone trying to avoid doing this all manually.

I'm also still a little confused about some aspects of the cost-based quotas as on the dashboard it says I'm allocated 1.8mm per minute, which seems incongruent against the 10k per day limit.

If it matters, I have all of the ids of the videos in both a plaintext document and as a csv if one works better than the other.


Solution

  • Ever wondered how to do that in a single request without using any quota?

    Go on your playlist by using the well-known YouTube interface: https://www.youtube.com/playlist?list=PLAYLIST_ID

    Click on āž, then click Add videos, type in the search bar (of Video search) a video id, noted YOUR_VIDEO_ID. Then select a suggested video.

    Open the Network tab of your web-browser by using Ctrl + Shift + E (on Firefox) and filter XHR requests. Make sure to tick Persist Logs checkbox.

    Now click on Add videos.

    You should see a request to edit_playlist, copy it as cURL (by right-clicking). Change at the end:

    "actions":[{"addedVideoId":"YOUR_VIDEO_ID","action":"ACTION_ADD_VIDEO"}]
    

    to:

    "actions":[{"addedVideoId":"YOUR_VIDEO_ID_0","action":"ACTION_ADD_VIDEO"}, {"addedVideoId":"YOUR_VIDEO_ID_1","action":"ACTION_ADD_VIDEO"}, ..., {"addedVideoId":"YOUR_VIDEO_ID_3999","action":"ACTION_ADD_VIDEO"}]
    

    Where YOUR_VIDEO_ID_0 is your YOUR_VIDEO_ID and YOUR_VIDEO_ID_1 the second video you want to add to the playlist and so forth. Don't modify ACTION_ADD_VIDEO.

    Execute the modified cURL request in a terminal and that's it! It works.

    Note: YouTube playlist are limited to up to 5,000 videos don't go higher than that or you would receive the error Maximum playlist size exceeded.