Add profile downloader with web UI; optional cookies for downloader

Profile downloader (profile-downloader/), now built on gallery-dl:
- Local web UI (app.py): load a profile by username, URL, post link or
  secUid; stories shown above posts; select all/none/not downloaded,
  shift-click ranges, filters; live download progress with Stop
- CLI (main.py) replaces the hard-coded script: --cookies, --refresh,
  --retry-failed, --limit, --no-stories
- Photo posts save their slide images and music; cover thumbnails are
  no longer saved; filenames include seconds and the post ID so posts
  from the same minute cannot collide; partial files are cleaned up
- Backoff and retry when TikTok blocks requests, stopping after three
  blocked posts in a row; per-profile failed.txt
- Profile IDs are cached and looked up from a post page when the
  profile page is blocked; photo posts download straight from the
  post-list links
- README for the profile downloader

downloader.py:
- Optional --cookies FILE (or TIKDOWN_COOKIES)
- Failed-URL helpers accept a file path so the profile tool reuses them

Ignore cookies.txt and __pycache__ in every folder.
This commit is contained in:
X4Lo committed 2026-11-22 03:57:49 +00:00
1 parent 1c17487ce4
commit d12483d53c
9 files changed
+1436 -15

No files matched your search

+11 -2
View File
@@ -36,14 +36,23 @@ python downloader.py failed.txt
# Mix URLs and files; short links (vm.tiktok.com / vt.tiktok.com) work too
python downloader.py https://vm.tiktok.com/ZMabc123/ in/more-urls.txt
# Options: --delay SECONDS, --force (ignore downloaded_ids.txt), -v (show yt-dlp output on errors)
# Optional: use your browser's cookies (for private or age-restricted posts)
python downloader.py --cookies cookies.txt https://www.tiktok.com/@user/video/123456789
# Options: --delay SECONDS, --force (ignore downloaded_ids.txt), --cookies FILE, -v (show yt-dlp output on errors)
```
Input files may contain blank lines, `# comments`, and URLs mixed with other text.
The exit code is non-zero when any download fails.
Optional environment variables (or `.env`): `YT_DLP_PATH`, `TIKDOWN_DOWNLOAD_DIR`,
`TIKDOWN_COOKIES` (cookies.txt for private posts), `TIKDOWN_DELAY`.
`TIKDOWN_COOKIES` (cookies.txt for private posts; also used by the Telegram bot), `TIKDOWN_DELAY`.
Cookies are off unless you pass `--cookies` or set `TIKDOWN_COOKIES`. `cookies.txt` is git-ignored.
## Profile downloader
To download a whole profile — or pick posts and stories from it in a web UI — see
[profile-downloader/README.md](profile-downloader/README.md).
## Downloads