8
n8n 中文网amn8n.com

n8n Placeholdarr for Plex

高级

这是一个File Management领域的自动化工作流,包含 87 个节点。主要使用 If, Set, Ssh, Code, Wait 等节点。 为Radarr/Sonarr和Plex提供按需下载的动态媒体库

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "014f2F9hjeY0Ixps",
  "meta": {
    "instanceId": "e611d5428fd3ed3e48198b8ecfdcf6b6a91e7427e9139edbbf82824194541030",
    "templateCredsSetupCompleted": true
  },
  "name": "n8n Placeholdarr for Plex",
  "tags": [],
  "nodes": [
    {
      "id": "816067dc-1c5c-42e4-a6f6-06cdd6a92365",
      "name": "响应 Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        848,
        -224
      ],
      "parameters": {
        "options": {
          "responseCode": 200,
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": " application/json"
              }
            ]
          }
        },
        "respondWith": "json",
        "responseBody": "={{ $('Format JustWatch results').all().map(item => item.json) }}"
      },
      "executeOnce": true,
      "typeVersion": 1.4
    },
    {
      "id": "625beae8-71a6-4b52-8cb6-022ee08ef7fd",
      "name": "格式化 JustWatch 结果",
      "type": "n8n-nodes-base.code",
      "position": [
        -128,
        -144
      ],
      "parameters": {
        "jsCode": "const edges = items[0].json.data.popularTitles.edges;\n\nreturn edges.map(edge => {\n  const node = edge.node;\n\n  return {\n    json: {\n      ...($('Webhook Arrs custom list JustWatch').first().json.params.objectType === \"MOVIE\" && {\n        id: Number(node.content.externalIds.tmdbId)\n      }),\n      imdbId: node.content.externalIds.imdbId\n    }\n  };\n});"
      },
      "executeOnce": false,
      "typeVersion": 2
    },
    {
      "id": "22af297a-8b1b-436c-aed6-4ebac97b93cb",
      "name": "调用 JustWatch API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -592,
        128
      ],
      "parameters": {
        "url": "https://apis.justwatch.com/graphql",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"operationName\": \"GetPopularTitles\",\n    \"variables\": {\n        \"first\": {{ $json.params.limit }},\n        \"popularTitlesSortBy\": \"POPULAR\",\n        \"sortRandomSeed\": 0,\n        \"offset\": null,\n        \"creditsRole\": \"DIRECTOR\",\n        \"after\": \"\",\n        \"popularTitlesFilter\": {\n            \"ageCertifications\": [],\n            \"excludeGenres\": [],\n            \"excludeProductionCountries\": [],\n            \"objectTypes\": [\n                \"{{ $json.params.objectType }}\"\n            ],\n            \"productionCountries\": [],\n            \"subgenres\": [],\n            \"genres\": [],\n            \"packages\": [\n                \"{{ $json.params.filter }}\"\n            ],\n            \"excludeIrrelevantTitles\": false,\n            \"presentationTypes\": [],\n            \"monetizationTypes\": [],\n            \"searchQuery\": \"\"\n        },\n        \"watchNowFilter\": {\n            \"packages\": [\n                \"{{ $json.params.filter }}\"\n            ],\n            \"monetizationTypes\": []\n        },\n        \"language\": \"en\",\n        \"country\": \"NL\"\n    },\n    \"query\": \"query GetPopularTitles($backdropProfile: BackdropProfile, $country: Country!, $first: Int! = 70, $format: ImageFormat, $language: Language!, $after: String, $popularTitlesFilter: TitleFilter, $popularTitlesSortBy: PopularTitlesSorting! = POPULAR, $profile: PosterProfile, $sortRandomSeed: Int! = 0, $watchNowFilter: WatchNowOfferFilter!, $offset: Int = 0, $creditsRole: CreditRole! = DIRECTOR) {\\n  popularTitles(\\n    country: $country\\n    filter: $popularTitlesFilter\\n    first: $first\\n    sortBy: $popularTitlesSortBy\\n    sortRandomSeed: $sortRandomSeed\\n    offset: $offset\\n    after: $after\\n  ) {\\n    __typename\\n    edges {\\n      cursor\\n      node {\\n        ...PopularTitleGraphql\\n        __typename\\n      }\\n      __typename\\n    }\\n    pageInfo {\\n      startCursor\\n      endCursor\\n      hasPreviousPage\\n      hasNextPage\\n      __typename\\n    }\\n    totalCount\\n  }\\n}\\n\\nfragment PopularTitleGraphql on MovieOrShow {\\n  __typename\\n  id\\n  objectId\\n  objectType\\n  content(country: $country, language: $language) {\\n      externalIds {\\n        tmdbId\\n    imdbId\\n      }\\n   title\\n    fullPath\\n    originalReleaseYear\\n    shortDescription\\n    interactions {\\n      likelistAdditions\\n      dislikelistAdditions\\n      __typename\\n    }\\n    scoring {\\n      imdbVotes\\n      imdbScore\\n      tmdbPopularity\\n      tmdbScore\\n      tomatoMeter\\n      certifiedFresh\\n      jwRating\\n      __typename\\n    }\\n    interactions {\\n      votesNumber\\n      __typename\\n    }\\n    dailymotionClips: clips(providers: [DAILYMOTION]) {\\n      sourceUrl\\n      externalId\\n      provider\\n      streamUrl\\n      __typename\\n    }\\n    posterUrl(profile: $profile, format: $format)\\n    ... on MovieOrShowOrSeasonContent {\\n      backdrops(profile: $backdropProfile, format: $format) {\\n        backdropUrl\\n        __typename\\n      }\\n      __typename\\n    }\\n    isReleased\\n    credits(role: $creditsRole) {\\n      name\\n      personId\\n      __typename\\n    }\\n    runtime\\n    genres {\\n      translation(language: $language)\\n      shortName\\n      __typename\\n    }\\n    __typename\\n  }\\n  likelistEntry {\\n    createdAt\\n    __typename\\n  }\\n  dislikelistEntry {\\n    createdAt\\n    __typename\\n  }\\n  watchlistEntryV2 {\\n    createdAt\\n    __typename\\n  }\\n  customlistEntries {\\n    createdAt\\n    __typename\\n  }\\n  freeOffersCount: offerCount(\\n    country: $country\\n    platform: WEB\\n    filter: {monetizationTypes: [FREE, ADS]}\\n  )\\n  watchNowOffer(country: $country, platform: WEB, filter: $watchNowFilter) {\\n    ...WatchNowOffer\\n    __typename\\n  }\\n  ... on Movie {\\n    seenlistEntry {\\n      createdAt\\n      __typename\\n    }\\n    __typename\\n  }\\n  ... on Show {\\n    tvShowTrackingEntry {\\n      createdAt\\n      __typename\\n    }\\n    seenState(country: $country) {\\n      seenEpisodeCount\\n      progress\\n      __typename\\n    }\\n    __typename\\n  }\\n}\\n\\nfragment WatchNowOffer on Offer {\\n  __typename\\n  id\\n  standardWebURL\\n  preAffiliatedStandardWebURL\\n  streamUrl\\n  package {\\n    id\\n    icon\\n    packageId\\n    clearName\\n    shortName\\n    technicalName\\n    iconWide(profile: S160)\\n    hasRectangularIcon(country: $country, platform: WEB)\\n    __typename\\n  }\\n  retailPrice(language: $language)\\n  retailPriceValue\\n  lastChangeRetailPriceValue\\n  currency\\n  presentationType\\n  monetizationType\\n  availableTo\\n  dateCreated\\n  newElementCount\\n}\\n\"\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "8039e353-f1d3-4a73-89b0-4c5d30c85670",
      "name": "移除未监控标签",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        272,
        912
      ],
      "parameters": {
        "url": "=http://192.168.1.237:7878/api/v3/movie/editor",
        "method": "PUT",
        "options": {},
        "jsonBody": "={\n          \"movieIds\": [{{ $json.body.movie.id }}],\n          \"tags\": [8],\n          \"applyTags\": \"remove\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "JVigo8CdiqewQX9u",
          "name": "Radarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "e42ca5e0-2faa-4b32-b936-c75b1f05431b",
      "name": "如果存在未监控标签",
      "type": "n8n-nodes-base.if",
      "position": [
        -32,
        928
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "2dc69335-707d-49bc-9619-cfc96f136229",
              "operator": {
                "type": "array",
                "operation": "contains",
                "rightType": "any"
              },
              "leftValue": "={{ $json.body.movie.tags }}",
              "rightValue": "dummy-unprocessed"
            },
            {
              "id": "03106293-e896-4d87-ac98-45acbd7b863b",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f87cdfc2-30fc-47df-8b0e-57e49512f516",
      "name": "如果是 Radarr",
      "type": "n8n-nodes-base.if",
      "position": [
        -384,
        1008
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "5f57e6ef-c3fa-4127-bca7-6c490a05edb9",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.body.movie }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "26bdba3f-9d3c-41b8-8298-63d4963928da",
      "name": "如果存在未监控标签 Sonarr",
      "type": "n8n-nodes-base.if",
      "position": [
        -32,
        1104
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "2dc69335-707d-49bc-9619-cfc96f136229",
              "operator": {
                "type": "array",
                "operation": "contains",
                "rightType": "any"
              },
              "leftValue": "={{ $json.body.series.tags }}",
              "rightValue": "dummy-unprocessed"
            },
            {
              "id": "03106293-e896-4d87-ac98-45acbd7b863b",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "22a88278-8dfc-4f37-87f8-c3af8f8cbef8",
      "name": "移除未监控标签 Sonarr",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        256,
        1104
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/series/editor",
        "method": "PUT",
        "options": {},
        "jsonBody": "={\n          \"seriesIds\": [{{ $json.body.series.id }}],\n          \"tags\": [5],\n          \"applyTags\": \"remove\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "5e98925d-ba4d-4820-86d7-ed2f93f79f36",
      "name": "Webhook Arrs 虚拟文件更新",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1056,
        1216
      ],
      "webhookId": "bd5102ad-9dc5-4415-b779-89d002c6e448",
      "parameters": {
        "path": "bd5102ad-9dc5-4415-b779-89d002c6e448",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "77b1f379-da9a-42c2-83fb-5a87b2e101bb",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        592
      ],
      "parameters": {
        "height": 96,
        "content": "待办事项:"
      },
      "typeVersion": 1
    },
    {
      "id": "e71ea25f-7684-475f-bb4f-b4e7c62d2902",
      "name": "切换事件类型",
      "type": "n8n-nodes-base.switch",
      "position": [
        -800,
        1184
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Download",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7752997b-3746-4386-88a1-68c305b40aee",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.eventType }}",
                    "rightValue": "Download"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "MovieAdded",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1ab6c3fc-c6d6-4940-882c-cc839b48f25f",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.eventType }}",
                    "rightValue": "MovieAdded"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "SeriesAdd",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "4c985af1-84a0-47c7-8a55-8889cc08b333",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.eventType }}",
                    "rightValue": "SeriesAdd"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "none"
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "26b16a0c-15fc-458c-860d-11c69ae08d2b",
      "name": "为 movie1 创建虚拟文件",
      "type": "n8n-nodes-base.ssh",
      "position": [
        -224,
        1344
      ],
      "parameters": {
        "command": "=mkdir -p \"{{ $('Radarr movie').item.json.path }}\"\n\nffmpeg -ss 0 -i \"/mnt/user/Media/Plex/Placeholdarr/dummy-file.mp4\" \\\n  -t {{ Math.min($('Radarr movie').item.json.runtime * 60, 14400) }} -c copy \"{{ $('Radarr movie').item.json.path }}/dummy.mp4\"\n\nchmod -R 777 \"{{ $('Radarr movie').item.json.path }}\"\nchown -R nobody:users \"{{ $('Radarr movie').item.json.path }}\""
      },
      "credentials": {
        "sshPassword": {
          "id": "yiVlXKusAotCDcPc",
          "name": "Unraid SSH"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6d1e2297-fbdd-4d25-ae9b-b3dbefb3d6ca",
      "name": "刷新 movie1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        16,
        1344
      ],
      "parameters": {
        "url": "=http://192.168.1.237:7878/api/v3/command",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"name\":\"RefreshMovie\",\"movieIds\":[{{ $('Radarr movie').item.json.id }}]}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "JVigo8CdiqewQX9u",
          "name": "Radarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "7854e9a9-5f77-4bf0-8f33-e3314572ac3a",
      "name": "刷新 series1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        272,
        1616
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/command",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"name\":\"RefreshSeries\",\"seriesId\":{{ $('Sonarr series').item.json.id }}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "47b6a9ef-06dc-4168-ad70-62da2fef0696",
      "name": "刷新 Plex",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        1344
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/sections/7/refresh?path={{\n  encodeURIComponent(\n   $('Radarr movie').item.json.path\n)\n}}",
        "method": "POST",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.2
    },
    {
      "id": "d84732c8-09b7-4a9b-bf00-9449ec4c523b",
      "name": "刷新 Plex 系列",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        1616
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/sections/8/refresh?path={{\n  encodeURIComponent(\n  $('Sonarr series').item.json.path\n  )\n}}",
        "method": "POST",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.2
    },
    {
      "id": "bb3647c8-0586-4c3e-975a-120dda6f7b89",
      "name": "Sonarr 运行时间 s01e01",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -208,
        1616
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/episode",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "seriesId",
              "value": "={{ $('Sonarr series').first().json.id }}"
            },
            {
              "name": "seasonNumber",
              "value": "1"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "33e771ed-2b6a-4046-9ffe-dd71df1577a7",
      "name": "为带运行时间的系列创建虚拟文件",
      "type": "n8n-nodes-base.ssh",
      "position": [
        16,
        1616
      ],
      "parameters": {
        "command": "=mkdir -p \"{{ $('Webhook Arrs Dummy file update').item.json.body.series.path }}/Season 1\"\n\nffmpeg -ss 0 -i \"/mnt/user/Media/Plex/Placeholdarr/dummy-file.mp4\" \\\n  -t {{ Math.min($('Sonarr runtime s01e01').first().json.runtime * 60, 14400) }} -c copy \"{{ $('Webhook Arrs Dummy file update').item.json.body.series.path }}/Season 1/Dummy s01e01.mp4\"\n\nchmod -R 777 \"{{ $('Webhook Arrs Dummy file update').item.json.body.series.path }}\"\nchown -R nobody:users \"{{ $('Webhook Arrs Dummy file update').item.json.body.series.path }}\""
      },
      "credentials": {
        "sshPassword": {
          "id": "yiVlXKusAotCDcPc",
          "name": "Unraid SSH"
        }
      },
      "executeOnce": true,
      "typeVersion": 1
    },
    {
      "id": "d743cb61-8351-4854-b668-b023432f19b6",
      "name": "Radarr 电影",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -400,
        1344
      ],
      "parameters": {
        "url": "=http://192.168.1.237:7878/api/v3/movie/{{ $('Webhook Arrs Dummy file update').item.json.body.movie.id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "JVigo8CdiqewQX9u",
          "name": "Radarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "1d5a3a61-c2af-4b1f-8d02-c32078368f21",
      "name": "Sonarr 系列",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -416,
        1616
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/series/{{ $('Webhook Arrs Dummy file update').item.json.body.series.id }}",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "seriesId",
              "value": "={{ $('Webhook Arrs Dummy file update').item.json.body.series.id }}"
            },
            {
              "name": "seasonNumber",
              "value": "1"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "eeda8469-cb18-458a-a12a-1bc21639aca7",
      "name": "创建虚拟文件",
      "type": "n8n-nodes-base.ssh",
      "position": [
        -848,
        1648
      ],
      "parameters": {
        "command": "=docker run --rm \\\n  --device /dev/dri \\\n  -v /mnt/user/Media/Plex:/mnt/user/Media/Plex \\\n  akashisn/ffmpeg:7.0.2 \\\n  -hwaccel qsv -f lavfi -i color=black:s=640x480:d=14400:r=1 \\\n  -loop 1 -t 120 -i /mnt/user/Media/Plex/Placeholdarr/dummy-download.png \\\n  -filter_complex \"[1:v]scale=640:480:force_original_aspect_ratio=decrease,pad=640:480:(ow-iw)/2:(oh-ih)/2:black[img];[0:v][img]overlay=enable='lte(t,120)'\" \\\n  -c:v h264_qsv -b:v 300k -pix_fmt yuv420p \\\n  \"/mnt/user/Media/Plex/Placeholdarr/dummy-file.mp4\""
      },
      "credentials": {
        "sshPassword": {
          "id": "yiVlXKusAotCDcPc",
          "name": "Unraid SSH"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "77e79179-fe4b-4c00-95db-59a25f399dfb",
      "name": "搜索电影",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -112,
        2112
      ],
      "parameters": {
        "url": "=http://192.168.1.237:7878/api/v3/command",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"name\":\"MoviesSearch\",\"movieIds\":[{{ $('Get Radarr information from tmdbId').item.json.id }}]}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "JVigo8CdiqewQX9u",
          "name": "Radarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "1454fdb3-6d54-402e-8595-83e9d00fe3e1",
      "name": "响应 200",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        96,
        2112
      ],
      "parameters": {
        "options": {
          "responseCode": 200
        },
        "respondWith": "noData"
      },
      "typeVersion": 1.4
    },
    {
      "id": "ff692460-8be9-4f64-99e4-e233a6a7e1c2",
      "name": "监控电影",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -368,
        2112
      ],
      "parameters": {
        "url": "=http://192.168.1.237:7878/api/v3/movie/editor",
        "method": "PUT",
        "options": {},
        "jsonBody": "={\"monitored\": true, \"movieIds\":[{{ $('Get Radarr information from tmdbId').item.json.id }}]}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "JVigo8CdiqewQX9u",
          "name": "Radarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "46fcd496-4c0a-474c-ba8c-a8d694bc15a8",
      "name": "响应",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        320,
        2432
      ],
      "parameters": {
        "options": {
          "responseCode": 200
        },
        "respondWith": "noData"
      },
      "executeOnce": true,
      "typeVersion": 1.4
    },
    {
      "id": "2a1590b8-5e59-4835-8de4-5dca41c7da40",
      "name": "监控系列",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -400,
        2336
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/series/{{ $json.id }}",
        "method": "PUT",
        "options": {},
        "jsonBody": "={{ Object.assign({}, $json, { \"monitored\": true }) }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "96b3c1d1-c6e4-4915-bd9b-ad2bb940494b",
      "name": "监控所有季",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -192,
        2336
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/seasonPass",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"series\":[{\"id\":{{ $json.id }}}],\"monitoringOptions\":{\"monitor\":\"all\", \"monitorNewItems\": \"all\"}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "6993d242-0e3d-4252-9f04-f6b80ecb02a1",
      "name": "如果是 movie4",
      "type": "n8n-nodes-base.if",
      "position": [
        -880,
        2224
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4ae3bfa3-1f34-4423-96d6-97e3ec90fb9b",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.body.media.type }}",
              "rightValue": "movie"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "53f09ea8-0ba4-4866-8705-b36add60e6c9",
      "name": "从 tmdbId 获取 Radarr 信息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -624,
        2112
      ],
      "parameters": {
        "url": "=http://192.168.1.237:7878/api/v3/movie?tmdbId={{ $json.body.media.ids.tmdb }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "JVigo8CdiqewQX9u",
          "name": "Radarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "e8da3276-5493-4605-a382-f4228d95cc8f",
      "name": "从 tvdbId 获取 Sonarr 信息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -640,
        2336
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/series?tvdbId={{ $json.body.media.ids.tvdb }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "53ecfd80-a81c-4976-ae4a-1ce6ba506bcc",
      "name": "Webhook Tautulli",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1120,
        2224
      ],
      "webhookId": "9cc04992-377c-40fc-a0a9-810c08438224",
      "parameters": {
        "path": "9cc04992-377c-40fc-a0a9-810c08438224",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "0749d0c5-74c7-47d7-bfef-75aeaa088ebb",
      "name": "检查集合是否不为空",
      "type": "n8n-nodes-base.if",
      "position": [
        1056,
        -48
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a8db1849-58af-4664-90a1-33c9db27458e",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $('Webhook Arrs custom list JustWatch').item.json.params.collectionId }}",
              "rightValue": ""
            }
          ]
        }
      },
      "executeOnce": true,
      "typeVersion": 2.2
    },
    {
      "id": "1c1ae591-c96e-41ba-968f-745ccefb1465",
      "name": "如果 objectType 是电影",
      "type": "n8n-nodes-base.if",
      "position": [
        96,
        -64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "be18535d-6e4b-42b1-a32a-a43cdd96ffac",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $('Webhook Arrs custom list JustWatch').item.json.params.objectType }}",
              "rightValue": "MOVIE"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "fd6fe507-a8b5-4d18-8617-8b106ecbcaa3",
      "name": "Respond to Webhook1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        848,
        112
      ],
      "parameters": {
        "options": {
          "responseCode": 200,
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": " application/json"
              }
            ]
          }
        },
        "respondWith": "json",
        "responseBody": "={{ $('Format JustWatch results add tvdbId').all().map(item => item.json) }}"
      },
      "executeOnce": true,
      "typeVersion": 1.4
    },
    {
      "id": "ff7cf84f-cf82-43f3-ba6c-5e753d401c2e",
      "name": "格式化 JustWatch 结果并添加 tvdbId",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        144
      ],
      "parameters": {
        "jsCode": "return items.map(item => {\n  return {\n    json: {\n      tvdbId: String(item.json.tvdbId)\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "18551931-2df8-44a2-9875-e49521d608ca",
      "name": "Sonarr 系列查找1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        304,
        32
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/series/lookup?term={{ $json.imdbId }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "cae3b989-28b5-4c8a-96e6-474d73554621",
      "name": "Webhook Arrs 自定义列表 JustWatch",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -912,
        128
      ],
      "webhookId": "5b328176-d63b-4f85-a087-d4f4e7b15bc8",
      "parameters": {
        "path": ":filter/:limit/:objectType/:collectionId",
        "options": {},
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "1217b066-2dab-47ae-bd05-e291b3d1d45f",
      "name": "Webhook Arrs 自定义列表 Trakt",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -912,
        384
      ],
      "webhookId": "5b328176-d63b-4f85-a087-d4f4e7b15bc8",
      "parameters": {
        "path": ":username/:list/:limit/:objectType/:collectionId",
        "options": {},
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "264a1dfb-2bd8-4686-9b70-643aa452cf40",
      "name": "调用 Trakt API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -656,
        384
      ],
      "parameters": {
        "url": "=https://api.trakt.tv/users/{{ $json.params.username }}/lists/{{ $json.params.list }}/items/movies",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "BtUbxYnlbnPnBjxW",
          "name": "Trakt client ID"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "7c648a25-cb1c-411b-8f80-7cf1ae35c7de",
      "name": "格式化 JustWatch 结果1",
      "type": "n8n-nodes-base.code",
      "position": [
        -432,
        384
      ],
      "parameters": {
        "jsCode": "const limit = $('Webhook Arrs custom list Trakt').first().json.params.limit || 100;\n\nreturn items.slice(0, limit).map(({ json }) => {\n  const movie = json.movie;\n\n  return {\n    json: {\n      id: Number(movie.ids.tmdb),\n      imdbId: movie.ids.imdb\n    }\n  };\n});\n"
      },
      "executeOnce": false,
      "typeVersion": 2
    },
    {
      "id": "b9178b4b-f165-4021-bac5-54a34d990013",
      "name": "Respond to Webhook2",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -128,
        432
      ],
      "parameters": {
        "options": {
          "responseCode": 200,
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "application/json"
              }
            ]
          }
        },
        "respondWith": "json",
        "responseBody": "={{ $('Format JustWatch results1').all().map(item => item.json) }}"
      },
      "executeOnce": true,
      "typeVersion": 1.4
    },
    {
      "id": "3a965e43-7abc-4ee3-af8f-7e1ab20d42f8",
      "name": "获取集合1 中的所有项目",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2928,
        320
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/collections/{{ $json.MediaContainer.Metadata[0].ratingKey }}/children",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.2
    },
    {
      "id": "03062dc7-10b6-4193-b75c-4042b9ecdb5f",
      "name": "检查集合1 是否包含项目",
      "type": "n8n-nodes-base.if",
      "position": [
        3120,
        560
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a54234bd-6c15-41b2-8c09-d6a35efce840",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $('Get all items in collection1').item.json.MediaContainer.size }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3d411a66-a5ba-4cfe-8e61-203330f73473",
      "name": "拆分出集合项目1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        3296,
        272
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "MediaContainer.Metadata"
      },
      "typeVersion": 1
    },
    {
      "id": "a8d9bc15-4707-480f-ac20-5dcdde3bba97",
      "name": "遍历项目1",
      "type": "n8n-nodes-base.splitInBatches",
      "onError": "continueRegularOutput",
      "position": [
        3584,
        272
      ],
      "parameters": {
        "options": {}
      },
      "executeOnce": false,
      "typeVersion": 3
    },
    {
      "id": "160f4407-be37-464f-9c17-bc7013232aeb",
      "name": "从集合1 中移除项目",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3840,
        288
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/sections/{{ $('Get collection1').item.json.MediaContainer.librarySectionID }}/all?type=1&id={{ $json.ratingKey }}&includeExternalMedia=1&collection[].tag.tag-={{ encodeURIComponent($('Get collection1').item.json.MediaContainer.Metadata[0].title) }}",
        "method": "PUT",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "178927b9-459a-47b6-8f8e-cac49487870a",
      "name": "获取集合1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2496,
        384
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/collections/{{ $json.collectionId }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c00d0eed-6e07-4004-829d-2b9774a71087",
      "name": "遍历项目3",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4272,
        576
      ],
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "typeVersion": 3
    },
    {
      "id": "677ffe8c-2f71-4ce5-b011-9c5756e3abd7",
      "name": "从 imdbId 获取 GUID",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4496,
        592
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/metadata/{{ $('Set fields for collection').first().json.objectType == \"MOVIE\" ? 121583 : 117877 }}/matches?manual=1&title={{ $('Loop Over Items3').item.json.imdbId }}",
        "options": {},
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "d2ba9998-5b36-44a2-bd62-37ec6847ff94",
      "name": "添加项目到集合2",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        5664,
        576
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/collections/{{ $('Get collection1').first().json.MediaContainer.Metadata[0].ratingKey }}/items",
        "method": "PUT",
        "options": {
          "lowercaseHeaders": true
        },
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "uri",
              "value": "=server://14279b2fa6259250db471223f9a8fa2056e31c65/com.plexapp.plugins.library/library/metadata/{{ $json.MediaContainer.Metadata[0].ratingKey }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json, text/plain, */*"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "90e4e4db-335d-4402-8b55-f68f4b0481de",
      "name": "添加项目到集合3",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        5184,
        464
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/collections/{{ $('Get collection1').first().json.MediaContainer.Metadata[0].ratingKey }}/items",
        "method": "OPTIONS",
        "options": {
          "lowercaseHeaders": true
        },
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "uri",
              "value": "=server://14279b2fa6259250db471223f9a8fa2056e31c65/com.plexapp.plugins.library/library/metadata/{{ $json.MediaContainer.Metadata[0].ratingKey }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json, text/plain, */*"
            },
            {
              "name": "access-control-request-method",
              "value": "PUT"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "7aeda33a-58d7-4a62-991e-3654da9bc5b2",
      "name": "从 GUID1 获取 ratingKey",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4960,
        576
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/all?guid={{ $json.MediaContainer.SearchResult[0].guid }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ebbaf071-2bee-40a2-afe1-719acc9a8959",
      "name": "移动集合项目2",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        6192,
        576
      ],
      "parameters": {
        "url": "=http://192.168.1.237:32400/library/collections/{{ $('Get collection1').first().json.MediaContainer.Metadata[0].ratingKey }}/items/{{ $json.MediaContainer.Metadata[0].ratingKey }}/move",
        "method": "PUT",
        "options": {
          "lowercaseHeaders": true
        },
        "sendQuery": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {}
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json, text/plain, */*"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "z8PW38Cjesoy31fQ",
          "name": "Plex Token"
        }
      },
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "4206a64b-417f-4227-89a6-069b56022c22",
      "name": "如果找到 Plex GUID1",
      "type": "n8n-nodes-base.if",
      "position": [
        4688,
        592
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bd0f098a-9fee-46ad-8c82-8bf2d99583ad",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.MediaContainer.size }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "12ccd64d-4ea8-4d65-9778-f067866b2c12",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        -192
      ],
      "parameters": {
        "width": 528,
        "height": 944,
        "content": "## *Arrs Plex 集合导入列表"
      },
      "typeVersion": 1
    },
    {
      "id": "21f623a7-2cb7-47bf-ba01-71e511b05159",
      "name": "合并1",
      "type": "n8n-nodes-base.merge",
      "position": [
        1440,
        368
      ],
      "parameters": {
        "mode": "chooseBranch",
        "useDataOfInput": 2
      },
      "typeVersion": 3.2
    },
    {
      "id": "6580c82a-1c1c-468d-9c6d-c57698ea4c8e",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        3984,
        576
      ],
      "parameters": {
        "jsCode": "//const items = $('When Executed by Another Workflow create Plex collection').first().json.data\n\n//return items.map(item => ({ json: item }));\n\nconst items = $('Set fields for collection').first().json.data;\n\nreturn items.reverse().map(item => ({ json: item }));\n"
      },
      "typeVersion": 2
    },
    {
      "id": "3b563589-1a7e-4b45-9901-4e2a3d243b08",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        5440,
        576
      ],
      "parameters": {
        "mode": "chooseBranch",
        "useDataOfInput": 2
      },
      "typeVersion": 3.2
    },
    {
      "id": "cec8d612-b961-4139-aa4d-7e22ff3e6fde",
      "name": "合并2",
      "type": "n8n-nodes-base.merge",
      "position": [
        5888,
        576
      ],
      "parameters": {
        "mode": "chooseBranch",
        "useDataOfInput": 2
      },
      "typeVersion": 3.2
    },
    {
      "id": "9c5987df-1c2e-4c72-84a8-0d35714700b1",
      "name": "为电影创建虚拟文件",
      "type": "n8n-nodes-base.ssh",
      "position": [
        -832,
        1664
      ],
      "parameters": {
        "command": "=mkdir -p \"{{ $('Radarr movie').item.json.path }}\"\n\n//docker run --rm \\\n//  -v /mnt/user/Media/Plex:/mnt/user/Media/Plex \\\n//  akashisn/ffmpeg:7.0.2 \\\n//  -ss 0 -i \"/mnt/user/Media/Plex/Placeholdarr/dummy-file.mp4\" \\\n//  -t {{ Math.min($('Radarr movie').item.json.runtime * 60, 14400) }} -c //copy \"{{ $('Radarr movie').item.json.path }}/dummy.mp4\"\n\n\nffmpeg -ss 0 -i \"/mnt/user/Media/Plex/Placeholdarr/dummy-file.mp4\" \\\n  -t {{ Math.min($('Radarr movie').item.json.runtime * 60, 14400) }} -c copy \"{{ $('Radarr movie').item.json.path }}/dummy.mp4\"\n\nchmod -R 777 \"{{ $('Radarr movie').item.json.path }}\"\nchown -R nobody:users \"{{ $('Radarr movie').item.json.path }}\""
      },
      "credentials": {
        "sshPassword": {
          "id": "yiVlXKusAotCDcPc",
          "name": "Unraid SSH"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d0df6640-6aaa-413b-8873-49bf532f93ce",
      "name": "获取 Overseerr 用户",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        2208
      ],
      "parameters": {
        "url": "http://192.168.1.237:5055/api/v1/user",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "take",
              "value": "1000"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "RkZ8aXg9kGgT7MKJ",
          "name": "Overseerr API Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "969c7ef1-03d2-4507-8a23-2202e7d04d96",
      "name": "筛选 Overseerr 用户",
      "type": "n8n-nodes-base.code",
      "position": [
        848,
        2208
      ],
      "parameters": {
        "jsCode": "const searchEmail = $('Webhook Tautulli').first().json.body.user_email;\nconst users = $json[\"results\"] || [];\nconst match = users.find(u => u.email.toLowerCase() === searchEmail.toLowerCase());\nif (match) {\n  return [{ json: match }];\n} else {\n  return [];\n}\n"
      },
      "typeVersion": 2
    },
    {
      "id": "d3a3fdf7-60e4-4caf-b141-aae32159c8c6",
      "name": "检查是否找到 Overseerr 用户",
      "type": "n8n-nodes-base.if",
      "position": [
        1088,
        2208
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "5a828786-9372-421f-97c8-16dda5fc3a02",
              "operator": {
                "type": "number",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "81f50586-3ac4-44b6-814d-10c5b057140d",
      "name": "发出 Overseerr 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2032,
        2176
      ],
      "parameters": {
        "url": "http://192.168.1.237:5055/api/v1/request",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"mediaType\": \"{{ $('Webhook Tautulli').item.json.body.media.type === 'movie' ? 'movie' : 'tv' }}\",\n  \"mediaId\": {{ $('Webhook Tautulli').item.json.body.media.ids.tmdb }},\n  \"tvdbId\": {{ $('Webhook Tautulli').item.json.body.media.ids.tvdb }},\n  \"seasons\": [\n  ],\n  \"userId\": {{ $('Filter Overseerr user').item.json.id }}\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "RkZ8aXg9kGgT7MKJ",
          "name": "Overseerr API Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "e31c803c-65d1-4d1e-859e-12421c56b125",
      "name": "从用户获取最近 20 个 Overseerr 请求",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1344,
        2192
      ],
      "parameters": {
        "url": "http://192.168.1.237:5055/api/v1/request",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "requestedBy",
              "value": "={{ $json.id }}"
            },
            {
              "name": "take",
              "value": "20"
            },
            {
              "name": "sort",
              "value": "added"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "RkZ8aXg9kGgT7MKJ",
          "name": "Overseerr API Key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c8c13788-8731-4a40-a806-844a14794030",
      "name": "检查请求是否已存在",
      "type": "n8n-nodes-base.code",
      "position": [
        1552,
        2192
      ],
      "parameters": {
        "jsCode": "const targetTmdbId = $('Webhook Tautulli').first().json.body.media.ids.tmdb;\nconst targetTvdbId = $('Webhook Tautulli').first().json.body.media.ids.tvdb;\n\nconst requests = $json.results || [];\n\nconst match = requests.find(r => {\n  const media = r.media || {};\n\n  const tmdb = media.tmdbId;\n  const tvdb = media.tvdbId;\n\n  // Altijd als string vergelijken om typeverschillen te voorkomen\n  const tmdbHit = tmdb != null && String(tmdb) === String(targetTmdbId);\n  const tvdbHit = tvdb != null && String(tvdb) === String(targetTvdbId);\n\n  return tmdbHit || tvdbHit;\n});\n\nif (match) {\n  return [{ json: match }];\n}\n\nreturn [];"
      },
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "6853798e-5cc7-4d80-bc38-bb964e84f119",
      "name": "检查 Overseerr 用户是否不存在该媒体的现有请求",
      "type": "n8n-nodes-base.if",
      "position": [
        1760,
        2192
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4cc89c3b-5e22-441a-8784-fc1980d11f41",
              "operator": {
                "type": "object",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "db815a78-9775-475c-a118-6ce8340509e3",
      "name": "为虚拟文件终止 Tautulli 会话",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1552,
        992
      ],
      "parameters": {
        "url": "http://192.168.1.237:8181/api/v2",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "cmd",
              "value": "terminate_session"
            },
            {
              "name": "session_key",
              "value": "={{ $json.session_key }}"
            },
            {
              "name": "message",
              "value": "De film of serie is beschikbaar om te kijken."
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "pyKggsgScZymPV5h",
          "name": "Tautulli api key"
        },
        "httpHeaderAuth": {
          "id": "bRw08BDSStiQCPxU",
          "name": "Tautulli API key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "54f60bf2-07f1-4293-a310-9b5109f10b6f",
      "name": "获取文件的所有活动会话",
      "type": "n8n-nodes-base.code",
      "position": [
        1312,
        1008
      ],
      "parameters": {
        "jsCode": "const targetFile = $('Webhook Arrs Dummy file update').first().json.body.deletedFiles[0].path;\n\n// Haal de JSON op van de vorige stap\nconst data = items[0].json; // in n8n is dit meestal de response al als object\n\n// Als jouw HTTP Request node een string geeft, gebruik dan:\n// const data = JSON.parse(items[0].json);\n\n// Pak de sessies array\nconst sessions = data?.response?.data?.sessions || [];\nconsole.log(sessions)\n\n// Filter de sessies\nconst matching = sessions.filter(s => s.file === targetFile);\n\n// n8n wil dat je een array van items teruggeeft\nreturn matching.map(s => ({ json: s }));"
      },
      "typeVersion": 2
    },
    {
      "id": "c8cc229c-a522-4178-b59c-b819bb4308a5",
      "name": "监控所有季1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1200,
        1264
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/seasonPass",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"series\":[{\"id\":{{ $('Webhook Arrs Dummy file update').item.json.body.series.id }}}],\"monitoringOptions\":{\"monitor\":\"all\", \"monitorNewItems\": \"all\"}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "e191443d-1b66-4934-a3e0-0fa6fe7b53d4",
      "name": "移除所有虚拟文件",
      "type": "n8n-nodes-base.ssh",
      "position": [
        576,
        1264
      ],
      "parameters": {
        "command": "=find \"{{ $('Webhook Arrs Dummy file update').item.json.body.series.path }}\" -maxdepth 2 -type f -iname 'Dummy*' -exec rm -f {} \\;"
      },
      "credentials": {
        "sshPassword": {
          "id": "yiVlXKusAotCDcPc",
          "name": "Unraid SSH"
        }
      },
      "executeOnce": true,
      "typeVersion": 1
    },
    {
      "id": "a96a9b23-cdd4-400c-8ba8-c9991d1cd2bb",
      "name": "如果存在 deletedFiles",
      "type": "n8n-nodes-base.if",
      "position": [
        816,
        992
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d06bf1e8-bc79-475c-b2ea-030887d32225",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $('Webhook Arrs Dummy file update').first().json.body.deletedFiles?.length > 0 }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7834dda0-3a91-47c0-9cb5-8fc688d90bba",
      "name": "获取活动的 Tautulli 会话",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1088,
        1008
      ],
      "parameters": {
        "url": "http://192.168.1.237:8181/api/v2",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "cmd",
              "value": "get_activity"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "pyKggsgScZymPV5h",
          "name": "Tautulli api key"
        },
        "httpHeaderAuth": {
          "id": "bRw08BDSStiQCPxU",
          "name": "Tautulli API key"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "37d56569-7336-4dc8-8cea-78dc37d9e24e",
      "name": "刷新系列",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        960,
        1264
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/command",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"name\":\"RefreshSeries\",\"seriesId\":{{ $('Get Sonarr information for series').item.json.id }}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "3b9fcd01-1a10-4bc5-9ffa-12b7c27cc27c",
      "name": "获取系列的 Sonarr 信息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        768,
        1264
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/series/{{ $('Webhook Arrs Dummy file update').item.json.body.series.id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "606671e3-bab5-4b2d-aed8-2f10630449a4",
      "name": "搜索系列2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1456,
        1488
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/command",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"name\":\"SeriesSearch\",\"seriesId\":{{ $('Webhook Arrs Dummy file update').item.json.body.series.id }}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "65351cd1-ff9a-4f7c-8ce1-e5ec0753beb1",
      "name": "搜索系列季",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1584,
        1600
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/command",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"name\":\"SeriesSearch\",\"seriesId\":{{ $('Webhook Arrs Dummy file update').item.json.body.series.id }}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "6de449f2-0240-47fd-998d-b695f66e2dfc",
      "name": "代码1",
      "type": "n8n-nodes-base.code",
      "position": [
        -336,
        2576
      ],
      "parameters": {
        "jsCode": "const data = $('Get Sonarr information from tvdbId').first().json\n\n// Pak alle seizoennummers\nconst seasonNumbers = data.seasons.map(season => season.seasonNumber);\n\n// Maak voor elk seizoen een apart item\nreturn seasonNumbers.map(num => {\n  return { json: { season: num } };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "bb42cbaf-6db3-4de6-990f-ac41ef0e0c04",
      "name": "合并3",
      "type": "n8n-nodes-base.merge",
      "position": [
        0,
        2496
      ],
      "parameters": {
        "mode": "chooseBranch",
        "useDataOfInput": 2
      },
      "typeVersion": 3.2
    },
    {
      "id": "dbceee71-94b4-4bdf-8eec-bf064d983f34",
      "name": "搜索季包",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        176,
        2544
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/command",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"name\":\"SeasonSearch\",\"seriesId\":{{ $('Get Sonarr information from tvdbId').item.json.id }},\"seasonNumber\":{{ $json.season }}}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "ad7dc89b-ebe1-4af3-a1e3-68ba31c0eebc",
      "name": "搜索季包1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1456,
        1264
      ],
      "parameters": {
        "url": "=http://192.168.1.237:8989/api/v3/command",
        "method": "POST",
        "options": {},
        "jsonBody": "={\"name\":\"SeasonSearch\",\"seriesId\":{{ $('Webhook Arrs Dummy file update').item.json.body.series.id }},\"seasonNumber\":1}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "miWBUVOtIVZ5kYl1",
          "name": "Sonarr API Key"
        }
      },
      "notesInFlow": false,
      "retryOnFail": false,
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "1c83e819-0680-4619-b6d7-5678d038950c",
      "name": "为集合设置字段",
      "type": "n8n-nodes-base.set",
      "position": [
        1920,
        368
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d9e74177-6b9b-4d03-acfe-93cc0eab8d53",
              "name": "collectionId",
              "type": "string",
              "value": "={{   (() => {     try {       return $('Webhook Arrs custom list JustWatch').first().json.params.collectionId;     } catch (e) {       return $('Webhook Arrs custom list Trakt').first().json.params.collectionId;     }   })() }}"
            },
            {
              "id": "39cb87cc-8bd9-4c8c-8197-2250a897522b",
              "name": "objectType",
              "type": "string",
              "value": "={{   (() => {     try {       return $('Webhook Arrs custom list JustWatch').first().json.params.objectType;     } catch (e) {       return $('Webhook Arrs custom list Trakt').first().json.params.objectType;     }   })() }}"
            },
            {
              "id": "b8f13781-f371-4501-9aaf-337b748a6ffc",
              "name": "data",
              "type": "array",
              "value": "={{ $items().map(i => i.json) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bac5380e-95fc-4e8a-8c01-be3014c53ed5",
      "name": "在 Plex 中处理集合前等待 5 分钟",
      "type": "n8n-nodes-base.wait",
      "position": [
        2240,
        368
      ],
      "webhookId": "1263cce7-01d5-41ff-8239-14dd039f2ab9",
      "parameters": {
        "unit": "minutes"
      },
      "typeVersion": 1.1
    },
    {
      "id": "3af82c29-95b0-4a1e-948f-da0d7d3c4fd3",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1520,
        -1168
      ],
      "parameters": {
        "width": 784,
        "height": 736,
        "content": "## n8n Placeholdarr for Plex (测试版)"
      },
      "typeVersion": 1
    },
    {
      "id": "ffee172c-f735-4d16-bceb-a6b05490e78f",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        1536
      ],
      "parameters": {
        "content": "如果您的 SSH 无法运行 FFMPEG,只需将虚拟文件复制到虚拟文件夹(待办事项)"
      },
      "typeVersion": 1
    },
    {
      "id": "dbd35e8a-ad95-4f89-88f5-5f83d2fa9a94",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        1088
      ],
      "parameters": {
        "width": 528,
        "height": 400,
        "content": "## *Arrs 连接 Webhook"
      },
      "typeVersion": 1
    },
    {
      "id": "e44d1c92-0468-4975-b4cd-c768bd73b841",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1744,
        2032
      ],
      "parameters": {
        "width": 560,
        "height": 704,
        "content": "## Tautulli Webhook"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {
    "Webhook Tautulli": [
      {
        "json": {
          "body": {
            "event": "playback.start",
            "media": {
              "ids": {
                "imdb": "tt27995114",
                "plex": "124820",
                "tmdb": "245703",
                "tvdb": "366972"
              },
              "type": "episode",
              "year": "2025",
              "title": "Dept. Q - Episode 1",
              "file_info": {
                "path": "/mnt/user/Media/Plex/Series/Dept. Q/Season 01/Dummy s01e01.mp4"
              },
              "show_name": "Dept. Q",
              "season_num": "1",
              "episode_num": "1",
              "episode_name": "Episode 1"
            },
            "user_id": "21363175",
            "user_email": "arjanterheegde@msn.com"
          },
          "query": {},
          "params": {},
          "headers": {
            "host": "192.168.1.237:5678",
            "accept": "*/*",
            "connection": "keep-alive",
            "user-agent": "python-requests/2.32.3",
            "content-type": "application/json",
            "content-length": "434",
            "accept-encoding": "gzip, deflate"
          },
          "webhookUrl": "http://192.168.1.237:5678/webhook/9cc04992-377c-40fc-a0a9-810c08438224",
          "executionMode": "production"
        }
      }
    ],
    "Webhook Arrs Dummy file update": [
      {
        "json": {
          "body": {
            "series": {
              "id": 380,
              "path": "/mnt/user/Media/Plex/Series/Breaking Bad (2008) {imdb-tt0903747}",
              "tags": [
                "dummy",
                "dummy-unprocessed"
              ],
              "type": "standard",
              "year": 2008,
              "title": "Breaking Bad",
              "genres": [
                "Crime",
                "Drama",
                "Thriller",
                "Western"
              ],
              "images": [
                {
                  "url": "/MediaCover/380/banner.jpg?lastWrite=638893857721419658",
                  "coverType": "banner",
                  "remoteUrl": "https://artworks.thetvdb.com/banners/graphical/81189-g21.jpg"
                },
                {
                  "url": "/MediaCover/380/poster.jpg?lastWrite=638893857723459662",
                  "coverType": "poster",
                  "remoteUrl": "https://artworks.thetvdb.com/banners/posters/81189-10.jpg"
                },
                {
                  "url": "/MediaCover/380/fanart.jpg?lastWrite=638893857725209665",
                  "coverType": "fanart",
                  "remoteUrl": "https://artworks.thetvdb.com/banners/fanart/original/81189-21.jpg"
                },
                {
                  "url": "/MediaCover/380/clearlogo.png?lastWrite=638893857726049667",
                  "coverType": "clearlogo",
                  "remoteUrl": "https://artworks.thetvdb.com/banners/v4/series/81189/clearlogo/611b4df33bac5.png"
                }
              ],
              "imdbId": "tt0903747",
              "tmdbId": 1396,
              "tvdbId": 81189,
              "tvMazeId": 169,
              "titleSlug": "breaking-bad",
              "originalLanguage": {
                "id": 1,
                "name": "English"
              }
            },
            "release": {
              "size": 36561158144,
              "indexer": "Zilean ElfHosted (Prowlarr)",
              "releaseType": "seasonPack",
              "releaseTitle": "Breaking Bad S02-2160P (Upscale) BluRay 10 bit Encode AV1 DTS 5 1-R&H"
            },
            "episodes": [
              {
                "id": 22239,
                "title": "ABQ",
                "tvdbId": 438924,
                "airDate": "2009-05-31",
                "overview": "Walt's lies have pushed Skyler to her limit. Jesse self-destructs after a personal blow, forcing Walt to come to his aid. Donald's grief leads to tragedy.",
                "seriesId": 380,
                "airDateUtc": "2009-06-01T01:00:00Z",
                "seasonNumber": 2,
                "episodeNumber": 13
              }
            ],
            "eventType": "Download",
            "isUpgrade": false,
            "downloadId": "BCE7886DD2145BA8EDB4AD82F99E73AE04CB784D",
            "episodeFile": {
              "id": 14121,
              "path": "/mnt/user/Media/Plex/Series/Breaking Bad (2008) {imdb-tt0903747}/Season 2/Breaking.Bad.S02E13.ABQ.2160P.(Upscale).BluRay.Encode.AV1.DTS.5.1-R&H.mkv",
              "size": 2831443144,
              "quality": "Bluray-2160p",
              "dateAdded": "2025-07-29T11:41:16.9880586Z",
              "languages": [
                {
                  "id": 1,
                  "name": "English"
                }
              ],
              "mediaInfo": {
                "width": 3840,
                "height": 2160,
                "subtitles": [
                  "eng",
                  "fre",
                  "por"
                ],
                "audioCodec": "DTS",
                "videoCodec": "AV1",
                "audioChannels": 5.1,
                "audioLanguages": [
                  "eng"
                ],
                "videoDynamicRange": "",
                "videoDynamicRangeType": ""
              },
              "sceneName": "Breaking.Bad.S02E13.ABQ.2160P.(Upscale).BluRay.Encode.AV1.DTS.5.1-R&H",
              "sourcePath": "/mnt/user/Media/Plex/Symlinks/sonarr/Breaking.Bad.S02-2160P.(Upscale).BluRay.10.bit.Encode.AV1.DTS.5.1-R&H/Breaking.Bad.S02E13.ABQ.2160P.(Upscale).BluRay.Encode.AV1.DTS.5.1-R&H.mkv",
              "relativePath": "Season 2/Breaking.Bad.S02E13.ABQ.2160P.(Upscale).BluRay.Encode.AV1.DTS.5.1-R&H.mkv",
              "releaseGroup": "R",
              "qualityVersion": 1
            },
            "instanceName": "Sonarr",
            "applicationUrl": "",
            "downloadClient": "Decypharr",
            "customFormatInfo": {
              "customFormats": [],
              "customFormatScore": 0
            },
            "downloadClientType": "qBittorrent"
          },
          "query": {},
          "params": {},
          "headers": {
            "host": "192.168.1.237:5678",
            "accept": "application/json",
            "connection": "close",
            "user-agent": "Sonarr/4.0.15.2941 (alpine 3.22.0)",
            "content-type": "application/json",
            "content-length": "3535",
            "accept-encoding": "gzip, br"
          },
          "webhookUrl": "http://192.168.1.237:5678/webhook/bd5102ad-9dc5-4415-b779-89d002c6e448",
          "executionMode": "production"
        }
      }
    ],
    "Webhook Arrs custom list Trakt": [
      {
        "json": {
          "body": {},
          "query": {},
          "params": {
            "list": "top-10-pirated-movies-of-the-week",
            "limit": "20",
            "username": "linaspurinis",
            "objectType": "movies",
            "collectionId": ":collectionId"
          },
          "headers": {
            "host": "n8n.arjanterheegde.nl",
            "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
            "cf-ray": "963badbd1b5957f0-AMS",
            "cookie": "rl_page_init_referrer=RudderEncrypt%3AU2FsdGVkX19LFX84xVgnftnn2eQF10lmBBj46RbtB%2FY%3D; rl_page_init_referring_domain=RudderEncrypt%3AU2FsdGVkX19YJkHgabteO%2BuUIZ8rmqieCBx1j44vVzo%3D; CF_AppSession=n33d8dc111ecf5bb6; CF_Authorization=eyJhbGciOiJSUzI1NiIsImtpZCI6IjVhNTlmYTg5ODVmZmRjNDBhNzZhZDJhMTRhNjczYzAzYTVjMGQ1YTM3ODdmZmYwMWZlZjVmMDU4NTkyY2EzMjAifQ.eyJhdWQiOlsiYjliNWU4ZWJmNWNkNzQ4OWU1ODZiYjA2ZTRlNGMxNDdmYWU5N2M3ZjVmZDY2MzdhZWI3NDA0NjU5YjM1MmJiZSJdLCJlbWFpbCI6ImFyamFudGVyaGVlZ2RlQG1zbi5jb20iLCJleHAiOjE3NTMyOTUxNTYsImlhdCI6MTc1MzIwODc1NiwibmJmIjoxNzUzMjA4NzU2LCJpc3MiOiJodHRwczovL2FyamFudGVyaGVlZ2RlLmNsb3VkZmxhcmVhY2Nlc3MuY29tIiwidHlwZSI6ImFwcCIsImlkZW50aXR5X25vbmNlIjoieGQyQXZaWkN4eTc5RFhzbSIsInN1YiI6Ijc4YmMxY2ZiLTFmOWEtNWJmNC04OTI2LTczMWQ4ZWRlZjhjNSIsImNvdW50cnkiOiJOTCJ9.DMzY1Dh4fHeIZzDrL_u7-2Oc5U29mV-IenmgsR4p47NmDj8pFHvNG9YnzljdIF_OwsOF10d3geiCcX9IN5kNbi-vR9a5R4X3XXA4o1Tk1RC9D7BdLZT7KLonHrp8PJOokRO3njQG29atal2HTQ9eQ1fRkqi4aVkfCy6MoINhLGFfbxy_0j67iKfM5bshiPJHN-M2-POuTqqPoz4a0GiWUu2W1IXZPLOmOy53uEapGTiVHEl2F6pUKAysIp72uafsDtWWmZv1YSsBuUWHiWeo4nCFHeMkUvwKOwoL4s1mSwZbi9KDTzDWvSu9EiqGoXi_qe2lINMsG0EnsPZvFNvmpw; rl_anonymous_id=RudderEncrypt%3AU2FsdGVkX19jie6JmgAko%2BEPqZxSQHx1wULsVtheYJUsLzylJRnGJ6BQYYtYZG4VvtYm4d0QV4q0CNfLfeuFTA%3D%3D; rl_user_id=RudderEncrypt%3AU2FsdGVkX1%2BY8L5aquiOAIm0FDtYa5GZoa2AwyHqzrQm3yOrwZdJGWf4LH1OWu6Hu1jBKa%2BBbBYHg59ytbRgFm%2FZ0Hkd0%2Bp5nxAj05lCQ7KvkTYZ3VfWxcb4bXFzEUw7NvB4aIHU8SelgtWprj0%2BlInhBCbjur2goolBTYhCDaY%3D; rl_trait=RudderEncrypt%3AU2FsdGVkX19VXM23vtlt5xgf4R3GtSQXixy7RvntCETl%2Bm9vPaomg4uWXqyq%2Byg8JWszLS2CfUIzm%2FfvOY7nhEyM%2FRtuLjF5JKXrPxGdVeAFnQl6ibA4UYtC5gw5U4NSOUxXTh2UAnFJGHCTnQOIrA%3D%3D; ph_phc_4URIAm1uYfJO7j8kWSe0J8lc8IqnstRLS7Jx8NcakHo_posthog=%7B%22distinct_id%22%3A%22e611d5428fd3ed3e48198b8ecfdcf6b6a91e7427e9139edbbf82824194541030%23e3ee4785-35e6-4f51-92a1-0ace7dd90596%22%2C%22%24sesid%22%3A%5B1753278912518%2C%2201983791-02dd-7667-bb85-363aac84ecf6%22%2C1753278907100%5D%2C%22%24epp%22%3Atrue%2C%22%24initial_person_info%22%3A%7B%22r%22%3A%22%24direct%22%2C%22u%22%3A%22https%3A%2F%2Fn8n.arjanterheegde.nl%2Fsignin%3Fredirect%3D%25252F%22%7D%7D; rl_session=RudderEncrypt%3AU2FsdGVkX19is784Ud5xg5b9JmISdNOb3F3PTDJGOzEIJ7uw83Wll%2BobDY7vEqsVwPkXcyXGVbyuto1vepqxig34BVragUSyPVWInxXxpj%2FceuX5urq9%2FY5%2BkOBgV4RLUtwA5oHkOY2BjyQwldksQA%3D%3D",
            "cdn-loop": "cloudflare; loops=1",
            "priority": "u=0, i",
            "sec-ch-ua": "\"Not)A;Brand\";v=\"8\", \"Chromium\";v=\"138\", \"Google Chrome\";v=\"138\"",
            "cf-visitor": "{\"scheme\":\"https\"}",
            "connection": "keep-alive",
            "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
            "cf-ipcountry": "NL",
            "cf-warp-tag-id": "8bdd3b37-1331-49f7-9da0-688a9331b37d",
            "sec-fetch-dest": "document",
            "sec-fetch-mode": "navigate",
            "sec-fetch-site": "none",
            "sec-fetch-user": "?1",
            "accept-encoding": "gzip, br",
            "accept-language": "en-US,en;q=0.9,nl-NL;q=0.8,nl;q=0.7,en-NL;q=0.6",
            "x-forwarded-for": "84.241.128.18",
            "cf-connecting-ip": "84.241.128.18",
            "sec-ch-ua-mobile": "?0",
            "x-forwarded-proto": "https",
            "sec-ch-ua-platform": "\"macOS\"",
            "cf-access-jwt-assertion": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjVhNTlmYTg5ODVmZmRjNDBhNzZhZDJhMTRhNjczYzAzYTVjMGQ1YTM3ODdmZmYwMWZlZjVmMDU4NTkyY2EzMjAifQ.eyJhdWQiOlsiYjliNWU4ZWJmNWNkNzQ4OWU1ODZiYjA2ZTRlNGMxNDdmYWU5N2M3ZjVmZDY2MzdhZWI3NDA0NjU5YjM1MmJiZSJdLCJlbWFpbCI6ImFyamFudGVyaGVlZ2RlQG1zbi5jb20iLCJleHAiOjE3NTMyOTUxNTYsImlhdCI6MTc1MzIwODc1NiwibmJmIjoxNzUzMjA4NzU2LCJpc3MiOiJodHRwczovL2FyamFudGVyaGVlZ2RlLmNsb3VkZmxhcmVhY2Nlc3MuY29tIiwidHlwZSI6ImFwcCIsImlkZW50aXR5X25vbmNlIjoieGQyQXZaWkN4eTc5RFhzbSIsInN1YiI6Ijc4YmMxY2ZiLTFmOWEtNWJmNC04OTI2LTczMWQ4ZWRlZjhjNSIsImNvdW50cnkiOiJOTCJ9.DMzY1Dh4fHeIZzDrL_u7-2Oc5U29mV-IenmgsR4p47NmDj8pFHvNG9YnzljdIF_OwsOF10d3geiCcX9IN5kNbi-vR9a5R4X3XXA4o1Tk1RC9D7BdLZT7KLonHrp8PJOokRO3njQG29atal2HTQ9eQ1fRkqi4aVkfCy6MoINhLGFfbxy_0j67iKfM5bshiPJHN-M2-POuTqqPoz4a0GiWUu2W1IXZPLOmOy53uEapGTiVHEl2F6pUKAysIp72uafsDtWWmZv1YSsBuUWHiWeo4nCFHeMkUvwKOwoL4s1mSwZbi9KDTzDWvSu9EiqGoXi_qe2lINMsG0EnsPZvFNvmpw",
            "upgrade-insecure-requests": "1",
            "cf-access-authenticated-user-email": "arjanterheegde@msn.com"
          },
          "webhookUrl": "http://192.168.1.237:5678/webhook/5b328176-d63b-4f85-a087-d4f4e7b15bc8/:username/:list/:limit/:objectType/:collectionId",
          "executionMode": "production"
        }
      }
    ],
    "Webhook Arrs custom list JustWatch": [
      {
        "json": {
          "body": {},
          "query": {},
          "params": {
            "limit": "15",
            "filter": "",
            "objectType": "MOVIE",
            "collectionId": "124029"
          },
          "headers": {
            "host": "192.168.1.237:5678",
            "accept": "application/json",
            "connection": "close",
            "user-agent": "Sonarr/4.0.15.2941 (alpine 3.22.0)",
            "accept-encoding": "gzip, br"
          },
          "webhookUrl": "http://192.168.1.237:5678/webhook/5b328176-d63b-4f85-a087-d4f4e7b15bc8/:filter/:limit/:objectType/:collectionId",
          "executionMode": "production"
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "00e0770c-72d4-4ca1-87c3-cd78a02d550d",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "Merge3",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "Loop Over Items4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Add item to collection2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Set fields for collection",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge2": {
      "main": [
        [
          {
            "node": "Move collection item2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge3": {
      "main": [
        [
          {
            "node": "Search season pack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond ": {
      "main": [
        [
          {
            "node": "Get Overseerr users",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Radarr": {
      "main": [
        [
          {
            "node": "If tag unmonitored exists",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If tag unmonitored exists Sonarr",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If movie4": {
      "main": [
        [
          {
            "node": "Get Radarr information from tmdbId",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Sonarr information from tvdbId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond 200": {
      "main": [
        [
          {
            "node": "Get Overseerr users",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Radarr movie": {
      "main": [
        [
          {
            "node": "Create dummy file for movie1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search movie": {
      "main": [
        [
          {
            "node": "Respond 200",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitor movie": {
      "main": [
        [
          {
            "node": "Search movie",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sonarr series": {
      "main": [
        [
          {
            "node": "Sonarr runtime s01e01",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Trakt API": {
      "main": [
        [
          {
            "node": "Format JustWatch results1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitor series": {
      "main": [
        [
          {
            "node": "Monitor all seasons",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refresh movie1": {
      "main": [
        [
          {
            "node": "Refresh Plex",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refresh series": {
      "main": [
        [
          {
            "node": "Monitor all seasons1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get collection1": {
      "main": [
        [
          {
            "node": "Get all items in collection1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Refresh series1": {
      "main": [
        [
          {
            "node": "Refresh Plex Series",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Remove item from collection1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items3": {
      "main": [
        [],
        [
          {
            "node": "Get GUID from imdbId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch eventType": {
      "main": [
        [
          {
            "node": "If Radarr",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Radarr movie",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Sonarr series",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Tautulli": {
      "main": [
        [
          {
            "node": "If movie4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call JustWatch API": {
      "main": [
        [
          {
            "node": "Format JustWatch results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Webhook": {
      "main": [
        [
          {
            "node": "Check if collection is not empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search season pack": {
      "main": [
        [
          {
            "node": "Respond ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Overseerr users": {
      "main": [
        [
          {
            "node": "Filter Overseerr user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If found Plex GUID1": {
      "main": [
        [
          {
            "node": "Get ratingKey from GUID1",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Monitor all seasons": {
      "main": [
        [
          {
            "node": "Merge3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Webhook1": {
      "main": [
        [
          {
            "node": "Check if collection is not empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Respond to Webhook2": {
      "main": [
        []
      ]
    },
    "Get GUID from imdbId": {
      "main": [
        [
          {
            "node": "If found Plex GUID1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monitor all seasons1": {
      "main": [
        [
          {
            "node": "Search season pack1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sonarr serie lookup1": {
      "main": [
        [
          {
            "node": "Format JustWatch results add tvdbId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Overseerr user": {
      "main": [
        [
          {
            "node": "Check if Overseerr user is found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If deletedFiles exist": {
      "main": [
        [
          {
            "node": "Get active Tautulli sessions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move collection item2": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sonarr runtime s01e01": {
      "main": [
        [
          {
            "node": "Create dummy file for series with runtime",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If objectType is movie": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Sonarr serie lookup1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove all dummy files": {
      "main": [
        [
          {
            "node": "Get Sonarr information for series",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove unmonitored tag": {
      "main": [
        [
          {
            "node": "If deletedFiles exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add item to collection2": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add item to collection3": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format JustWatch results": {
      "main": [
        [
          {
            "node": "If objectType is movie",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get ratingKey from GUID1": {
      "main": [
        [
          {
            "node": "Add item to collection3",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          },
          {
            "node": "Merge2",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Format JustWatch results1": {
      "main": [
        [
          {
            "node": "Respond to Webhook2",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "If tag unmonitored exists": {
      "main": [
        [
          {
            "node": "Remove unmonitored tag",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If deletedFiles exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields for collection": {
      "main": [
        [
          {
            "node": "Wait 5 minutes before process collection in Plex",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Collection Items1": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create dummy file for movie1": {
      "main": [
        [
          {
            "node": "Refresh movie1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get active Tautulli sessions": {
      "main": [
        [
          {
            "node": "Get all active sessions for file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all items in collection1": {
      "main": [
        [
          {
            "node": "Check if collection contains items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove item from collection1": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove unmonitored tag Sonarr": {
      "main": [
        [
          {
            "node": "Remove all dummy files",
            "type": "main",
            "index": 0
          },
          {
            "node": "If deletedFiles exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Arrs Dummy file update": {
      "main": [
        [
          {
            "node": "Switch eventType",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Arrs custom list Trakt": {
      "main": [
        [
          {
            "node": "Call Trakt API",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if request already exists": {
      "main": [
        [
          {
            "node": "Check if no existing request for media exist for Overseerr user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Overseerr user is found": {
      "main": [
        [
          {
            "node": "Get last 20 Overseerr requests from user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if collection is not empty": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all active sessions for file": {
      "main": [
        [
          {
            "node": "Terminate Tautulli sessions for dummy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If tag unmonitored exists Sonarr": {
      "main": [
        [
          {
            "node": "Remove unmonitored tag Sonarr",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If deletedFiles exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Sonarr information for series": {
      "main": [
        [
          {
            "node": "Refresh series",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Radarr information from tmdbId": {
      "main": [
        [
          {
            "node": "Monitor movie",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Sonarr information from tvdbId": {
      "main": [
        [
          {
            "node": "Monitor series",
            "type": "main",
            "index": 0
          },
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Arrs custom list JustWatch": {
      "main": [
        [
          {
            "node": "Call JustWatch API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if collection contains items1": {
      "main": [
        [
          {
            "node": "Split Out Collection Items1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format JustWatch results add tvdbId": {
      "main": [
        [
          {
            "node": "Respond to Webhook1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get last 20 Overseerr requests from user": {
      "main": [
        [
          {
            "node": "Check if request already exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create dummy file for series with runtime": {
      "main": [
        [
          {
            "node": "Refresh series1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 5 minutes before process collection in Plex": {
      "main": [
        [
          {
            "node": "Get collection1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if no existing request for media exist for Overseerr user": {
      "main": [
        [
          {
            "node": "Make Overseerr request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 文件管理

需要付费吗?

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

工作流信息
难度等级
高级
节点数量87
分类1
节点类型13
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

外部链接
在 n8n.io 查看

分享此工作流