Skip to content

Instantly share code, notes, and snippets.

@alx
Created June 19, 2025 10:11
Show Gist options
  • Save alx/207f333f37f83466951d6ffd9eb44c15 to your computer and use it in GitHub Desktop.
Save alx/207f333f37f83466951d6ffd9eb44c15 to your computer and use it in GitHub Desktop.
Youtube url post to linkedin
{
"name": "Youtube url post to linkedin",
"nodes": [
{
"parameters": {
"formTitle": "Youtube transcribe",
"formFields": {
"values": [
{
"fieldLabel": "Youtube URL",
"placeholder": "https://www.youtube.com/watch?v=...",
"requiredField": true
}
]
},
"options": {}
},
"type": "n8n-nodes-base.formTrigger",
"typeVersion": 2.2,
"position": [
-20,
-250
],
"id": "2295842c-3791-4db8-a5eb-540b215c42a7",
"name": "On form submission",
"webhookId": "4e24c81a-de28-4018-a1db-31357c5b5d6d"
},
{
"parameters": {
"command": "=yt-dlp -v --skip-download --write-subs --write-auto-subs --sub-lang en --sub-format ttml --convert-subs srt --output \"transcript.%(ext)s\" '{{ $json[\"Youtube URL\"] }}'"
},
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
200,
-100
],
"id": "11c90076-e0d6-487f-89b1-1944f41b7fce",
"name": "Download srt subtitles"
},
{
"parameters": {
"fileSelector": "transcript.en.srt",
"options": {}
},
"type": "n8n-nodes-base.readWriteFile",
"typeVersion": 1,
"position": [
640,
-100
],
"id": "bf7af1d4-212d-42e4-9ec7-b7b22d26590f",
"name": "Load subtitles"
},
{
"parameters": {
"command": "sed -i -e '/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9] --> [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]$/d' -e '/^[[:digit:]]\\{1,3\\}$/d' -e 's/<[^>]*>//g' -e 's/^\\n$//g' transcript.en.srt"
},
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
420,
-100
],
"id": "b50e9eec-9a8c-48a2-8c2c-08994e5a49d2",
"name": "sed clean"
},
{
"parameters": {
"promptType": "define",
"text": "=Create a professional LinkedIn article based on the attached video subtitles (or transcript). The article should be engaging, insightful, and formatted for LinkedIn's audience.\n\nReturn the response in the following JSON structure: {\\\"article_title\\\": \\\"...\\\", \\\"article_intro\\\": \\\"...\\\", \\\"article_content\\\": \\\"...\\\"}\n\nArticle Guidelines:\n1. **Title:** Catchy, under 100 characters, SEO-friendly.\n2. **Intro:** Brief (1-2 sentences) hook summarizing the key theme.\n3. **Content:** Structured in digestible paragraphs with key takeaways, numbered/list formats if applicable, and a strong conclusion. Maintain a professional tone. Add tags at the end of the article content.\n\nFormatting rules:\n- do not use markdown in output\n- do not use ** for bold\n- use emoji if necessary\n- use line break to make the content readable.\n\nSubtitles/Transcript:\n\n{{ $json.data }}",
"hasOutputParser": true,
"batching": {}
},
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.7,
"position": [
1080,
-100
],
"id": "34792bf0-09d9-4587-b72a-3617cf46d8aa",
"name": "Basic LLM Chain"
},
{
"parameters": {
"model": "qwen/qwen3-30b-a3b:free",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"typeVersion": 1,
"position": [
1108,
120
],
"id": "fc3fbc2c-44b9-42fb-9541-86be82c2d1bc",
"name": "OpenRouter Chat Model",
"credentials": {
"openRouterApi": {
"id": "wZnhksF03ojCxGou",
"name": "OpenRouter account"
}
}
},
{
"parameters": {
"operation": "text",
"options": {}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
860,
-100
],
"id": "a96ba6c0-ce64-4672-9f70-7f64688046dd",
"name": "Read substitles"
},
{
"parameters": {
"jsonSchemaExample": "{\n\t\"article_title\": \"article title\",\n\t\"article_intro\": \"article intro\",\n\t\"article_content\": \"article content\"\n}"
},
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"typeVersion": 1.2,
"position": [
1228,
120
],
"id": "38fa618f-d0db-4f20-8301-cf59d08516e9",
"name": "Structured Output Parser"
},
{
"parameters": {
"person": "ylbZEC5gN2",
"text": "={{ $json.output.article_content }}",
"shareMediaCategory": "ARTICLE",
"additionalFields": {
"description": "={{ $json.output.article_intro }}",
"originalUrl": "={{ $('On form submission').item.json['Youtube URL'] }}",
"thumbnailBinaryPropertyName": "data",
"title": "={{ $json.output.article_title }}"
}
},
"type": "n8n-nodes-base.linkedIn",
"typeVersion": 1,
"position": [
1676,
-250
],
"id": "75960605-5172-4b70-b303-6afbbc84a627",
"name": "LinkedIn",
"credentials": {
"linkedInOAuth2Api": {
"id": "nhkKToaeiU8mW85R",
"name": "LinkedIn account"
}
}
},
{
"parameters": {
"command": "=yt-dlp -v --skip-download --write-thumbnail --output \"thumbnail.%(ext)s\" '{{ $json[\"Youtube URL\"] }}'"
},
"type": "n8n-nodes-base.executeCommand",
"typeVersion": 1,
"position": [
860,
-400
],
"id": "df54b917-5bb2-46c7-8133-e637efbf6444",
"name": "Download srt subtitles1"
},
{
"parameters": {
"fileSelector": "thumbnail.webp",
"options": {}
},
"type": "n8n-nodes-base.readWriteFile",
"typeVersion": 1,
"position": [
1158,
-400
],
"id": "de9b2a12-39cb-47b0-a6dc-d590bef62638",
"name": "Load thumbnail"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
1456,
-250
],
"id": "8c1f618c-65d6-4527-ad33-a0974720dc69",
"name": "Merge"
}
],
"pinData": {},
"connections": {
"On form submission": {
"main": [
[
{
"node": "Download srt subtitles1",
"type": "main",
"index": 0
},
{
"node": "Download srt subtitles",
"type": "main",
"index": 0
}
]
]
},
"Download srt subtitles": {
"main": [
[
{
"node": "sed clean",
"type": "main",
"index": 0
}
]
]
},
"Load subtitles": {
"main": [
[
{
"node": "Read substitles",
"type": "main",
"index": 0
}
]
]
},
"sed clean": {
"main": [
[
{
"node": "Load subtitles",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model": {
"ai_languageModel": [
[
{
"node": "Basic LLM Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Read substitles": {
"main": [
[
{
"node": "Basic LLM Chain",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Basic LLM Chain",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Basic LLM Chain": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Download srt subtitles1": {
"main": [
[
{
"node": "Load thumbnail",
"type": "main",
"index": 0
}
]
]
},
"Load thumbnail": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "LinkedIn",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "d748bee1-2169-4b4f-b155-4360cb0e544c",
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "881a37192b7a9d31e6cf6ef049fdd6448a2f275751e823aaa39ae9a88252d4a2"
},
"id": "wpaAe4QU5hnBAtvq",
"tags": [
{
"name": "youtube",
"id": "HmyJs4MEV6fnSNZ6",
"createdAt": "2025-06-19T09:50:08.750Z",
"updatedAt": "2025-06-19T09:50:08.750Z"
},
{
"name": "linkedin",
"id": "aaTyt6lKGkUspPAp",
"createdAt": "2025-06-19T09:50:10.865Z",
"updatedAt": "2025-06-19T09:50:10.865Z"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment