Create YouTube Feed

Create YouTube feed to ingest audio files.

Graphlit supports ingesting audio from YouTube videos, playlists and channels.

The createFeed mutation enables the creation of a feed by accepting the feed name, type and youtube feed parameters and it returns essential details, including the ID, name, state, and type of the newly generated feed.

Depending on the specified type parameter, Graphlit requires the specific feed parameters including the YouTube videoIdentifiers, playlistIdentifier or channelIdentifier.

Graphlit only ingests the audio track from YouTube videos, which will get transcribed, and be added to your conversational knowledge graph.

YouTube rate limits the download throughput, so it is expected that YouTube content will be slower to ingest than other feed types. Once cached in Graphlit, the rest of the content workflow will execute with the same performance as other feed types.

In our testing, we have seen that some YouTube videos are inaccessible for download. If we are unable to ingest a YouTube video, we will auto-delete the Content entity generated by the feed, and not proceed with the assigned content workflow.

Videos

When ingesting one or more YouTube videos, assign the type property to VIDEO, and assign the videoIdentifiers array to the list of YouTube video identifiers.

For example, if you have a YouTube video URL like:

https://www.youtube.com/watch?v=oc6RV5c1yd0

The video identifier is the v parameter of the video URI query string: oc6RV5c1yd0

Create YouTube Video Feed

Mutation:

mutation CreateFeed($feed: FeedInput!) {
  createFeed(feed: $feed) {
    id
    name
    state
    type
  }
}

Variables:

{
  "feed": {
    "type": "YOU_TUBE",
    "youtube": {
      "type": "VIDEO",
      "videoIdentifiers": [
        "--khbXchTeE"
      ]
    },
    "schedulePolicy": {
      "recurrenceType": "ONCE"
    },
    "name": "YouTube Video"
  }
}

Response:

{
  "type": "YOU_TUBE",
  "id": "b5517114-2f37-4cdf-ad6e-fc33c75656c2",
  "name": "YouTube Video",
  "state": "ENABLED"
}

Playlist

When ingesting a YouTube playlist, assign the type property to PLAYLIST, and assign the playlistIdentifier to the YouTube playlist identifier.

For example, if you have a YouTube playlist URL like:

https://www.youtube.com/playlist?list=PLOXw6I10VTv9DFXRidukLC2hgAAkmexWx

The playlist identifier is list parameter of the playlist URI query string: PLOXw6I10VTv9DFXRidukLC2hgAAkmexWx

YouTube playlist identifiers typically start with the characters PL.

Create YouTube Playlist Feed

Mutation:

mutation CreateFeed($feed: FeedInput!) {
  createFeed(feed: $feed) {
    id
    name
    state
    type
  }
}

Variables:

{
  "feed": {
    "type": "YOU_TUBE",
    "youtube": {
      "type": "PLAYLIST",
      "playlistIdentifier": "PLOXw6I10VTv9DFXRidukLC2hgAAkmexWx"
    },
    "schedulePolicy": {
      "recurrenceType": "ONCE"
    },
    "name": "YouTube Playlist"
  }
}

Response:

{
  "type": "YOU_TUBE",
  "id": "a97d7ff6-cb31-4db9-a4ad-52a0d377bfe2",
  "name": "YouTube Playlist",
  "state": "ENABLED"
}

Channel

When ingesting a YouTube channel, assign the type property to CHANNEL, and assign the channelIdentifier to the YouTube channel identifier.

For example, if you have a YouTube channel URL like:

https://www.youtube.com/channel/UCXZCJLdBC09xxGZ6gcdrc6A

The channel identifier is the last segment of the channel URI: UCXZCJLdBC09xxGZ6gcdrc6A.

YouTube channel identifiers typically start with the characters UC.

Create YouTube Channel Feed

Mutation:

mutation CreateFeed($feed: FeedInput!) {
  createFeed(feed: $feed) {
    id
    name
    state
    type
  }
}

Variables:

{
  "feed": {
    "type": "YOU_TUBE",
    "youtube": {
      "type": "CHANNEL",
      "channelIdentifier": "UCXZCJLdBC09xxGZ6gcdrc6A"
    },
    "schedulePolicy": {
      "recurrenceType": "ONCE"
    },
    "name": "YouTube Channel"
  }
}

Response:

{
  "type": "YOU_TUBE",
  "id": "6b3a046c-4d81-4c70-b99b-7cb773f8c1ac",
  "name": "YouTube Channel",
  "state": "ENABLED"
}

Identifying the Channel ID

if you have a YouTube channel URI in the format https://www.youtube.com/@OpenAI, this is known as a YouTube vanity URL, and the term @OpenAI at the end cannot be used as the channel identifier.

By clicking on a YouTube channel's About tag, and clicking on the Share icon, you can copy the channel ID.

Last updated