yt-fts icon indicating copy to clipboard operation
yt-fts copied to clipboard

Only fetch videos with CC

Open KevinColemanInc opened this issue 8 months ago • 2 comments

I think yt-dlp fetches all the videos in a channel, then fetches the stats of each video (checking to see if there are captions).

Large channels with single-digit number number of videos with captions are slow to download (and hit api limits).

The (paid and official) YouTube API allows you to retrieve the video IDs with captions in a specific channel.

curl

curl \
  'https://youtube.googleapis.com/youtube/v3/search?channelId=[ChannelID]&part=id&type=video&videoCaption=closedCaption&key=[KEY]' \
  --header 'Accept: application/json' \
  --compressed

response

{
  "kind": "youtube#searchListResponse",
  "etag": "995jyKTI3Q_SpXkNvcBCDR77qP0",
  "nextPageToken": "CAUQAA",
  "regionCode": "",
  "pageInfo": {
    "totalResults": 141,
    "resultsPerPage": 5
  },
  "items": [
    {
      "kind": "youtube#searchResult",
      "etag": "",
      "id": {
        "kind": "youtube#video",
        "videoId": ""
      }
    },
    {
      "kind": "youtube#searchResult",
      "etag": "",
      "id": {
        "kind": "youtube#video",
        "videoId": ""
      }
    },
    {
      "kind": "youtube#searchResult",
      "etag": "",
      "id": {
        "kind": "youtube#video",
        "videoId": ""
      }
    },
    {
      "kind": "youtube#searchResult",
      "etag": "",
      "id": {
        "kind": "youtube#video",
        "videoId": ""
      }
    },
    {
      "kind": "youtube#searchResult",
      "etag": "",
      "id": {
        "kind": "youtube#video",
        "videoId": ""
      }
    }
  ]
}

KevinColemanInc avatar Nov 04 '23 02:11 KevinColemanInc