sharept-dl — download folders from SharePoint share links without a browser
TL;DR: pip install sharept-dl and you can batch download entire SharePoint folders (or single files) from "Anyone with the link" shares — no browser, no Playwright, no login. Just pure HTTP + SharePoint REST API.
The problem
Someone sends you a SharePoint share link. Maybe it's a folder with 200 files from a conference, or a bunch of lecture slides from a professor, or documents from a client. You open it in the browser and... it's painful. No "download all" button. You have to click through each file one by one. If you're unlucky, the folder structure is deep and you lose it entirely.
Why not just use a browser automation tool?
Playwright/Selenium-based downloaders exist, but they need a full browser runtime. That means hundreds of MB of dependencies, slow startup, fragile selectors that break when Microsoft tweaks the UI, and no clean CLI experience. I wanted something I could run on a headless server or in a cron job.
What I built
sharept-dl is a pure-HTTP approach. It visits the share link to grab an auth cookie, then talks directly to the SharePoint REST API to enumerate files and download them. Zero browser dependencies — just requests + rich for the terminal UI.
pip install sharept-dl
sharept-dl -u 'https://xxx.sharepoint.cn/:f:/g/personal/...' -o ./downloads
What you get:
- Pre-scan report — file count and total size before downloading a single byte
- Resumable downloads — Ctrl+C midway, run the same command again, and it picks up from
.partfiles via HTTPRangerequests. Already-complete files skip instantly - Preserves folder structure — nested subdirectories are recreated locally
- Handles Unicode paths — double-encoding of Chinese/special characters in URLs is explicitly prevented
- Stable Rich TUI — progress bar, per-file status, transfer rate, time elapsed, all in one non-flickering display
- Single file support —
:w:(Word),:x:(Excel),:p:(PowerPoint),:b:,:t:,:s:links all work via GUID lookup - i18n — auto-detects system locale, displays Chinese or English
Screenshot (terminal TUI during a download):
📁 Folder Share
200 files · 1.42 GB · → /Users/me/downloads
⬇━━━━━━━━━━━━━━━━━━━━━━ 142/200 (71%) · 00:03:27 · ↓ 0.7/s
✓ slides/chapter-02.pdf 12.3 MB 2.1s
✓ slides/chapter-03.pdf 8.7 MB 1.4s
✓ handouts/week-4.docx 1.2 MB 0.3s
↓ videos/lecture-05.mp4 245.0 MB downloading
⏳ videos/lecture-06.mp4
⏳ datasets/raw/experiment.csv
✓ 141 completed · 💾 980.5 MB · ✗ 0 failed
How it works under the hood
- HTTP GET the share link → follow 302 redirects → get an auth cookie
- For folders:
GetFolderByServerRelativeUrlAPI → enumerate files & subfolders recursively - For single files: extract
sourcedocGUID from the URL →GetFileByIdAPI → resolve path - Download each file via
/_layouts/15/download.aspxwith streaming +Rangeheader support
Limitations (honest ones)
- Only supports "Anyone with the link" shares (anonymous access). Org-internal links that require Microsoft login need OAuth2, which isn't implemented yet
- SharePoint REST API returns max 5,000 items per folder — folders with more files will be truncated
- Python ≥ 3.9 required
Links
- PyPI:
pip install sharept-dl - GitHub: [repo link]
- License: MIT
I built this over a few weekends because I was tired of clicking through SharePoint folders. It's been solid for my own use (downloading course materials, conference archives, work document dumps), and I figured others might find it useful too.
Happy to take feedback, bug reports, or feature requests.
Edit: thanks for the kind words everyone! A few people asked about authentication — for now it's anonymous-link only, but OAuth2 support is on the radar. PRs welcome.