Skip to content

the-emunator/smartlama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦙 SmartLama — YouTube Link Optimizer

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.


✨ Features

  • 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

📁 File Structure

├── 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)

🚀 Setup

Requirements

  • PHP 7.4+
  • Any standard web host (Apache, Nginx, shared hosting)

Installation

  1. Clone or download this repository
  2. Upload all .php files to your web server root (or subdirectory)
  3. Make sure the web server has write permission for smartlama_links.log
  4. Visit your domain and start optimizing links!
git clone https://github.com/the-emunator/smartlama

🔧 Configuration

Interstitial delay

In shortlink.php, change the delay before the redirect fires:

$DELAY = 3; // seconds

Logging

Link generation is logged to smartlama_links.log automatically. To disable, remove the logging block at the bottom of generate_optimized_link.php.


🔗 Supported YouTube URL Formats

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

📱 How Deep Links Work

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.


🌐 Live Demo

smartlama.net


🤖 Built with Vibe Coding

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. 🦙


📄 License

MIT License — see LICENSE for details.


☕ Support

If you find SmartLama useful, consider supporting the project:

Ko-fi

About

Generate links that open directly in the YouTube app on mobile. No more in-app browser frustration.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages