npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-google-news-decoder

v0.1.0

Published

n8n node to decode Google News URLs

Readme

🔓 n8n-nodes-google-news-decoder

A powerful n8n custom node that decodes Google News encoded URLs into clean, original article links with built-in caching and advanced configuration options.

npm version n8n License: MIT


📋 Table of Contents


🎯 Overview

This package provides a custom n8n node that transforms complex Google News RSS encoded URLs into clean, decoded URLs with intelligent caching and customizable decoding parameters.

Before:

https://news.google.com/rss/articles/CBMihAFBVV95cUxNRnMtZDFfUTgx...

After:

https://original-news-site.com/article-title-here

✨ Features

  • 🔗 URL Decoding - Converts Google News encoded RSS links to original URLs
  • 💾 Smart Caching - Built-in LRU cache (max 1000 items) with configurable TTL
  • 📊 Metadata Extraction - Retrieves signature, timestamp, and GUID
  • 🎛️ Customizable - Configure RPC headers, locales, and endpoints
  • 🚀 Simple Integration - Works seamlessly with n8n workflows
  • 🎯 RSS Optimized - Perfect for Google News RSS → article extraction pipelines
  • Performance - Sequential processing with error handling and cache support

Output Data

Each decoded URL returns:

{
  "guid": "CBMihAFBVV95cUxNRnMtZDFfUTgx...",
  "encodedUrl": "https://news.google.com/rss/articles/...",
  "decodedUrl": "https://original-news-site.com/article",
  "timestamp": "1705334400",
  "signature": "CBMiXWh0dHBz...",
  "cached": false,
  "cacheAge": "0s" // Only present if cached=true
}

📦 Prerequisites

| Requirement | Version | | ----------- | --------------------- | | Node.js | 18.x or 20.x | | npm | 8.x or higher | | n8n | 1.12+ | | OS | Windows, Linux, macOS |


🚀 Installation

Step 1: Install n8n (if needed)

# Install n8n globally
npm install -g n8n

# Start n8n
n8n start

Step 2: Install the Custom Node

Navigate to your n8n configuration folder:

# Windows (typically)
cd C:\Users\<username>\.n8n

# macOS/Linux (typically)
cd ~/.n8n

Create the nodes directory (if not present) and initialize a new Node.js project:

mkdir -p nodes
cd nodes
npm init -y

Install the package:

Option A: From Local Path

npm install /path/to/n8n-nodes-google-news-decoder

Option B: From GitHub

npm install git+https://github.com/ziedkefidev-cell/n8n-nodes-google-news-decoder.git

Option C: From npm (if published)

npm install n8n-nodes-google-news-decoder

Step 3: Restart n8n

n8n start

🎉 The node will now appear in n8n under the name "Google News Decoder"


⚙️ Configuration

Basic Configuration

| Parameter | Type | Required | Description | | ----------- | ------ | -------- | --------------------------------- | | Encoded URL | String | Yes | Google News encoded URL to decode |

Advanced Options

🔧 HTML Extraction

| Parameter | Type | Default | Description | | ------------------- | ------ | ------------- | ---------------------------- | | Signature Attribute | String | data-n-a-sg | HTML attribute for signature | | Timestamp Attribute | String | data-n-a-ts | HTML attribute for timestamp |

🌍 Localization

| Parameter | Type | Default | Description | | --------- | ------ | ------- | --------------------------------------- | | Locale | String | US:en | Locale for decode request (e.g., FR:fr) |

🔌 API Configuration

| Parameter | Type | Default | Description | | --------------- | ------ | ---------------------------------------------------------- | ----------------------------------- | | Decode Endpoint | String | https://news.google.com/_/DotsSplashUi/data/batchexecute | Google's internal decoding endpoint | | RPC Header Base | JSON | ["X", "X", 1, [1, 1, 1], ...] | Custom RPC header structure |

💾 Caching

| Parameter | Type | Default | Description | | ------------------- | ------- | ------- | --------------------------------------- | | Enable Cache | Boolean | true | Enable/disable result caching | | Cache TTL (minutes) | Number | 5 | Cache time-to-live (shown when enabled) |

Cache Features:

  • LRU eviction (max 1000 items)
  • Per-URL caching
  • Cached responses include cacheAge field
  • Automatic TTL expiration

