8
n8n 中文网amn8n.com

Instagram视频下载至Google云端硬盘并自动邮件发送

中级

这是一个File Management领域的自动化工作流,包含 15 个节点。主要使用 If, EmailSend, FormTrigger, GoogleDrive, HttpRequest 等节点。 将Instagram视频下载到Google云端硬盘,并自动通过邮件发送

前置要求
  • Google Drive API 凭证
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "60c025075753afcab9f803964b4caaca9402f435deb4efafbb8e3b93b54d8752"
  },
  "nodes": [
    {
      "id": "adba156d-f31e-482b-87ee-40800c553e21",
      "name": "n8n Form Trigger",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        1120,
        520
      ],
      "webhookId": "5192b179-44d9-4ca6-9bb7-0111d481ee16",
      "parameters": {
        "options": {},
        "formTitle": "Instagram To Mp4",
        "formFields": {
          "values": [
            {
              "fieldLabel": "url"
            },
            {
              "fieldLabel": "email"
            }
          ]
        },
        "formDescription": "Instagram To Mp4 Downloader"
      },
      "typeVersion": 2.2
    },
    {
      "id": "1db2e5d0-5129-45e7-9a40-3deba9fcaed1",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        320
      ],
      "parameters": {
        "height": 360,
        "content": "**n8n Form Trigger**"
      },
      "typeVersion": 1
    },
    {
      "id": "1375ec94-2db9-408d-a259-3394b40b9dea",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        320
      ],
      "parameters": {
        "height": 360,
        "content": "**API Request**"
      },
      "typeVersion": 1
    },
    {
      "id": "08f49617-2164-489b-8a0e-9d8e1c8d1dbb",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1760,
        300
      ],
      "parameters": {
        "height": 360,
        "content": "**Check for API Error**"
      },
      "typeVersion": 1
    },
    {
      "id": "edbf05ef-28ce-4d63-80f9-c9553b083a96",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2060,
        300
      ],
      "parameters": {
        "width": 220,
        "height": 360,
        "content": "**Download Instagram Video**"
      },
      "typeVersion": 1
    },
    {
      "id": "80799827-7c68-4956-b764-f7d9eb9b965d",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2320,
        300
      ],
      "parameters": {
        "height": 360,
        "content": "**Upload To Google Drive**"
      },
      "typeVersion": 1
    },
    {
      "id": "27997f6d-bb16-407e-b8e2-9e7998064684",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2620,
        300
      ],
      "parameters": {
        "height": 360,
        "content": "**Set permissions Google Drive (Share)**"
      },
      "typeVersion": 1
    },
    {
      "id": "2f01c571-a958-4264-bf38-56f98e76bc02",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2920,
        300
      ],
      "parameters": {
        "height": 360,
        "content": "**Deliver Download Link to User**"
      },
      "typeVersion": 1
    },
    {
      "id": "1f550fe8-9302-4b4b-801f-fb7ea316c921",
      "name": "Upload To Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2360,
        500
      ],
      "parameters": {
        "name": "=",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": "root",
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "qUtlCnYpk7bXXaYp",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "01c9373c-405e-4184-9118-2d9369297ead",
      "name": "Set permissions Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2680,
        500
      ],
      "parameters": {
        "fileId": "={{ $json.resource.id }}",
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "reader",
            "type": "anyone"
          }
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "qUtlCnYpk7bXXaYp",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "2b8b6c94-d557-45ad-931f-f9ddd76dd4fa",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        160
      ],
      "parameters": {
        "width": 620,
        "height": 2100,
        "content": "# 📥 Instagram转MP4 – 下载并上传至Google Drive,附带自动邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "cf0d989d-6fd3-4f56-b141-ab9895018d63",
      "name": "API Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1480,
        520
      ],
      "parameters": {
        "url": "https://instagram-video-downloader13.p.rapidapi.com/index.php",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "={{ $json.url }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "instagram-video-downloader13.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "YOUR_API_KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "57fe215b-33c8-4a93-81f0-7d761c6c7bb9",
      "name": "Check for API Error",
      "type": "n8n-nodes-base.if",
      "position": [
        1800,
        520
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "71b56363-9bc8-4516-801d-26dea43f61f3",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "5058de96-27e8-469c-9e1c-4c8119bd77f1",
      "name": "Download Instagram Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2100,
        500
      ],
      "parameters": {
        "url": "={{ $json.medias[0].url }}",
        "options": {
          "timeout": 10000000,
          "redirect": {
            "redirect": {
              "maxRedirects": 10
            }
          },
          "response": {
            "response": {
              "neverError": true,
              "fullResponse": true
            }
          },
          "lowercaseHeaders": false
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "user-agent",
              "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
            },
            {
              "name": "accept",
              "value": "*/*"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "9233e6c3-b6ef-44dc-a748-fd14cd1406d9",
      "name": "Deliver Download Link to User",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2980,
        500
      ],
      "parameters": {
        "text": "Your download link: {{ $json.webViewLink }}",
        "options": {},
        "subject": "🎵 Your Instagram MP4 is ready!",
        "toEmail": "={{ $json.email }}",
        "fromEmail": "your@email.com"
      },
      "credentials": {
        "smtp": {
          "id": "H0f4Gja9ECFRA34L",
          "name": "SMTP account 2"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "API Request": {
      "main": [
        [
          {
            "node": "Check for API Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n Form Trigger": {
      "main": [
        [
          {
            "node": "API Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for API Error": {
      "main": [
        [
          {
            "node": "Download Instagram Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload To Google Drive": {
      "main": [
        [
          {
            "node": "Set permissions Google Drive ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Instagram Video": {
      "main": [
        [
          {
            "node": "Upload To Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set permissions Google Drive ": {
      "main": [
        [
          {
            "node": "Deliver Download Link to User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 文件管理

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量15
分类1
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流