visit-website-reworked

Public

Forked from vadimfedenko/visit-website-reworked

Reworded plugin with proxy functionality that provides LLMs with the capacity to "visit" websites by providing them with the links, image URLs and text content of any web page.

62 Downloads

1 star

README

Visit Website Reworked for LM Studio

An LM Studio plugin for fetching web pages, extracting structured page data, and downloading images for use in chat.

Version 1.3.0 focuses on more reliable HTML parsing, safer image downloads, better blocked-page handling, and clearer output for LLM workflows.

Tools

  • Visit Website: fetches a URL and returns title, structured headings, links, images, text content, and fetch diagnostics.
  • Download Images: downloads remote image URLs or extracts images from a website URL, stores them locally, and returns renderable Markdown image references.

Visit Website Output

Visit Website returns structured data such as:

{
  "url": "https://example.com",
  "title": "Example Domain",
  "headings": {
    "h1": ["Example Domain"],
    "h2": [],
    "h3": []
  },
  "fetch": {
    "source": "direct",
    "finalUrl": "https://example.com/",
    "statusCode": 200,
    "server": "..."
  },
  "links": [],
  "images": [],
  "content": "..."
}

Headings are returned as headings: { h1[], h2[], h3[] }, with up to 5 entries per level.

Key Improvements in v1.3.0

  • Replaced regex-based HTML parsing with node-html-parser.
  • Improved link, image, heading, and text extraction on malformed or nested HTML.
  • Added structured heading extraction for all h1 to h3 headings, up to 5 per level.
  • Added an in-memory page cache with 20 entries and a 3-minute TTL.
  • Added a 12-second timeout for each fetch attempt to avoid long network hangs.
  • Added a Jina Fallback privacy toggle for blocked-page retries through r.jina.ai.
  • Batched image downloads with 3 concurrent requests to reduce CDN rate-limiting.
  • Added content-type validation so HTML error pages are not saved as broken image files.
  • Updated the spoofed User-Agent pool to Chrome 124, Firefox 125, and Safari 17.

Reliability and Fallback Behavior

The plugin first tries to fetch the target URL directly. If the page appears blocked or returns a common anti-bot status such as 401, 403, 429, or 503, it can retry through r.jina.ai.

This fallback is enabled by default to preserve existing behavior. Users who do not want URLs forwarded to a third-party service can disable Jina Fallback in plugin settings.

The fetch metadata in Visit Website shows whether content came from:

  • direct: fetched from the original site.
  • jina: fetched through the fallback service.

Image Extraction and Downloads

Image extraction supports:

  • Standard HTML image attributes: src, data-src, data-original, and srcset.
  • Markdown image links returned by fallback content.
  • Remote HTTP(S) image URLs.
  • Local image paths when passed directly to Download Images.

Downloads are batched in groups of 3 with short pauses between batches. Each remote response must have an image/* content type before it is saved.

When possible, the plugin creates compact WebP thumbnails. sharp remains an optional dependency; if thumbnail creation fails, the original downloaded image is returned.

Configuration

Available settings:

  • Max Links: maximum number of links returned by Visit Website.
  • Max Images: maximum number of images extracted and downloaded.
  • Max Content: maximum text content length returned.
  • Jina Fallback: enables or disables retry via r.jina.ai for blocked pages.

Use 0 to exclude a section. Use -1 for automatic defaults where supported.

Installation

Install from LM Studio Hub:

Click Run in LM Studio.

Local Development

From the project directory:

npm install
npx.cmd lms dev

If your shell allows direct npx execution, this also works:

npx lms dev

Usage Examples

Ask the assistant:

Open https://example.com and return the title, headings, links, images, and content.

Or:

Download images from https://example.com.

For targeted extraction:

Open this page and prioritize links and text related to pricing and documentation: https://example.com.

Works well with:

Typical workflow: use DuckDuckGo Reworked to find relevant URLs, Visit Website Reworked to extract page content and images, then Analyze Images to inspect downloaded images.