.category-item:hover { background: #f0f0f0; }

.categories { padding: 20px; }

const filteredStreams = streams.filter(stream => stream.name.toLowerCase().includes(searchTerm.toLowerCase()) );

async getStreams(categoryId = null, type = 'live') { try { let action = ''; switch(type) { case 'live': action = 'get_live_streams'; break; case 'vod': action = 'get_vod_streams'; break; case 'series': action = 'get_series'; break; } const params = { username: this.username, password: this.password, action: action }; if (categoryId) params.category_id = categoryId; const response = await axios.get(`${this.baseUrl}/player_api.php`, { params }); return response.data; } catch (error) { throw error; } }

.category-item { padding: 8px 12px; margin: 5px 0; cursor: pointer; border-radius: 5px; transition: background 0.3s; }

.category-item.active { background: #667eea; color: white; }

This code is for educational purposes only . You should only use this with content you have legal rights to stream. Respect copyright laws and terms of service of any streaming provider.

.login-container { display: flex; justify-content: center; align-items: center; height: 100vh; }

const toggleFavorite = (stream) => { let updated; if (favorites.find(f => f.stream_id === stream.stream_id)) { updated = favorites.filter(f => f.stream_id !== stream.stream_id); } else { updated = [...favorites, stream]; } setFavorites(updated); localStorage.setItem('favorites', JSON.stringify(updated)); };

app.get('/api/stream/url/:type/:id', async (req, res) => { if (!req.app.locals.client) { return res.status(401).json({ error: 'Not connected' }); } const { type, id } = req.params; const url = req.app.locals.client.getStreamUrl(id, type); res.json({ url }); });

const loadFavorites = () => { const saved = localStorage.getItem('favorites'); if (saved) setFavorites(JSON.parse(saved)); };

app.listen(3000, () => { console.log('Xtream Codes API Server running on port 3000'); }); // App.js - Complete React Frontend import React, { useState, useEffect, useRef } from 'react'; import './App.css'; const App = () => { const [connected, setConnected] = useState(false); const [credentials, setCredentials] = useState({ server: '', port: '25461', username: '', password: '' }); const [categories, setCategories] = useState({ live: [], vod: [], series: [] }); const [activeCategory, setActiveCategory] = useState('live'); const [selectedCategoryId, setSelectedCategoryId] = useState(null); const [streams, setStreams] = useState([]); const [selectedStream, setSelectedStream] = useState(null); const [searchTerm, setSearchTerm] = useState(''); const [favorites, setFavorites] = useState([]); const [recentlyWatched, setRecentlyWatched] = useState([]); const videoRef = useRef(null);