Add tuner validation with SSRF protection and single-channel M3U8 support#82
Closed
Add tuner validation with SSRF protection and single-channel M3U8 support#82
Conversation
Co-authored-by: thehack904 <35552907+thehack904@users.noreply.github.com>
Co-authored-by: thehack904 <35552907+thehack904@users.noreply.github.com>
Co-authored-by: thehack904 <35552907+thehack904@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add safety checks and validation to tuner management
Add validation and SSRF protection to tuner management; support single-channel M3U8
Feb 15, 2026
Copilot
AI
changed the title
Add validation and SSRF protection to tuner management; support single-channel M3U8
Add tuner validation, SSRF protection, and single-channel M3U8 support
Feb 15, 2026
Copilot
AI
changed the title
Add tuner validation, SSRF protection, and single-channel M3U8 support
Add tuner validation with SSRF protection and single-channel M3U8 support
Feb 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tuner URLs were accepted without validation, allowing duplicates, malformed URLs, and potential SSRF attacks. M3U parser only handled multi-channel playlists.
Changes
Tuner validation (
add_tuner())http:///https://schemes for M3U (required) and XML (optional)Error handling (
/change_tunerroute)add_tuner()in try-except to surfaceValueErroras flash messagesSingle-channel M3U8 (
parse_m3u())#EXTINFtagsTests
Example
Original prompt
Overview
Add safety checks and validation to tuner management, plus support for single-channel M3U8 playlists.
Features to Implement
1. Add Safety Checks in add_tuner()
File:
app.py-add_tuner()function (around line 208)Add the following validation before inserting into the database:
Duplicate Name Prevention
URL Validation
http://orhttps://http://orhttps://Optional URL Reachability Check
Error Handling in /change_tuner Route
/change_tunerroute (around line 675-760) to catch validation exceptionsflash()to display user-friendly error messagesExample validation logic:
2. Support for Single-Channel M3U8 Playlists
File:
app.py-parse_m3u()function (around line 265-287)Currently the parser expects multi-channel M3U format with
#EXTINFtags. Add support for simple single-channel M3U8 files that contain just a stream URL.Detection Logic
#EXTINFlines#EXTINFfound, check if the file contains a single valid stream URL.m3u8HLS streams and direct video URLsImplementation
Add this logic at the start of the channel parsing loop:
Testing Requirements
Files to Modify
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.