{ "id": "Sq6pKxEiFPBHqOXm", "name": "MAM RSS Orchestrator", "nodes": [ { "parameters": { "operation": "select", "schema": { "__rl": true, "mode": "list", "value": "public" }, "table": { "__rl": true, "value": "followed_series", "mode": "list", "cachedResultName": "followed_series" }, "returnAll": true, "options": {} }, "type": "n8n-nodes-base.postgres", "typeVersion": 2.6, "position": [ 448, 320 ], "id": "ba75080b-cddb-4780-a1ce-01b667c6e732", "name": "list_series", "executeOnce": true, "credentials": { "postgres": { "id": "9grzZwW7Br6SzdV8", "name": "n8n-media" } } }, { "parameters": { "url": "https://www.myanonamouse.net/tor/js/loadSearchJSONbasic.php", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "tor[searchType]", "value": "all" }, { "name": "tor[main_cat][]", "value": "13" }, { "name": "perpage", "value": "1000" }, { "name": "tor[startDate]", "value": "={{ $now.minus({minutes: 1480}).toFormat('X') }}" }, { "name": "tor[sortType]", "value": "dateDesc" } ] }, "options": {} }, "id": "6118b58c-4957-4057-8331-d4dda15dfeae", "name": "Search MAM API", "position": [ 448, 512 ], "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "credentials": { "httpHeaderAuth": { "id": "G8eA8XeS9P5axwJd", "name": "mam cookie auth header" }, "httpBasicAuth": { "id": "BRiFacyi0A60Y7ZZ", "name": "mam_id" } }, "onError": "continueRegularOutput" }, { "parameters": { "rule": { "interval": [ { "field": "hours", "hoursInterval": 3, "triggerAtMinute": 3 } ] } }, "id": "schedule-trigger", "name": "Every 3 Hours", "position": [ 176, 336 ], "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2 }, { "parameters": { "fieldToSplitOut": "data", "options": {} }, "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 656, 512 ], "id": "fc645f39-d4bf-42a0-97ef-053f724190f1", "name": "Split Out" }, { "parameters": { "assignments": { "assignments": [ { "id": "ae6bf406-f09b-408d-8362-a3afe20c1e94", "name": "mam_series_id", "value": "={{ Object.keys(JSON.parse($json.series_info || '{}'))[0] }}", "type": "string" }, { "id": "355cac56-61a4-4222-ac62-f5ef32cf108e", "name": "=join_id", "value": "={{ $json.id.toString().trim() }}", "type": "string" } ] }, "includeOtherFields": true, "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 864, 512 ], "id": "1339f915-626e-4f45-af56-30c9cde4a68f", "name": "Edit Fields" }, { "parameters": { "mode": "combine", "fieldsToMatchString": "mam_series_id", "options": {} }, "type": "n8n-nodes-base.merge", "typeVersion": 3.2, "position": [ 1104, 336 ], "id": "a0b9bef0-392e-4605-bf1c-273d7d16aa32", "name": "Merge" }, { "parameters": { "jsCode": "return [\n {\n json: {\n series_name: \"Loner Life in Another World\",\n mam_series_id: \"97284\", // <--- Added quotes\n smb_path: \"/mnt/nas/Anime/Audiobooks/Loner Life in Another World\"\n }\n },\n {\n json: {\n series_name: \"Skeleton Knight in Another World\",\n mam_series_id: \"57788\", // <--- Added quotes\n smb_path: \"/mnt/nas/Anime/Audiobooks/Skeleton Knight in Another World\"\n }\n },\n {\n json: {\n series_name: \"My Status as an Assassin Obviously Exceeds the Hero's\",\n mam_series_id: \"139807\", // <--- Added quotes\n smb_path: \"/mnt/nas/Anime/Audiobooks/My Status as an Assassin Obviously Exceeds the Hero's\"\n }\n }\n];" }, "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 656, 320 ], "id": "37c7eab2-c14e-4e51-b7f8-0688c6b66fd5", "name": "Code in JavaScript", "disabled": true }, { "parameters": { "authentication": "privateKey", "command": "=find \"{{ $json.smb_path }}\" -maxdepth 1 -name \"*{{ $json.title.replace(/[^a-zA-Z0-9 ]/g, \"\") }}*\" | wc -l" }, "id": "e39493ef-57a9-4c0c-834b-1f89be1fcb59", "name": "List Folders", "position": [ 1952, 224 ], "type": "n8n-nodes-base.ssh", "typeVersion": 1, "credentials": { "sshPrivateKey": { "id": "vOzhicmbOwx1XDF8", "name": "seed-0.local.ben.io" } } }, { "parameters": { "url": "https://04ekn.mrd.ninja/rss/81965ade", "authentication": "genericCredentialType", "genericAuthType": "httpBasicAuth", "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 960, 160 ], "id": "2280bc7b-270d-486c-9355-4d966830402c", "name": "HTTP Request", "credentials": { "httpBasicAuth": { "id": "BRiFacyi0A60Y7ZZ", "name": "mam_id" } } }, { "parameters": { "options": {} }, "type": "n8n-nodes-base.xml", "typeVersion": 1, "position": [ 1168, 160 ], "id": "d1093731-ce22-4ecf-9888-0c0f0aac4531", "name": "XML" }, { "parameters": { "assignments": { "assignments": [ { "id": "1856ed53-6ebb-411c-a2fa-35da18d18f52", "name": "=join_id", "value": "={{ parseInt($json.guid.match(/\\/t\\/(\\d+)/)[1]) }}", "type": "string" } ] }, "includeOtherFields": true, "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 1568, 160 ], "id": "19cccfb1-5684-4c5c-ac2b-37913d545b9e", "name": "Edit Fields1" }, { "parameters": { "fieldToSplitOut": "rss.channel.item", "options": {} }, "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 1376, 160 ], "id": "07d95513-bc0c-4d94-a492-6a2ee6810af9", "name": "Split Out1" }, { "parameters": { "mode": "combine", "fieldsToMatchString": "join_id", "options": {} }, "type": "n8n-nodes-base.merge", "typeVersion": 3.2, "position": [ 1776, 224 ], "id": "8b5484e6-5539-48e2-a9f9-87c43d881e92", "name": "Merge1" }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 3 }, "conditions": [ { "id": "9da81979-9723-4fd6-b641-e9e52e475ce5", "leftValue": "={{ $json.code }}", "rightValue": 0, "operator": { "type": "number", "operation": "equals" } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2.3, "position": [ 2160, 224 ], "id": "99a7ca2b-38b0-472d-9044-fa9e1b1b837c", "name": "If" }, { "parameters": { "url": "={{ $('Edit Fields1').item.json.link }}", "options": { "response": { "response": { "responseFormat": "file" } } } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.3, "position": [ 2432, 208 ], "id": "47a848a9-c815-47d9-8493-36d6ac3ada1c", "name": "HTTP Request1" }, { "parameters": { "workflowId": { "__rl": true, "value": "6S41oPplwN1S9Lz0", "mode": "list", "cachedResultUrl": "/workflow/6S41oPplwN1S9Lz0", "cachedResultName": "MAM Remote File Transfer" }, "workflowInputs": { "mappingMode": "defineBelow", "value": {}, "matchingColumns": [], "schema": [], "attemptToConvertTypes": false, "convertFieldsToString": true }, "options": { "waitForSubWorkflow": true } }, "type": "n8n-nodes-base.executeWorkflow", "typeVersion": 1.3, "position": [ 2640, 208 ], "id": "c1fc40bb-2ab1-47a3-9df9-134ba313b749", "name": "Call 'MAM Remote File Transfer'" } ], "connections": { "Every 3 Hours": { "main": [ [ { "node": "list_series", "type": "main", "index": 0 }, { "node": "Search MAM API", "type": "main", "index": 0 }, { "node": "HTTP Request", "type": "main", "index": 0 } ] ] }, "Search MAM API": { "main": [ [ { "node": "Split Out", "type": "main", "index": 0 } ] ] }, "Split Out": { "main": [ [ { "node": "Edit Fields", "type": "main", "index": 0 } ] ] }, "Edit Fields": { "main": [ [ { "node": "Merge", "type": "main", "index": 1 } ] ] }, "list_series": { "main": [ [ { "node": "Code in JavaScript", "type": "main", "index": 0 } ] ] }, "Code in JavaScript": { "main": [ [ { "node": "Merge", "type": "main", "index": 0 } ] ] }, "Merge": { "main": [ [ { "node": "Merge1", "type": "main", "index": 1 } ] ] }, "List Folders": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "HTTP Request": { "main": [ [ { "node": "XML", "type": "main", "index": 0 } ] ] }, "XML": { "main": [ [ { "node": "Split Out1", "type": "main", "index": 0 } ] ] }, "Split Out1": { "main": [ [ { "node": "Edit Fields1", "type": "main", "index": 0 } ] ] }, "Edit Fields1": { "main": [ [ { "node": "Merge1", "type": "main", "index": 0 } ] ] }, "Merge1": { "main": [ [ { "node": "List Folders", "type": "main", "index": 0 } ] ] }, "If": { "main": [ [ { "node": "HTTP Request1", "type": "main", "index": 0 } ] ] }, "HTTP Request1": { "main": [ [ { "node": "Call 'MAM Remote File Transfer'", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "triggerCount": 1, "versionId": "8a62f940-23db-4004-b207-94299f83038b", "owner": { "type": "personal", "projectId": "FeLO36wNUAcn61Wj", "projectName": "Ben W ", "personalEmail": "admin@ben.io" }, "parentFolderId": "6tDyZCwqELStb6Ik", "isArchived": true }