Sd Download logo

Sd Download

Community
cookjohn
sd-download

Download PDF from ScienceDirect articles. Requires institutional or subscriber access.

Overview

Publishercookjohn
Repositorysd-skills
Skill namesd-download
Stars
88
Forks
12
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by cookjohn on GitHub. Read the source before you install it.

Installation

Install the Sd Download AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/cookjohn/sd-skills/tree/master/skills/sd-download
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/cookjohn/sd-skills.git /tmp/sd-skills
mkdir -p .claude/skills
cp -r /tmp/sd-skills/skills/sd-download .claude/skills/sd-download
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sd Download in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sd Download on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sd Download is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

ScienceDirect PDF Download

Download PDF files from ScienceDirect articles to the user's local disk.

Prerequisites

  • The user must have access to the article (institutional subscription, open access, or personal subscription).
  • If the article is behind a paywall and the user has no access, the download will fail.

Single Article Download

Step 1: Navigate to article page and extract PDF link

If already on the article page, skip navigation. Otherwise use navigate_page with initScript:

navigate_page({
  url: "{BASE_URL}/science/article/pii/{PII}",
  initScript: "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"
})

Then extract the PDF URL with evaluate_script:

javascript
async () => {
  // Wait for page to load
  for (let i = 0; i < 20; i++) {
    if (document.querySelector('a[href*="pdfft"]') || document.querySelector('.access-options')) break;
    await new Promise(r => setTimeout(r, 500));
  }

  const pdfLink = document.querySelector('a[href*="pdfft"][class*="accessbar"]')
               || document.querySelector('a[href*="pdfft"]');
  if (pdfLink) {
    return { pdfUrl: pdfLink.href };
  }

  const noAccess = document.querySelector('.access-options, .get-access, [class*="GetAccess"]');
  if (noAccess) {
    return { error: 'No access. User needs institutional or subscriber access.' };
  }
  return { error: 'PDF link not found on this page.' };
}

Step 2: Navigate to PDF URL

Open the PDF URL with initScript:

navigate_page({
  url: "{pdfUrl}",
  initScript: "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"
})

Step 3: Handle Cloudflare verification

After navigation, wait 5s then check the page state with evaluate_script:

javascript
async () => {
  await new Promise(r => setTimeout(r, 5000));
  return {
    contentType: document.contentType,
    title: document.title,
    url: window.location.href.substring(0, 80)
  };
}

Three possible outcomes:

A) contentType === 'application/pdf' → PDF loaded directly. Skip to Step 4.

B) Title is "Security verification" or body contains "Are you a robot" → Turnstile checkbox appeared. Auto-click:

  1. Use take_snapshot to get the a11y tree. Find the checkbox inside the Cloudflare iframe:
    Iframe "包含 Cloudflare 安全质询的小组件"
      checkbox "确认您是真人"   ← target uid
  2. Use click(uid) on the checkbox element. (Chrome DevTools MCP works at CDP protocol level and can interact with cross-origin iframes.)
  3. Wait 5s, then re-check document.contentType:
    • If application/pdf → success, proceed to Step 4.
    • If still on verification → retry click once. After 2 failed attempts, tell user: "请在浏览器中完成验证后告知我。"

C) Title is "请稍候…" → JS challenge still running. Wait another 5s and re-check. Usually resolves to A or B.

Step 4: Trigger download to local disk

Once contentType === 'application/pdf', the PDF is displayed in browser but NOT saved to disk yet. Trigger the actual download with evaluate_script:

javascript
(pii) => {
  const a = document.createElement('a');
  a.href = window.location.href;
  a.download = pii + '-main.pdf';
  document.body.appendChild(a);
  a.click();
  document.body.removeChild(a);
  return { downloaded: true, filename: pii + '-main.pdf' };
}

Pass the PII as an argument so the filename is meaningful (e.g. S0022169426003136-main.pdf).

Tell the user the PDF has been downloaded and the filename.

Batch Download from Search Results

Note: Batch download requires authentication. Checkboxes and download buttons are only visible to logged-in users.

Step 1: Select articles

On the search results page, select articles using checkboxes. Each checkbox id is the PII.

Step 2: Submit download form

Use evaluate_script:

javascript
(piis) => {
  piis.forEach(pii => {
    const cb = document.getElementById(pii);
    if (cb && !cb.checked) cb.click();
  });

  const downloadBtn = document.querySelector('.download-all-link-button');
  if (downloadBtn) {
    downloadBtn.click();
    return { success: true, message: 'Download initiated for selected articles.' };
  }

  const form = document.querySelector('form[action*="pdf/download"]');
  if (!form) return { error: 'Download form not found. User may need to log in.' };
  return { error: 'Download button not found.' };
}

PDF URL Pattern

{BASE_URL}/science/article/pii/{PII}/pdfft?md5={HASH}&pid=1-s2.0-{PII}-main.pdf

The md5 hash is unique per article and session. It cannot be constructed — it must be extracted from the page.

Notes

  • This skill is set to disable-model-invocation: true — it must be explicitly invoked with /sd-download.
  • Open access articles can be downloaded without authentication.
  • For subscription articles, the user must be authenticated (institutional access, VPN, or personal subscription).
  • After solving Cloudflare once, subsequent PDF downloads in the same session work without interruption.
  • If download fails, suggest the user check their access status or try logging in.

Frequently asked questions

What does the Sd Download AI skill do?

Download PDF from ScienceDirect articles. Requires institutional or subscriber access.

Why use Sd Download on TypingMind?

Because you install it once and use it with any model. Sd Download is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sd Download in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/cookjohn/sd-skills/tree/master/skills/sd-download. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Sd Download?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sd Download?

As many as you like. As long as a model supports skills, you can use Sd Download with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sd Download AI skill free?

It is published on GitHub by cookjohn. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