{
  "name": "Youtube Scraper",
  "nodes": [
    {
      "parameters": {
        "resource": "video",
        "limit": 15,
        "filters": {
          "channelId": "={{ $json.ChannelID }}"
        },
        "options": {
          "order": "date"
        }
      },
      "type": "n8n-nodes-base.youTube",
      "typeVersion": 1,
      "position": [
        912,
        304
      ],
      "id": "f5445ff0-b63a-4732-83e5-f25fdfa45a85",
      "name": "Get many videos"
    },
    {
      "parameters": {
        "resource": "video",
        "operation": "get",
        "videoId": "={{ $json.id.videoId }}",
        "options": {}
      },
      "type": "n8n-nodes-base.youTube",
      "typeVersion": 1,
      "position": [
        560,
        544
      ],
      "id": "45e6f94b-77f4-4c0b-a262-6bce75ffdfc3",
      "name": "Get a video"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1BHIu1gCQk2n0O46tYOOOG3zvpkGYchmfrEQ1NyaS8Dk",
          "mode": "list",
          "cachedResultName": "Youtube Videos",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BHIu1gCQk2n0O46tYOOOG3zvpkGYchmfrEQ1NyaS8Dk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 177033599,
          "mode": "list",
          "cachedResultName": "Channels",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BHIu1gCQk2n0O46tYOOOG3zvpkGYchmfrEQ1NyaS8Dk/edit#gid=177033599"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        688,
        304
      ],
      "id": "2699756a-2ffd-4f44-9b24-0bef07207992",
      "name": "Get Channel Ids"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        480,
        304
      ],
      "id": "683ade15-475b-475a-a5d1-6208e06aae4b",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "1BHIu1gCQk2n0O46tYOOOG3zvpkGYchmfrEQ1NyaS8Dk",
          "mode": "list",
          "cachedResultName": "Youtube Videos",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BHIu1gCQk2n0O46tYOOOG3zvpkGYchmfrEQ1NyaS8Dk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1BHIu1gCQk2n0O46tYOOOG3zvpkGYchmfrEQ1NyaS8Dk/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "id": "={{ $json.id }}",
            "channelId": "={{ $json.snippet.channelId }}",
            "publishedAt": "={{ new Date($json.snippet.publishedAt).toLocaleDateString('en-GB') }}\n",
            "tags": "={{ $json.snippet.tags }}",
            "title": "={{ $json.snippet.title }}",
            "description": "={{ $json.snippet.description }}",
            "viewCount": "={{ $json.statistics.viewCount }}",
            "likeCount": "={{ $json.statistics.likeCount }}",
            "commentCount": "={{ $json.statistics.commentCount }}",
            "thumbnail": "==Image(\"{{ $json.snippet.thumbnails.maxres.url }}\")"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "thumbnail",
              "displayName": "thumbnail",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "description",
              "displayName": "description",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "viewCount",
              "displayName": "viewCount",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "likeCount",
              "displayName": "likeCount",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "commentCount",
              "displayName": "commentCount",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "publishedAt",
              "displayName": "publishedAt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "tags",
              "displayName": "tags",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "channelId",
              "displayName": "channelId",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        784,
        544
      ],
      "id": "e3ab1f07-d71f-4978-96e6-56527dd3a8ca",
      "name": "Update Data in Spreadsheet"
    }
  ],
  "pinData": {},
  "connections": {
    "Get many videos": {
      "main": [
        [
          {
            "node": "Get a video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a video": {
      "main": [
        [
          {
            "node": "Update Data in Spreadsheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Channel Ids": {
      "main": [
        [
          {
            "node": "Get many videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Channel Ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0ef5d4b8-f9f3-45ce-88ce-a2f90e0b98ec",
  "meta": {
    "instanceId": "7425b88d6f52190dec1f6e67c1b6cffa1a87557717f26de52e85eaddcf276948"
  },
  "id": "qLbUYW7XDR20Yxfb",
  "tags": []
}