agentleFS
puntorigenpuntorigen/avatar-skills/instagram-videos/SKILL.md

instagram-videos

Skill3 starsChanged 4 months agoMITView on GitHub

Download all public videos/reels from an Instagram profile to a local folder, named with upload date-time (YYYY-MM-DD_HH-MM-SS.mp4). Uses Picnob via browser automation plus a Python download script. Use when the user asks to download Instagram videos, reels, or video content from a public profile, save IG videos locally, or batch-download profile reels with datetime filenames.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run via browser_cdp → Runtime.evaluate with awaitPromise: true:

    line 42
  2. Very specific:

    Do not: commit posts-raw/ — scraping artifacts belong in .gitignore.

    line 107
  3. Very specific:

    Do not: use Picnob pId as Instagram shortcode — it's an internal ID.

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Instagram Videos Downloader

Download every public video/reel from an Instagram profile into a user-specified folder, named by upload datetime.

Do not use instaloader, yt-dlp, or gallery-dl on profile URLs first — they return 401 without a session cookie. Use Picnob.

Inputs

ParameterRequiredExample
Instagram handle or profile URLyesarnoldo_schaffner_bofill
Output directoryyeslolo/videos
Timezone for filenamesnoAmerica/Santiago (default)

Extract handle from URLs: instagram.com/{handle}/ → {handle}.

Workflow checklist

- [ ] Step 1: Verify profile is public
- [ ] Step 2: Scrape Picnob profile feed (browser)
- [ ] Step 3: Save posts JSON
- [ ] Step 4: Run download script
- [ ] Step 5: Report results

Step 1: Verify profile is public

Open https://www.instagram.com/{handle}/ in the browser. If it shows a login wall or "This Account is Private", stop — this skill is public profiles only.

Step 2: Scrape Picnob via browser MCP

Navigate to https://www.picnob.com/profile/{handle}/.

Run via browser_cdp → Runtime.evaluate with awaitPromise: true:

(async () => {
  let lastCount = 0, stable = 0;
  for (let i = 0; i < 60; i++) {
    window.scrollTo(0, document.body.scrollHeight);
    await new Promise(r => setTimeout(r, 1500));
    const c = document.querySelectorAll('.post_box').length;
    if (c === lastCount) { if (++stable >= 3) break; } else { stable = 0; }
    lastCount = c;
  }
  const posts = [];
  document.querySelectorAll('.post_box').forEach((box, idx) => {
    const a = box.querySelector('a[href*="/post/"]');
    const m = a?.href?.match(/\/post\/([^/?#]+)/);
    const counts = Array.from(box.querySelectorAll('.num')).map(e => e.textContent.trim());
    posts.push({
      idx, pId: m?.[1],
      caption: box.querySelector('.sum')?.textContent?.trim() || '',
      time: box.querySelector('.time')?.textContent?.trim() || '',
      likes: counts[0], comments: counts[1],
      downloadUrl: box.querySelector('.downbtn')?.href,
      isVideo: !!box.querySelector('.icon_video, [class*=video]'),
      isSidecar: !!box.querySelector('.icon_album, [class*=sidecar], [class*=album]'),
      picnobHref: a?.href,
    });
  });
  return posts;
})()

Step 3: Save posts JSON

Save the result to {project}/posts-raw/meta/picnob_{handle}.json. Create posts-raw/ if needed; add to .gitignore if not already there.

Step 4: Download and rename

python3 ~/.cursor/skills/instagram-videos/scripts/download_profile_videos.py \
  --posts-json posts-raw/meta/picnob_{handle}.json \
  --output-dir {output_folder} \
  --timezone America/Santiago

The script:

  1. Filters videos (.mp4 in downloadUrl or isVideo: true)
  2. Downloads each file from Picnob CDN URLs
  3. Fetches exact uploadDate from each post's JSON-LD schema on Picnob
  4. Renames to YYYY-MM-DD_HH-MM-SS.mp4 in the chosen timezone
  5. Writes {output_folder}/videos_manifest.json

Video detection note: Picnob often omits the video icon on reels. Always treat posts with .mp4 in downloadUrl as videos — the script handles this.

Collisions: Two posts at the same second get _2, _3 suffixes.

Step 5: Report to user

Summarize: handle, output path, count downloaded, any errors, and list filenames sorted newest-first.


Anti-patterns

  1. Do not scrape faster than ~1 req/sec on Picnob post pages (date lookup).
  2. Do not commit posts-raw/ — scraping artifacts belong in .gitignore.
  3. Do not use Picnob pId as Instagram shortcode — it's an internal ID.
  4. Do not scrape private profiles.

Utility scripts

ScriptPurpose
scripts/download_profile_videos.pyDownload + datetime rename (main entry point)
scripts/scrape_picnob.jsReference for browser-side scrape logic

Additional resources

  • Real run example: examples.md
  • Full post/caption scraping (images, sidecars): use the instagram-scraper skill

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.