SmartLama generates smart redirect links that open YouTube videos and channels directly in the YouTube app on mobile — bypassing the in-app browser of Instagram, TikTok, Threads, WhatsApp and other platforms.
- Opens YouTube videos directly in the YouTube app (iOS & Android)
- Opens YouTube channels (@handle, /channel/ID, /user/, /c/) directly in the app
- Smart deep-link with fallback — if the app isn't installed, opens YouTube in the browser
- Branded interstitial page shown before redirect (configurable delay)
- Supports all YouTube URL formats including
youtu.be, Shorts, and tracking params like?si= - Clean, modern UI — fully responsive
├── index.php # Main landing page & link generator UI
├── shortlink.php # Redirect handler with interstitial page
├── generate_optimized_link.php # Backend: parses YouTube URLs, generates redirect links
└── smartlama_links.log # Auto-created log file (gitignored)
- PHP 7.4+
- Any standard web host (Apache, Nginx, shared hosting)
- Clone or download this repository
- Upload all
.phpfiles to your web server root (or subdirectory) - Make sure the web server has write permission for
smartlama_links.log - Visit your domain and start optimizing links!
git clone https://github.com/the-emunator/smartlamaIn shortlink.php, change the delay before the redirect fires:
$DELAY = 3; // secondsLink generation is logged to smartlama_links.log automatically. To disable, remove the logging block at the bottom of generate_optimized_link.php.
| Format | Example |
|---|---|
| Standard video | youtube.com/watch?v=VIDEO_ID |
| Short URL | youtu.be/VIDEO_ID |
| Shorts | youtube.com/shorts/VIDEO_ID |
| Channel @handle | youtube.com/@channelname |
| Channel @handle with tracking | youtube.com/@channelname?si=XXXXX |
| Channel ID | youtube.com/channel/UCxxxxxxx |
| Legacy user | youtube.com/user/username |
| Custom /c/ | youtube.com/c/customname |
| Platform | Video | Channel |
|---|---|---|
| iOS | youtube://watch?v=ID |
youtube://www.youtube.com/@handle |
| Android | vnd.youtube://ID |
intent://...#Intent;package=com.google.android.youtube |
| Desktop / Fallback | youtube.com/watch?v=ID |
youtube.com/@handle |
On mobile, SmartLama first attempts the deep link. If the YouTube app doesn't respond within 2 seconds, it falls back to the web URL automatically.
This project was built with the help of AI (Claude by Anthropic) — aka vibe coding. The logic, structure and deployment were guided and reviewed by a human, but AI did the heavy lifting. Proof that you don't need to be a senior dev to ship something useful. 🦙
MIT License — see LICENSE for details.
If you find SmartLama useful, consider supporting the project: