Use YouTube Data API v3 to detect which captions need to be downloaded to reduce the workload of yt-dlp #5

Closed
opened 2022-12-30 16:08:41 +01:00 by Benjamin_Loison · 1 comment

For instance o8NPllzkFhE has English auto-generated and not auto-generated captions but also not auto-generated captions for many other languages.

Thanks to YouTube Data API v3 Captions: list endpoint which doesn't require OAuth,

https://yt.lemnoslife.com/noKey/captions?part=snippet&videoId=o8NPllzkFhE

returns:

{
  "kind": "youtube#captionListResponse",
  "etag": "eZ4pML3jCdSxjPCRhyWvH7nMa0s",
  "items": [
    {
      "kind": "youtube#caption",
      "etag": "7raZhEYvFCS9MwLKOjW5pPF7BXw",
      "id": "AUieDaZ8x9nwAN2cK8895ywCcmz49iZctbG81Ovocmgg",
      "snippet": {
        "videoId": "o8NPllzkFhE",
        "lastUpdated": "2017-10-26T05:13:24.943773Z",
        "trackKind": "standard",
        "language": "ar",
        "name": "",
        "audioTrackType": "unknown",
        "isCC": false,
        "isLarge": false,
        "isEasyReader": false,
        "isDraft": false,
        "isAutoSynced": false,
        "status": "serving"
      }
    },
    {
      "kind": "youtube#caption",
      "etag": "a9DNn3s5o6I3tZil9nKEB3_5s3I",
      "id": "AUieDabxfZrqqConqQVjbMhVHuONncnqo1SgXpm4OTqYcsQkTws",
      "snippet": {
        "videoId": "o8NPllzkFhE",
        "lastUpdated": "2021-04-30T16:37:45.813712Z",
        "trackKind": "asr",
        "language": "en",
        "name": "",
        "audioTrackType": "unknown",
        "isCC": false,
        "isLarge": false,
        "isEasyReader": false,
        "isDraft": false,
        "isAutoSynced": false,
        "status": "serving"
      }
    },
    {
      "kind": "youtube#caption",
      "etag": "THUyFxy089bEVfTO6JmdVWFJeAA",
      "id": "AUieDaZMBT1mc642LsRsrYydeiGxuwKAwVSpfMdpC4gt",
      "snippet": {
        "videoId": "o8NPllzkFhE",
        "lastUpdated": "2019-02-14T09:02:01.320387Z",
        "trackKind": "standard",
        "language": "az",
        "name": "",
        "audioTrackType": "unknown",
        "isCC": false,
        "isLarge": false,
        "isEasyReader": false,
        "isDraft": false,
        "isAutoSynced": false,
        "status": "serving"
      }
    },
    ...
    {
      "kind": "youtube#caption",
      "etag": "6u0rriJpLf0dsEnjugXsIs9ufBM",
      "id": "AUieDaY2-og3KCf7oqT1nncb16x940K6tzRwPrRtcMS0",
      "snippet": {
        "videoId": "o8NPllzkFhE",
        "lastUpdated": "2017-10-26T05:13:18.669212Z",
        "trackKind": "standard",
        "language": "el",
        "name": "",
        "audioTrackType": "unknown",
        "isCC": false,
        "isLarge": false,
        "isEasyReader": false,
        "isDraft": false,
        "isAutoSynced": false,
        "status": "serving"
      }
    },
    {
      "kind": "youtube#caption",
      "etag": "yLecM9KX8sogzUO9VzEWdjmhmiM",
      "id": "AUieDaZmxwhOXO_ARX5Fp8wdMdywZ1O1sJ0hNMaio4rP",
      "snippet": {
        "videoId": "o8NPllzkFhE",
        "lastUpdated": "2017-10-26T05:13:19.881248Z",
        "trackKind": "standard",
        "language": "en",
        "name": "",
        "audioTrackType": "unknown",
        "isCC": false,
        "isLarge": false,
        "isEasyReader": false,
        "isDraft": false,
        "isAutoSynced": false,
        "status": "serving"
      }
    },
    {
      "kind": "youtube#caption",
      "etag": "Uci5L1ZlTCig74h4nbYhK5OsSZc",
      "id": "AUieDaYLhf7na1htIkpqWVtX2kr--Thh189LgRbND4A6",
      "snippet": {
        "videoId": "o8NPllzkFhE",
        "lastUpdated": "2017-10-26T05:13:28.525599Z",
        "trackKind": "standard",
        "language": "es",
        "name": "",
        "audioTrackType": "unknown",
        "isCC": false,
        "isLarge": false,
        "isEasyReader": false,
        "isDraft": false,
        "isAutoSynced": false,
        "status": "serving"
      }
    },
    ...
  ]
}
For instance [`o8NPllzkFhE`](https://www.youtube.com/watch?v=o8NPllzkFhE) has English auto-generated and not auto-generated captions but also not auto-generated captions for many other languages. Thanks to YouTube Data API v3 [Captions: list](https://developers.google.com/youtube/v3/docs/captions/list) endpoint which doesn't require OAuth, https://yt.lemnoslife.com/noKey/captions?part=snippet&videoId=o8NPllzkFhE returns: ```json { "kind": "youtube#captionListResponse", "etag": "eZ4pML3jCdSxjPCRhyWvH7nMa0s", "items": [ { "kind": "youtube#caption", "etag": "7raZhEYvFCS9MwLKOjW5pPF7BXw", "id": "AUieDaZ8x9nwAN2cK8895ywCcmz49iZctbG81Ovocmgg", "snippet": { "videoId": "o8NPllzkFhE", "lastUpdated": "2017-10-26T05:13:24.943773Z", "trackKind": "standard", "language": "ar", "name": "", "audioTrackType": "unknown", "isCC": false, "isLarge": false, "isEasyReader": false, "isDraft": false, "isAutoSynced": false, "status": "serving" } }, { "kind": "youtube#caption", "etag": "a9DNn3s5o6I3tZil9nKEB3_5s3I", "id": "AUieDabxfZrqqConqQVjbMhVHuONncnqo1SgXpm4OTqYcsQkTws", "snippet": { "videoId": "o8NPllzkFhE", "lastUpdated": "2021-04-30T16:37:45.813712Z", "trackKind": "asr", "language": "en", "name": "", "audioTrackType": "unknown", "isCC": false, "isLarge": false, "isEasyReader": false, "isDraft": false, "isAutoSynced": false, "status": "serving" } }, { "kind": "youtube#caption", "etag": "THUyFxy089bEVfTO6JmdVWFJeAA", "id": "AUieDaZMBT1mc642LsRsrYydeiGxuwKAwVSpfMdpC4gt", "snippet": { "videoId": "o8NPllzkFhE", "lastUpdated": "2019-02-14T09:02:01.320387Z", "trackKind": "standard", "language": "az", "name": "", "audioTrackType": "unknown", "isCC": false, "isLarge": false, "isEasyReader": false, "isDraft": false, "isAutoSynced": false, "status": "serving" } }, ... { "kind": "youtube#caption", "etag": "6u0rriJpLf0dsEnjugXsIs9ufBM", "id": "AUieDaY2-og3KCf7oqT1nncb16x940K6tzRwPrRtcMS0", "snippet": { "videoId": "o8NPllzkFhE", "lastUpdated": "2017-10-26T05:13:18.669212Z", "trackKind": "standard", "language": "el", "name": "", "audioTrackType": "unknown", "isCC": false, "isLarge": false, "isEasyReader": false, "isDraft": false, "isAutoSynced": false, "status": "serving" } }, { "kind": "youtube#caption", "etag": "yLecM9KX8sogzUO9VzEWdjmhmiM", "id": "AUieDaZmxwhOXO_ARX5Fp8wdMdywZ1O1sJ0hNMaio4rP", "snippet": { "videoId": "o8NPllzkFhE", "lastUpdated": "2017-10-26T05:13:19.881248Z", "trackKind": "standard", "language": "en", "name": "", "audioTrackType": "unknown", "isCC": false, "isLarge": false, "isEasyReader": false, "isDraft": false, "isAutoSynced": false, "status": "serving" } }, { "kind": "youtube#caption", "etag": "Uci5L1ZlTCig74h4nbYhK5OsSZc", "id": "AUieDaYLhf7na1htIkpqWVtX2kr--Thh189LgRbND4A6", "snippet": { "videoId": "o8NPllzkFhE", "lastUpdated": "2017-10-26T05:13:28.525599Z", "trackKind": "standard", "language": "es", "name": "", "audioTrackType": "unknown", "isCC": false, "isLarge": false, "isEasyReader": false, "isDraft": false, "isAutoSynced": false, "status": "serving" } }, ... ] } ```
Benjamin_Loison added the
medium
label 2023-01-06 18:50:46 +01:00
Benjamin_Loison added the
enhancement
label 2023-01-06 18:52:52 +01:00
Benjamin_Loison added the
high priority
label 2023-01-06 19:33:33 +01:00
Benjamin_Loison added the
captions
label 2023-01-14 15:29:26 +01:00
Author
Owner

As we completely rely on yt-dlp, we don't have to bother with this optimization aspect, at least for the moment.

As [we completely rely on `yt-dlp`](https://gitea.lemnoslife.com/Benjamin_Loison/YouTube_captions_search_engine/wiki/Project-proposal#technical-details), we don't have to bother with this optimization aspect, at least for the moment.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Benjamin_Loison/YouTube_captions_search_engine#5
No description provided.