TikLocal
TikLocal is a mobile and tablet web application built on Flask. It allows you to browse and manage your local videos and images in a way similar to TikTok and Pinterest.
Introduction
TikLocal's main features include:
- A TikTok-like swipe-up browsing experience with a mixed feed of local videos and images.
- A file manager-like directory browsing feature that allows you to easily find and manage local video files.
- A Pinterest-like grid layout feature that allows you to enjoy local images.
- Search, favorites, collections, and lightweight local recommendations backed by a per-device media index.
- Multiple media sources and URL downloads merged into one local library.
- Support for light and dark modes to suit your personal preferences.
Use cases
TikLocal is suitable for the following use cases:
- You don't trust TikTok's teen mode and want to provide your child with completely controllable video content.
- You want to browse and manage your local videos and images locally, but don't want to use third-party cloud services.
- You want to use a TikTok-style mixed media browsing experience on your phone or tablet.
- You want to use a Pinterest-style image browsing experience on your phone or tablet.
How to use
Installation
TikLocal is a Python application that you can install using the following command:
pip install tiklocal
Usage
Starting TikLocal is very simple, just run the following command:
tiklocal ~/Videos/
You can specify any media folder.
To close, press Ctrl + C.
CLI Commands
TikLocal provides several CLI commands:
Start the server:
tiklocal /path/to/media # Start with media directory
tiklocal --port 9000 # Use custom port
tiklocal --media-source photos=~/Pictures/AI # Add a media source, repeatable
Generate video thumbnails:
tiklocal thumbs /path/to/media # Generate thumbnails
tiklocal thumbs /path --overwrite # Regenerate existing thumbnails
Find and remove duplicate files:
tiklocal dedupe /path/to/media # Find duplicates (dry-run mode)
tiklocal dedupe /path --type video # Check video files only
tiklocal dedupe /path --execute # Execute deletion
tiklocal dedupe /path --keep newest # Keep newest files
Options for dedupe:
--type: File type (video,image,all)--algorithm: Hash algorithm (sha256,md5)--keep: Keep strategy (oldest,newest,shortest_path)--dry-run: Preview mode (default)--execute: Execute actual deletion--auto-confirm: Skip confirmation prompt
Build image vector index:
tiklocal vectorize /path/to/media --dry-run
tiklocal vectorize /path/to/media --limit 200 --order latest
tiklocal vectorize /path/to/media --source photos --limit 200
tiklocal vectorize /path/to/media --cleanup
tiklocal vectorize /path/to/media --max-size 512 --quality 82
tiklocal analyze-similar /path/to/media --limit 500 --yes
tiklocal analyze-similar /path/to/media --profile --dry-run
Recommended workflow:
- Run
--dry-runfirst to inspect total images, already-indexed images, missing vectors, stale vectors, and selected items. - Use
--limit 200 --order latestfor the first low-cost batch. - Use
--source <id>to index one media source frommedia_sources. - Use
--cleanupto remove vectors for files that no longer exist. - Use
--forceonly when intentionally rebuilding existing vectors. - Use
--yesto skip the confirmation prompt in scripts.
vectorize only uploads images that are missing or stale. A vector becomes stale when file size, mtime, model, dimensions, image_max_size, or image_quality changes. Images are EXIF-transposed, resized, re-encoded as JPEG, and sent without original EXIF/ICC/XMP/IPTC metadata.
After vectors are built, run analyze-similar to precompute visual similarity groups into SQLite. The image detail page can query similar images directly from local vectors, while the Library Similar Images mode only reads precomputed groups for fast loading.
URL Download (Web)
TikLocal includes a /download page where you can paste a media URL and enqueue a background download job.
Requirements:
yt-dlp(required)gallery-dl(recommended for image/gallery posts)ffmpeg(recommended for format merge)
Download engine:
yt-dlp: video-oriented sites and linksgallery-dl: image posts/albums (Instagram/X/Pinterest, etc.)- Download form allows manual engine selection per task (default:
yt-dlp)
Cookie for login-only content (optional):
- Put exported cookie files in
~/.tiklocal/cookies - Filename should include domain, e.g.
x.com.txt,youtube.com.cookies - The download page supports
Auto matchor manual file selection per task - The download page also supports cookie file upload/replace, history delete/clear, and retry for failed tasks
Example installs:
# macOS (Homebrew)
brew install yt-dlp gallery-dl ffmpeg
# Ubuntu / Debian
sudo apt install yt-dlp gallery-dl ffmpeg
Home Mixed Feed
The home page (/) now uses a mixed immersive feed:
- Videos and images are mixed in one swipe flow (video-first density, randomized order)
- Image cards support in-feed AI caption/tags panel
- Image cards support circular magnifier (2.5x / 5x)
- Image cards do not auto-advance; swipe manually to move next/previous
Configuration
TikLocal provides some configuration options that you can adjust to your needs.
You can configure one or more media directories in ~/.config/tiklocal/config.yaml:
media_sources:
- id: default
name: Main Library
path: ~/Videos/TikLocal
- id: photos
name: Photos
path: ~/Pictures/AI
download_source: default
vision:
enabled: true
base_url: https://openrouter.ai/api/v1
model_name: google/gemini-2.5-flash
temperature: 0.6
tags_limit: 5
system_prompt: |
You are an image analysis assistant. Return JSON only.
user_prompt: |
Analyze this image and return a short Chinese title plus up to {tags_limit} Chinese tags.
Output JSON: {"title":"...","tags":["..."]}
embedding:
enabled: true
base_url: https://openrouter.ai/api/v1
model_name: google/gemini-embedding-2
dimensions: 768
image_max_size: 512
image_quality: 82
The legacy single-directory configuration still works:
media_root: ~/Videos/TikLocal
Multiple media sources are merged into one unified library. Internal media URIs use the @source_id/path format, while old bare-path links and favorites remain compatible through the default source.
Image recognition uses vision; image vectorization uses embedding and stores image vectors in the local SQLite application database (~/.tiklocal/tiklocal.sqlite3 by default). The image detail page only reads the local index for similar-image recommendations. Use the CLI to build or update vectors:
tiklocal vectorize ~/Videos/TikLocal --limit 200 --order latest
tiklocal vectorize ~/Videos/TikLocal --dry-run
tiklocal analyze-similar ~/Videos/TikLocal --limit 500 --yes
API keys are read from environment variables, preferring TIKLOCAL_VISION_API_KEY for vision, TIKLOCAL_EMBEDDING_API_KEY for embedding, then falling back to TIKLOCAL_AI_API_KEY, OPENAI_API_KEY, or OPENROUTER_API_KEY.
- Light and dark modes: You can choose to use light or dark mode.
- Video playback speed: You can adjust the video playback speed.
Documentation
- Docs index:
docs/README.md - Flow interaction unification:
docs/flow-interaction-unification.md - Media index and local recommendation architecture:
docs/media-index-and-recommendation.md - OpenRouter image-to-video research:
docs/openrouter-image-to-video-research.md - Release notes:
docs/release_notes.md
TODO
- Add more management operations, such as moving files and creating folders
- Add basic login control
- Add a Docker image
- Add a tagging feature
Contribution
TikLocal is an open source project that you can contribute to in the following ways:
- Submit code or documentation improvements.
- Report bugs.
- Suggest new features.
Contact us
If you have any questions or suggestions, you can contact us in the following ways:
- GitHub project page: https://github.com/ChanMo/TikLocal/
- Email: [chan.mo@outlook.com]
Metadata
Release files for TikLocal 0.8.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tiklocal-0.8.27.tar.gz | 207.2 kB | With provenance | Details for tiklocal-0.8.27.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tiklocal-0.8.27-py3-none-any.whl | Python 3 | none | any | Details for tiklocal-0.8.27-py3-none-any.whl |
Total release size: 432.7 kB
Release files / tiklocal-0.8.27.tar.gz
| Download URL | tiklocal-0.8.27.tar.gz |
|---|---|
| Size | 207.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5cef5f5023e06add219b9271f11e3e7ce732e421399a28ab7e87ce42a215a084
|
|
BLAKE2b-256 checksum How to use checksums |
08b69c96a42dcb66ea55a0aaf6705233a6681a6c8835a4cad8aceaadfa1acb5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logRelease files / tiklocal-0.8.27-py3-none-any.whl
| Download URL | tiklocal-0.8.27-py3-none-any.whl |
|---|---|
| Size | 225.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb473ca68f77aef26362f3f657258c1375fa5cb03a4b883437b82a780be25ffa
|
|
BLAKE2b-256 checksum How to use checksums |
bcd061d260981d5d4e8d073ae8add1ec469874043ae664234f0dda61aa1681a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logSecurity for TikLocal 0.8.27
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tiklocal-0.8.27.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.