diff --git a/README.md b/README.md index 730a90f..948766e 100644 --- a/README.md +++ b/README.md @@ -153,22 +153,19 @@ GET /xmltv - `url` (required): The base URL of your IPTV service - `username` (required): Your IPTV service username - `password` (required): Your IPTV service password -- `unwanted_groups` (optional): A comma-separated list of group names to exclude -- `wanted_groups` (optional): A comma-separated list of group names to include (takes precedence over unwanted_groups) - `proxy_url` (optional): Custom base URL for proxied content (overrides auto-detection) -Note: Wildcard patterns are also supported for group filtering in the XMLTV endpoint, just like for the M3U endpoint. ##### Example Request ``` -http://localhost:5000/xmltv?url=http://your-iptv-service.com&username=your_username&password=your_password&unwanted_groups=news,sports +http://localhost:5000/xmltv?url=http://your-iptv-service.com&username=your_username&password=your_password ``` -Or to only include specific groups: +With a custom proxy URL: ``` -http://localhost:5000/xmltv?url=http://your-iptv-service.com&username=your_username&password=your_password&wanted_groups=movies,series +http://localhost:5000/xmltv?url=http://your-iptv-service.com&username=your_username&password=your_password&proxy_url=https://your-public-domain.com ``` #### Image Proxy diff --git a/run.py b/run.py index cfbb6ae..ede97b9 100644 --- a/run.py +++ b/run.py @@ -293,12 +293,7 @@ def generate_xmltv(): if error: return error - # Parse filter parameters - unwanted_groups = parse_group_list(request.args.get('unwanted_groups', '')) - wanted_groups = parse_group_list(request.args.get('wanted_groups', '')) - - # Log filter parameters - logger.info(f"Filter parameters - wanted_groups: {wanted_groups}, unwanted_groups: {unwanted_groups}") + # No filtering supported for XMLTV endpoint # Validate credentials user_data, error_json, error_code = validate_xtream_credentials(url, username, password) @@ -313,94 +308,25 @@ def generate_xmltv(): if isinstance(xmltv_data, tuple): # Error response return json.dumps(xmltv_data[0]), xmltv_data[1], {'Content-Type': 'application/json'} - # If not filtering or proxying, return the original XMLTV - if not (unwanted_groups or wanted_groups) and not proxy_url: + # If not proxying, return the original XMLTV + if not proxy_url: return Response( xmltv_data, mimetype='application/xml', headers={"Content-Disposition": "attachment; filename=guide.xml"} ) - # Replace image URLs in the XMLTV content - if proxy_url: - def replace_icon_url(match): - original_url = match.group(1) - proxied_url = f"{proxy_url}/image-proxy/{encode_url(original_url)}" - return f'' in line or '' in line: - skip_current = False - - xmltv_data = '\n'.join(filtered_lines) - except Exception as e: - logger.error(f"Failed to filter XMLTV: {e}") - # If filtering fails, return unfiltered XMLTV + xmltv_data = re.sub( + r'