yt-dlp → PikPak Pipeline / Download-to-Cloud Pipeline
One command: yt-dlp downloads a video, uploads it to PikPak over WebDAV, verifies, then removes the local copy.
Safety promise: Local files are deleted only after a verified upload (code-enforced, cleanup_local only handles verified files).
Site coverage: yt-dlp supports 1000+ sites, commonly used: YouTube, TikTok, X (Twitter), Facebook, Instagram, Bilibili, Vimeo – precisely covering the social media transfer scenarios PikPak officially promotes (PikPak's own social media transfer is limited to its App; this pipeline brings it to command-line batch mode). TikTok/X and other sites change rules frequently; if parsing fails, first try yt-dlp -U to upgrade.
0. Prerequisites
- PikPak Premium (WebDAV requires membership). No account? Start with the
pikpak-onboardingskill. - yt-dlp:
pip install yt-dlp(orwinget install yt-dlp). - Python 3.8+ and
requests. - Copy
webdav.config.json.exampletowebdav.config.jsonand fill in your WebDAV credentials (plaintext password, git-ignored, do not share).
1. Usage
# Single URL
python scripts/pipeline.py "https://youtube.com/watch?v=..." --remote-dir my_videos
# URL list batch
python scripts/pipeline.py --url-file urls.txt --remote-dir my_videos
# Dry run (no download, no upload)
python scripts/pipeline.py --url-file urls.txt --remote-dir my_videos --dry-run
# Keep local copies
python scripts/pipeline.py "URL" --remote-dir my_videos --keep-local
| Argument | Description |
|---|---|
URL... / --url-file | Links supported by yt-dlp; one per line in list, lines starting with # are comments |
--remote-dir | PikPak target folder (auto-created) |
--work-dir | Local download staging directory, default scripts/../downloads_tmp |
--keep-local | Keep local files after successful upload |
--retry | Number of upload retries per file, default 5 |
--dry-run | Only print processing plan |
--yt-dlp-args | Additional arguments passed to yt-dlp, e.g., --yt-dlp-args -f best |
2. How it works
Each URL goes through four steps:
- Download: yt-dlp →
--work-dir(new files detected by snapshot comparison) - Upload: Streaming PUT per file → PikPak, remote size verification
- Cleanup: Verified local copies removed (unless
--keep-local) - Bookkeeping:
state/pipeline_<folder>.jsonrecords each URL as done/failed → resume-safe, automatically skips completed on rerun
3. Gotchas
- If yt-dlp is not in PATH, the script will immediately exit with an error—verify that
yt-dlp --versionworks. - Running the same URL again will skip it (state marks it done); to rerun, delete the corresponding record in
state/. - WebDAV cannot permanently delete cloud files; use the official App/website for cloud cleanup.
- Some sites require cookies/login; pass
--yt-dlp-args --cookies-from-browser chrome. - Compliance reminder: Only download content you have the right to access.
4. Related skills
pikpak-onboarding: Don't have a PikPak account yet? Start from registration (includes official CLI installation guide).pikpak-webdav-upload: Already have local downloads? Batch upload directly.