Descargar música de Spotify a Google Drive y registrar automáticamente en una hoja de cálculo
Este es unFile Managementflujo de automatización del dominio deautomatización que contiene 25 nodos.Utiliza principalmente nodos como If, Code, Wait, FormTrigger, GoogleDrive. Descargar música de Spotify a Google Drive y registrar automáticamente el historial de descargas en una hoja de cálculo
- •Credenciales de API de Google Drive
- •Pueden requerirse credenciales de autenticación para la API de destino
- •Credenciales de API de Google Sheets
Nodos utilizados (25)
Categoría
{
"meta": {
"instanceId": "60c025075753afcab9f803964b4caaca9402f435deb4efafbb8e3b93b54d8752"
},
"nodes": [
{
"id": "8b589726-cc0e-47e1-8ada-b098d551787c",
"name": "Al enviar formulario",
"type": "n8n-nodes-base.formTrigger",
"position": [
-200,
0
],
"webhookId": "00b30d60-ba60-4b3c-a08b-b9f8f7c0dc75",
"parameters": {
"options": {},
"formTitle": "Spotify Music Downloader",
"formFields": {
"values": [
{
"fieldLabel": "Link",
"placeholder": "https://open.spotify.com/track/abcd44?si=ZXw&nd=1&dlsi=b3a",
"requiredField": true
}
]
},
"formDescription": "Paster link of spotify music"
},
"typeVersion": 2.2
},
{
"id": "fe66d327-610b-4c07-955b-4f6a922f14a0",
"name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueRegularOutput",
"position": [
240,
-20
],
"parameters": {
"url": "https://spotify-downloader11.p.rapidapi.com/spotify-downloader.php",
"method": "POST",
"options": {},
"sendBody": true,
"contentType": "multipart-form-data",
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "url",
"value": "={{ $json.Link }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "x-rapidapi-host",
"value": "spotify-downloader11.p.rapidapi.com"
},
{
"name": "x-rapidapi-key",
"value": "your key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "a519e85f-dfa5-436d-833e-31d5ed3cb6f1",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
-20,
0
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d5b4a26a-13eb-487a-9edd-ac831ce8ca1f",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.Link }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "f24f1513-b5ab-4c6a-8f57-2d2a1bb03954",
"name": "If1",
"type": "n8n-nodes-base.if",
"position": [
500,
20
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d5b4a26a-13eb-487a-9edd-ac831ce8ca1f",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.status }}",
"rightValue": "success"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "429a1eb2-ddee-4d3d-85c4-b755c999febe",
"name": "Descargar música",
"type": "n8n-nodes-base.httpRequest",
"position": [
840,
-400
],
"parameters": {
"url": "={{ $json.download_url }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "062222fa-77d3-493b-8f4b-de96590c3c95",
"name": "Google Drive",
"type": "n8n-nodes-base.googleDrive",
"position": [
1120,
-420
],
"parameters": {
"name": "data",
"driveId": {
"__rl": true,
"mode": "id",
"value": "1MH4rVD9lziY-acugKQFoitbE6Gv5vdLl"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1MH4rVD9lziY-acugKQFoitbE6Gv5vdLl",
"cachedResultUrl": "l",
"cachedResultName": "spotify to mp3"
},
"inputDataFieldName": "=data"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "qEkQ8MFn0uSHgAqY",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "1d754442-11ec-4e30-95ff-01b53491f877",
"name": "Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
2500,
0
],
"parameters": {
"columns": {
"value": {
"URL": "={{ $('On form submission').item.json.Link }}",
"Size": "={{ $('Code').item.json.fileSizeInMb }} MB",
"Status": "Success",
"Created at": "={{ $now.format('dd-MM-yyyy') }}",
"Download Link": "={{ $('Google Drive').item.json.webContentLink }}",
"Web View Link": "={{ $('Google Drive').item.json.webViewLink }}"
},
"schema": [
{
"id": "URL",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "URL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Download Link",
"type": "string",
"display": true,
"required": false,
"displayName": "Download Link",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Web View Link",
"type": "string",
"display": true,
"required": false,
"displayName": "Web View Link",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Size",
"type": "string",
"display": true,
"required": false,
"displayName": "Size",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Created at",
"type": "string",
"display": true,
"required": false,
"displayName": "Created at",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"URL"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "15jM_yCs_m72wcoDDYr6wsiXzADgj1efLZDgE3nXbmOg"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "qUtlCnYpk7bXXaYp",
"name": "Google Sheets account 3"
}
},
"typeVersion": 4.6
},
{
"id": "3b745c8b-bbfa-4302-a93f-6ea24d7915da",
"name": "Code",
"type": "n8n-nodes-base.code",
"position": [
1800,
-320
],
"parameters": {
"jsCode": "function kbToMb(kb) {\n return (kb / 1024).toFixed(2); // Convert KB to MB\n}\n\nfunction bytesToKb(bytes) {\n return bytes / 1024; // Convert Bytes to KB\n}\n\n// Get the file size in bytes from the input (from the Google Drive node)\nlet fileSizeInBytes = $('Google Drive').first().json.size;\n\n// Convert bytes to KB first\nlet fileSizeInKb = bytesToKb(fileSizeInBytes);\n\n// Then convert KB to MB\nlet fileSizeInMb = kbToMb(fileSizeInKb);\n\nlet outputData = {\n fileName: $input.first().json.name,\n fileSizeInMb: fileSizeInMb\n};\n\n// Return an array containing the output data\nreturn [{ json: outputData }];\n"
},
"typeVersion": 2
},
{
"id": "e148bc42-ecb2-44af-b8f4-4b713f4b427c",
"name": "Google Sheets1",
"type": "n8n-nodes-base.googleSheets",
"position": [
1440,
200
],
"parameters": {
"columns": {
"value": {
"URL": "={{ $('On form submission').item.json.Link }}",
"Size": "=N/A",
"Status": "=failed",
"Created at": "={{ $now.format('dd-MM-yyyy') }}",
"Download Link": "N/A",
"Web View Link": "=N/A"
},
"schema": [
{
"id": "URL",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "URL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Download Link",
"type": "string",
"display": true,
"required": false,
"displayName": "Download Link",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Web View Link",
"type": "string",
"display": true,
"required": false,
"displayName": "Web View Link",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Size",
"type": "string",
"display": true,
"required": false,
"displayName": "Size",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Created at",
"type": "string",
"display": true,
"required": false,
"displayName": "Created at",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"URL"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "15jM_yCs_m72wcoDDYr6wsiXzADgj1efLZDgE3nXbmOg"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "qUtlCnYpk7bXXaYp",
"name": "Google Sheets account 3"
}
},
"typeVersion": 4.6
},
{
"id": "6885550a-a1e5-46cf-835e-aad57c3a051a",
"name": "Wait",
"type": "n8n-nodes-base.wait",
"position": [
1000,
240
],
"webhookId": "70524744-1b73-4068-941a-f55c8c8feb9c",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "910f0b8d-7e3a-4dd3-932e-453ba5d487d7",
"name": "Wait1",
"type": "n8n-nodes-base.wait",
"position": [
2240,
-320
],
"webhookId": "ac0265ba-f888-4d4b-a88f-a5a94f538b79",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "c4302364-9c96-4f6c-b4ca-85083012a0e8",
"name": "Google Sheets2",
"type": "n8n-nodes-base.googleSheets",
"position": [
1460,
-500
],
"parameters": {
"columns": {
"value": {
"URL": "={{ $('On form submission').item.json.Link }}"
},
"schema": [
{
"id": "URL",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "URL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Download Link",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Download Link",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Web View Link",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Web View Link",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Size",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Size",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Created at",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Created at",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"URL"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "15jM_yCs_m72wcoDDYr6wsiXzADgj1efLZDgE3nXbmOg"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "qUtlCnYpk7bXXaYp",
"name": "Google Sheets account 3"
}
},
"typeVersion": 4.6
},
{
"id": "a622eaef-5494-4294-8a2d-90f6ace4673d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-980,
-300
],
"parameters": {
"width": 560,
"height": 1020,
"content": "# Spotify Music Downloader Flow\n\n**Description**: \nThis workflow allows users to download music from Spotify by pasting a track URL, and then saves the file to Google Drive, logging the details in a Google Sheet.\n\n---\n\n### Node-by-Node Explanation:\n\n1. **On form submission**: \n - Triggers when a user submits a Spotify track URL via a form.\n\n2. **HTTP Request**: \n - Sends a request to the Spotify downloader API to fetch the music download link.\n\n3. **If (Link check)**: \n - Validates that a valid link is provided in the form submission.\n\n4. **If1 (Success check)**: \n - Checks if the download link retrieval was successful.\n\n5. **Download music**: \n - Downloads the music file from the provided URL.\n\n6. **Google Drive**: \n - Uploads the downloaded music file to Google Drive.\n\n7. **Google Sheets**: \n - Logs the success data (download link, file size, etc.) to Google Sheets.\n\n8. **Code**: \n - Calculates the file size in MB from the downloaded file's size in bytes.\n"
},
"typeVersion": 1
},
{
"id": "a6c8f56d-3cd2-4b8e-85d7-98f6d02275ce",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-320,
-200
],
"parameters": {
"height": 340,
"content": "**On form submission**: \n - **Description**: This node is triggered when a user submits a Spotify track URL via a form. \n - **Purpose**: Collects the URL input from the user to start the process."
},
"typeVersion": 1
},
{
"id": "708465a5-c968-459d-844b-27b1c05f39dd",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-60,
-200
],
"parameters": {
"height": 340,
"content": " **If (Link check)**: \n - **Description**: Validates that a valid Spotify track URL is provided in the form submission. \n - **Purpose**: Ensures that the form input is not empty and contains a valid URL before proceeding."
},
"typeVersion": 1
},
{
"id": "43722f14-157e-4ba4-8d18-26681a8eaa6f",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
200,
-200
],
"parameters": {
"height": 340,
"content": "**HTTP Request**: \n - **Description**: Sends a request to the Spotify downloader API to retrieve the music file. \n - **Purpose**: Fetches the music file download link using the provided Spotify URL."
},
"typeVersion": 1
},
{
"id": "a2344ebe-f7bf-4a88-8295-1ff777c25d09",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
460,
-200
],
"parameters": {
"height": 340,
"content": "**If1 (Success check)**: \n - **Description**: Verifies whether the HTTP request for downloading the music was successful. \n - **Purpose**: Ensures that the API response was positive (successful retrieval of the music file)."
},
"typeVersion": 1
},
{
"id": "f2ab9746-ce9c-416b-a0c8-9be6378ce288",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
760,
-560
],
"parameters": {
"height": 320,
"content": " **Download music**: \n - **Description**: Downloads the music file from the provided Spotify URL. \n - **Purpose**: Initiates the actual download of the track to be stored on Google Drive."
},
"typeVersion": 1
},
{
"id": "697e5b8c-887b-4c6d-9c25-4a59f56a663a",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1080,
-600
],
"parameters": {
"height": 360,
"content": "**Google Drive**: \n - **Description**: Uploads the downloaded music file to Google Drive for storage. \n - **Purpose**: Saves the music file in Google Drive, making it available for future access.\n"
},
"typeVersion": 1
},
{
"id": "2a4e9899-d4f4-475a-a36b-9bc45f2ee5ff",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
960,
20
],
"parameters": {
"height": 400,
"content": "**Wait**: \n - **Description**: Introduces a delay between processes. \n - **Purpose**: Ensures that there is enough time for the music file to upload to Google Drive before proceeding with logging the data to Google Sheets.\n"
},
"typeVersion": 1
},
{
"id": "56642ab2-bdbb-457c-beaf-115677a39e2a",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
1420,
-720
],
"parameters": {
"width": 280,
"height": 380,
"content": "7. **Google Sheets**: \n - **Description**: Logs the success details, such as the download link, file size, and timestamp to a Google Sheet. \n - **Purpose**: Creates a record of the download, making it easy to track and manage all downloaded files."
},
"typeVersion": 1
},
{
"id": "3a0fa583-5bc3-4e7e-8cdd-8735cced94ab",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
1740,
-600
],
"parameters": {
"height": 420,
"content": "**Code**: \n - **Description**: Calculates the file size of the downloaded music in MB. \n - **Purpose**: Converts the file size from bytes to MB and formats the output data."
},
"typeVersion": 1
},
{
"id": "d2b90077-85eb-4989-866a-035c96794925",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
2440,
-260
],
"parameters": {
"height": 380,
"content": "**Google Sheets1**: \n - **Description**: Logs successful information, such as the URL and download link, to the primary Google Sheet. \n - **Purpose**: Records the successful download details (e.g., the URL, download link, size, etc.) in the first sheet to track the completed process. It includes data like file size, download status, and date.\n"
},
"typeVersion": 1
},
{
"id": "9f3a15c7-1577-4a55-959c-52a00e6640e6",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
2160,
-560
],
"parameters": {
"height": 380,
"content": "**Wait1**: \n - **Description**: Another wait node, used to introduce additional delays as needed in the flow. \n - **Purpose**: Similar to the previous \"Wait\" node, this node helps manage timing between processes, ensuring smooth execution without overwhelming other parts of the system.\n"
},
"typeVersion": 1
},
{
"id": "859207a9-1ae6-442b-86a2-c0e931d00482",
"name": "Sticky Note12",
"type": "n8n-nodes-base.stickyNote",
"position": [
1380,
-20
],
"parameters": {
"width": 260,
"height": 380,
"content": "**Google Sheets2**: \n - **Description**: Logs the failed downloads (if any) to the secondary Google Sheet, with status \"failed.\" \n - **Purpose**: Creates a record in a separate Google Sheet for any failed downloads, allowing users to track unsuccessful attempts, including the URL submitted and the reason (failure)."
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"a519e85f-dfa5-436d-833e-31d5ed3cb6f1": {
"main": [
[
{
"node": "fe66d327-610b-4c07-955b-4f6a922f14a0",
"type": "main",
"index": 0
}
],
[]
]
},
"f24f1513-b5ab-4c6a-8f57-2d2a1bb03954": {
"main": [
[
{
"node": "429a1eb2-ddee-4d3d-85c4-b755c999febe",
"type": "main",
"index": 0
}
],
[
{
"node": "6885550a-a1e5-46cf-835e-aad57c3a051a",
"type": "main",
"index": 0
}
]
]
},
"3b745c8b-bbfa-4302-a93f-6ea24d7915da": {
"main": [
[
{
"node": "910f0b8d-7e3a-4dd3-932e-453ba5d487d7",
"type": "main",
"index": 0
}
]
]
},
"6885550a-a1e5-46cf-835e-aad57c3a051a": {
"main": [
[
{
"node": "e148bc42-ecb2-44af-b8f4-4b713f4b427c",
"type": "main",
"index": 0
}
]
]
},
"910f0b8d-7e3a-4dd3-932e-453ba5d487d7": {
"main": [
[
{
"node": "1d754442-11ec-4e30-95ff-01b53491f877",
"type": "main",
"index": 0
}
]
]
},
"062222fa-77d3-493b-8f4b-de96590c3c95": {
"main": [
[
{
"node": "c4302364-9c96-4f6c-b4ca-85083012a0e8",
"type": "main",
"index": 0
}
]
]
},
"fe66d327-610b-4c07-955b-4f6a922f14a0": {
"main": [
[
{
"node": "f24f1513-b5ab-4c6a-8f57-2d2a1bb03954",
"type": "main",
"index": 0
}
]
]
},
"429a1eb2-ddee-4d3d-85c4-b755c999febe": {
"main": [
[
{
"node": "062222fa-77d3-493b-8f4b-de96590c3c95",
"type": "main",
"index": 0
}
]
]
},
"c4302364-9c96-4f6c-b4ca-85083012a0e8": {
"main": [
[
{
"node": "3b745c8b-bbfa-4302-a93f-6ea24d7915da",
"type": "main",
"index": 0
}
]
]
},
"8b589726-cc0e-47e1-8ada-b098d551787c": {
"main": [
[
{
"node": "a519e85f-dfa5-436d-833e-31d5ed3cb6f1",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Avanzado - Gestión de archivos
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Evoort Solutions
@evoortsolutionsCompartir este flujo de trabajo