# Xtream Codes Channel Search A fast, interactive Python tool for searching channels across Xtream Codes IPTV services. Features multithreaded searching with progress bars and a clean, user-friendly interface. ## Features - ๐Ÿ” **Interactive Search Mode** - Connect once, search multiple times - ๐ŸŽฏ **Regex Support** - Use `/pattern/` syntax for powerful pattern matching - โšก **Multithreaded** - Fast concurrent searches across categories - ๐Ÿ“Š **Progress Bars** - Real-time progress with smoothed ETA - ๐ŸŽฏ **Content Type Filtering** - Search Live, VOD, Series separately or all together - ๐Ÿงน **Clean Output** - Compact, readable results - ๐Ÿ”ง **Debug Mode** - API connectivity testing and troubleshooting ## Installation 1. Clone or download this repository 2. Install dependencies: ```bash pip install -r requirements.txt ``` ## Usage ### Interactive Mode (Recommended) ```bash python xtream-search.py --api-url "http://your-server.com" --username "your_user" --password "your_pass" ``` ### One-time Search ```bash python xtream-search.py --api-url "http://your-server.com" --username "your_user" --password "your_pass" --channel "cnn" ``` ### Advanced Options ```bash # Search all content types (Live + VOD + Series) python xtream-search.py --api-url "http://your-server.com" --username "user" --password "pass" --channel "movie" --all-types # Increase thread count for faster searching python xtream-search.py --api-url "http://your-server.com" --username "user" --password "pass" --max-workers 20 # Debug mode to test API connectivity python xtream-search.py --api-url "http://your-server.com" --username "user" --password "pass" --debug ``` ## Interactive Search Commands Once in interactive mode, use these search commands: - **`channel_name`** - Search live streams (default, substring match) - **`/pattern/`** - Search using regex pattern (case-insensitive by default) - **`/pattern/flags`** - Search with regex flags (i=case-insensitive, m=multiline, s=dotall) - **`live:espn`** - Search only live streams - **`vod:movie`** - Search only VOD content - **`series:friends`** - Search only series - **`all:news`** - Search all content types - **`all:/sports|news/`** - Search all content types with regex - **`debug`** - Show API information - **`quit`** or **`exit`** - Exit program ### Regex Search Examples - **`/^CNN/`** - Find channels starting with "CNN" (case-insensitive) - **`/^CNN/i`** - Find channels starting with "CNN" (explicitly case-insensitive) - **`/^cnn/`** - Find channels starting with "cnn" (case-insensitive by default) - **`/HD$/`** - Find channels ending with "HD" - **`/sports|news/i`** - Find channels containing "sports" OR "news" (case-insensitive) - **`/\d{4}/`** - Find channels with 4 consecutive digits - **`/^[A-Z]{3}$/`** - Find channels with exactly 3 uppercase letters ### Supported Regex Flags - **`i`** - Case-insensitive matching (applied by default if no flags specified) - **`m`** - Multiline mode (^ and $ match line boundaries) - **`s`** - Dotall mode (. matches newlines) - Multiple flags can be combined: **`/pattern/ims`** ## Sample Output ``` Connected to: http://your-server.com Commands: live: | vod: | series: | all: | debug | quit -------------------------------------------------- ๐Ÿ” Search: cnn ๐Ÿ“ก Fetching live categories... โœ… Found 25 categories to search ๐Ÿ” Searching live categories: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 25/25 [Elapsed: 00:03 | ETA: 00:00] โœ… Found 3 result(s) for 'cnn': 1. [Live] News Channels โ†’ CNN International 2. [Live] US News โ†’ CNN USA 3. [Live] Breaking News โ†’ CNN Breaking News ๐Ÿ” Search: vod:action ๐Ÿ“ก Fetching VOD categories... โœ… Found 15 VOD categories ๐Ÿ” Searching vod: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 15/15 [Elapsed: 00:02 | ETA: 00:00] โœ… Found 5 result(s) for 'action': 1. [VOD] Action Movies โ†’ Die Hard 2. [VOD] Action Movies โ†’ Mad Max 3. [VOD] Thriller โ†’ Action Jackson 4. [VOD] Adventures โ†’ Action Heroes 5. [VOD] Classics โ†’ Action Classics ``` ## Command Line Arguments | Argument | Required | Description | |----------|----------|-------------| | `--api-url` | โœ… | Xtream Codes server URL | | `--username` | โœ… | Your username | | `--password` | โœ… | Your password | | `--channel` | โŒ | Channel to search (one-time mode) | | `--all-types` | โŒ | Search Live + VOD + Series | | `--interactive` | โŒ | Force interactive mode | | `--max-workers` | โŒ | Number of threads (default: 10) | | `--debug` | โŒ | Show API debug information | ## Performance Tuning - **Default threads (10)**: Good balance for most servers - **High performance (15-20 threads)**: Faster for powerful servers - **Conservative (5 threads)**: Better for slower connections or servers with rate limits ## Requirements - Python 3.6+ - requests >= 2.25.0 - tqdm >= 4.60.0 ## Troubleshooting ### Connection Issues ```bash # Test API connectivity python xtream-search.py --api-url "http://your-server.com" --username "user" --password "pass" --debug ``` ### Slow Performance ```bash # Reduce thread count if getting timeouts python xtream-search.py --api-url "http://your-server.com" --username "user" --password "pass" --max-workers 5 ``` ### No Results Found - Check your search term spelling - Try partial matches (e.g., "cnn" instead of "CNN International") - Use `all:term` to search across all content types - Verify your credentials with `--debug`