This is a full-featured Express.js API server that enables searching, retrieving, and streaming movies and TV episodes using TMDB (The Movie Database) and FlixHQ as data providers. The server also includes a caching layer using Redis (with in-memory fallback) for improved performance.
- 🔍 Search movies and TV shows using FlixHQ
- 🎞 Stream movies and TV episodes with working source links
- 🎥 TMDB integration for accurate metadata and images
- ⚡ Smart caching with Redis (or fallback to in-memory)
- 🧠 Title matching logic to find the best match between TMDB and FlixHQ results
- Node.js / Express
- TypeScript
- Redis (with fallback to in-memory cache)
- TMDB API for metadata
- FlixHQ (Unofficial scraper-based provider)
- Axios for HTTP requests
- CORS, JSON body parsing middleware
git clone https://github.com/your-username/movie-tv-streaming-api.git
cd movie-tv-streaming-apinpm installPORT=3000
# Redis (optional)
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=yourpassword
# TMDB
TMDB_API_KEY=your_tmdb_api_keyGET /search?query=avengers&page=1GET /movie/:tmdbId/:server?GET /tv/:tmdbId/:season/:episode/:server?GET /info/:mediaIdGET /sources/:episodeId?mediaId=xyz&server=upcloud- Uses Redis if available, falls back to in-memory cache.
- Cache expiry per route:
- Search: 1 hour
- Media Info: 6 hours
- Streaming Sources: 30 minutes
Smart string comparison algorithm to detect:
- Exact title matches
- Season match (for TV)
- Year match (for movies)
- Fallback to first relevant result when strict matching fails
If you want to run Redis and the API using Docker:
docker run -d --name redis -p 6379:6379 redis
npm run start- This is for educational or private use only.
- FlixHQ scraping logic may break if their site structure changes.
- TMDB API has usage limits, so use an API key responsibly.
{
"tmdbId": "299534",
"title": "Avengers: Endgame",
"sources": [
{
"server": "vidcloud",
"url": "https://streamlink...",
"isM3U8": true,
"quality": "1080p",
"subtitles": []
}
]
}- TMDB
- FlixHQ (for unofficial streaming source scraping)
- Built with ❤️ by [Your Name or GitHub Handle]
MIT License