🌐 HTTP Headers

| Header Name | Default Value | Description | | ----------- | ----------------------------------------------- | ------------------- | | User-Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64) ... | Browser user agent | | Referer | https://www.google.com/ | HTTP referer header |

Additional custom headers can be added as needed.


💡 Usage

Basic Example

  1. Add Google News Decoder node to your workflow
  2. Configure the Encoded URL field with a Google News link
  3. Execute the workflow

Input:

https://news.google.com/rss/articles/CBMiXWh0dHBzOi8vd3d3...

Output:

{
  "guid": "CBMiXWh0dHBzOi8vd3d3...",
  "encodedUrl": "https://news.google.com/rss/articles/CBMi...",
  "decodedUrl": "https://techcrunch.com/2024/01/15/ai-story",
  "timestamp": "1705334400",
  "signature": "CBMiXWh0dHBz...",
  "cached": false
}

With Caching Enabled

First Request:

{
  "decodedUrl": "https://example.com/article",
  "cached": false
}

Subsequent Request (within TTL):

{
  "decodedUrl": "https://example.com/article",
  "cached": true,
  "cacheAge": "45s"
}

🔄 Example Workflow

graph LR
    A[RSS Feed Node] -->|encoded URLs| B[Google News Decoder]
    B -->|clean URLs| C[HTTP Request Node]
    C -->|article content| D[Process/Store]

    style B fill:#4285F4,color:#fff

Workflow Steps:

  1. RSS Feed Node - Fetches Google News RSS feed with encoded links
  2. Google News Decoder Node - Decodes URLs to original article links (with caching)
  3. HTTP Request Node - Fetches the actual article content
  4. Processing Node - Parse, store, or analyze the article data

Example Workflow JSON

{
  "nodes": [
    {
      "name": "RSS Feed",
      "type": "n8n-nodes-base.rssFeedRead",
      "parameters": {
        "url": "https://news.google.com/rss/search?q=technology"
      }
    },
    {
      "name": "Google News Decoder",
      "type": "n8n-nodes-google-news-decoder.googleNewsDecoder",
      "parameters": {
        "encodedUrl": "={{ $json.link }}",
        "advanced": {
          "enableCache": true,
          "cacheTTL": 10
        }
      }
    },
    {
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "parameters": {
        "url": "={{ $json.decodedUrl }}"
      }
    }
  ]
}

🚀 Advanced Features

Custom RPC Header Base

If Google changes their API structure, you can update the RPC header base:

["X", "X", 1, [1, 1, 1], 1, 1, null, 0, 0, null, 0]

Format: Must be a valid JSON array matching Google's expected structure.

Custom Locale Configuration

For international Google News sources:

| Locale | Description | | ------- | ------------------------ | | US:en | United States (English) | | FR:fr | France (French) | | DE:de | Germany (German) | | JP:ja | Japan (Japanese) | | UK:en | United Kingdom (English) |

Cache Management

How the cache works:

  1. LRU Eviction: When cache reaches 1000 items, oldest entries are removed
  2. TTL Expiration: Cached results expire after configured minutes
  3. Per-URL Keying: Each unique encoded URL has its own cache entry
  4. In-Memory: Cache is lost on n8n restart (session-based)

Best Practices:

  • Enable cache for workflows processing the same URLs repeatedly
  • Use shorter TTL (1-5 min) for frequently updated news
  • Use longer TTL (30-60 min) for stable article lists
  • Disable cache for one-time bulk processing

🛠️ Development

Clone and Setup

# Clone the repository
git clone https://github.com/<your-username>/n8n-nodes-google-news-decoder.git

# Navigate to directory
cd n8n-nodes-google-news-decoder

# Install dependencies
npm install

# Build the project
npm run build

Build Commands

# Development build
npm run build

# Watch mode (auto-rebuild on changes)
npm run dev

# Clean build artifacts
npm run clean

# Local test (without n8n)
npm run test:local

Implementation Highlights

Core Features:

  • ✅ Sequential item processing with error handling
  • ✅ In-memory LRU cache with TTL
  • ✅ Regex escaping for HTML attribute extraction
  • ✅ Flexible article ID extraction from URL
  • ✅ Configurable RPC header structure
  • ✅ Custom HTTP headers support
  • ✅ Continue-on-fail support

🧪 Testing

Local HTTP Test (without n8n)

Run a standalone test to verify the decoder works:

# Install test dependencies
npm install node-fetch

# Build the project
npm run build

# Run local test
npm run test:local

Expected Output:

🧪 Testing Google News Decoder (Local Mode)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Input URL:  https://news.google.com/rss/articles/CBMi...
Decoded URL: https://techcrunch.com/2024/01/15/ai-article
GUID:       CBMiXWh0dHBz...
Timestamp:  1705334400

✅ Decode successful!

Testing in n8n

  1. Create a new workflow
  2. Add a Manual Trigger node
  3. Add Google News Decoder node
  4. Configure with test URL:
    https://news.google.com/rss/articles/CBMiXWh0dHBzOi8vd3d3LnRlY2hjcnVuY2guY29tLzIwMjQvMDEvMTUvYWktc3Rvcnkv0gEA
  5. Execute and check output

Test Cache Behavior

  1. Execute workflow with cache enabled
  2. Check output: "cached": false
  3. Execute again within TTL
  4. Check output: "cached": true, "cacheAge": "15s"

🔧 Troubleshooting

Node Not Appearing in n8n

Problem: Node doesn't show up in the n8n interface

Solutions:

  1. Verify installation in ~/.n8n/nodes/node_modules/
    ls ~/.n8n/nodes/node_modules/n8n-nodes-google-news-decoder
  2. Check package.json has correct n8n configuration
  3. Restart n8n completely
    pkill -f n8n
    n8n start
  4. Check n8n logs for errors
    n8n start --loglevel debug

Decoding Errors

Issue: "Could not extract decoding keys from Google News page"

Causes & Solutions:

  • Google changed HTML structure
    • ✅ Update Signature Attribute and Timestamp Attribute in Advanced options
    • ✅ Inspect a Google News page to find new attribute names
  • Invalid encoded URL
    • ✅ Ensure URL starts with https://news.google.com/
    • ✅ URL must contain /articles/ path

Issue: "Invalid decode response format"

Causes & Solutions:

  • Google changed API response structure
    • ✅ Update RPC Header Base in Advanced options
    • ✅ Check Google's current API format
  • Network timeout
    • ✅ Check internet connection
    • ✅ Verify firewall allows requests to news.google.com

Issue: "Could not extract article ID"

Causes & Solutions:

  • Non-standard URL format
    • ✅ URL must match pattern: /articles/[ARTICLE_ID]
    • ✅ ARTICLE_ID typically starts with CB

Cache Issues

Issue: Cache not working / Always returns "cached": false

Solutions:

  1. Verify Enable Cache is set to true in Advanced options
  2. Check Cache TTL is greater than 0
  3. Ensure you're using the exact same encoded URL
  4. Remember cache is lost on n8n restart

Issue: Want to clear cache

Solution:

  • Restart n8n (cache is in-memory only)
  • Or disable and re-enable cache in node settings

Build Errors

Problem: npm run build fails

Solutions:

# Clean and rebuild
rm -rf dist node_modules package-lock.json
npm install
npm run build

# If TypeScript errors persist
npm install --save-dev typescript@latest
npm run build

⚠️ Important Notes

  • 🔄 This node relies on Google's internal URL structure and decoding endpoint
  • ⚡ Google may change their URL format or API at any time
  • 🔒 No API key or authentication required (uses public endpoints)
  • 💾 Cache is in-memory and cleared on n8n restart
  • 📊 Maximum 1000 cached items (LRU eviction)
  • 🌐 Works with all Google News country domains
  • ⚖️ Not affiliated with or endorsed by Google

Rate Limiting

While the node itself has no rate limits, Google may rate-limit requests. Recommendations:

  • Use caching to reduce API calls
  • Add delay between batches (use n8n's Wait node)
  • Process items in smaller batches

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contribution Ideas

  • 🌍 Add proxy feature
  • 🔄 Batch processing optimization

📬 Support

If you encounter any issues or have questions:


🙏 Acknowledgments

  • Built for the n8n workflow automation platform
  • Inspired by the need for clean, trackable news URLs
  • Thanks to the n8n community for feedback and testing

Made with ❤️ for the n8n community

⭐ Star this repository if you find it helpful!