Parse xtream m3u urls into separate credentials#195
Conversation
📝 WalkthroughWalkthroughAdds Xtream M3U parsing to auto-fill server/username/password, extends ChannelResult with optional last_error_reason and updates its initialization and accessor, and switches the BtbN ffmpeg download URL to the releases/download/latest endpoint. ChangesXtream M3U Credential Extraction
ChannelResult error field and accessors
FFmpeg download script tweak
Sequence Diagram(s)sequenceDiagram
participant User
participant OpenSourceDialog
participant parseXtreamM3ULink
User->>OpenSourceDialog: paste/modify Xtream Server input
OpenSourceDialog->>parseXtreamM3ULink: call parseXtreamM3ULink(input)
parseXtreamM3ULink-->>OpenSourceDialog: set xtreamServer / xtreamUsername / xtreamPassword (or raw server)
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Awesome, thanks, nice improvement! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/download-ffmpeg.sh`:
- Around line 128-129: The hardcoded archive name in the download script
(variable archive) doesn't match the actual asset names served by the
BtbN/FFmpeg-Builds /releases/download/latest endpoint; replace the static
"ffmpeg-master-latest-${platform}-gpl" with logic that queries the GitHub
releases API for the latest release assets and selects the correct asset whose
name matches the pattern "ffmpeg-.*-${platform}-gpl" (use curl to fetch
https://api.github.com/repos/BtbN/FFmpeg-Builds/releases/latest, parse the
.assets[].name with jq or similar, grep for the platform-specific gpl asset, and
assign that result to archive) so the script downloads the real existing file
instead of a non-existent hardcoded name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 38a87c92-500a-49e4-be83-a54d1a8a9ccf
📒 Files selected for processing (3)
scripts/download-ffmpeg.shsrc/lib/channelResults.tssrc/lib/types.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Define agent interfaces and implementations in TypeScript for agent systems
Use clear naming conventions for agent classes and methods
Document agent behavior and responsibilities in comments or docstrings
Implement error handling in agent methods
Files:
src/lib/types.tssrc/lib/channelResults.ts
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
TypeScript code should use strict mode and enforce no unused locals/params
Files:
src/lib/types.tssrc/lib/channelResults.ts
src/lib/types.ts
📄 CodeRabbit inference engine (AGENTS.md)
Define and maintain data types in lib/types.ts that mirror Rust models
Files:
src/lib/types.ts
src/lib/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Use Tauri IPC commands for frontend-backend communication instead of direct HTTP calls
Files:
src/lib/types.tssrc/lib/channelResults.ts
🔇 Additional comments (3)
src/lib/channelResults.ts (2)
26-26: LGTM!
45-48: LGTM!src/lib/types.ts (1)
66-66: Confirm Rust ↔ TS model alignment forlast_error_reason
src-tauri/src/models/channel.rsadds#[serde(..., alias = "last_error_reason")] pub error_reason: Option<String>, so the serialized field namelast_error_reasonmatches the TypeScriptlast_error_reason?: string | null(optional + nullable) insrc/lib/types.ts.
| local base="https://github.com/BtbN/FFmpeg-Builds/releases/download/latest" | ||
| local archive="ffmpeg-master-latest-${platform}-gpl" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify BtbN latest endpoint and archive naming
echo "=== Testing latest endpoint redirect ==="
curl -sI "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest" | grep -i location
echo -e "\n=== Fetching actual latest release assets ==="
gh api /repos/BtbN/FFmpeg-Builds/releases/latest --jq '.assets[].name' | grep -E '(linux64|win64)'
echo -e "\n=== Testing if specific archive exists ==="
curl -I "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz" 2>&1 | head -1Repository: kristofferR/IPTVChecker
Length of output: 1523
Fix archive naming for /releases/download/latest in scripts/download-ffmpeg.sh
The /latest endpoint assets in BtbN/FFmpeg-Builds are named like ffmpeg-N-<id>-linux64-gpl.tar.xz / ffmpeg-N-<id>-win64-gpl.zip, and I don’t see any assets matching ffmpeg-master-latest-${platform}-gpl*. This hardcoded archive name at lines 128–129 is likely requesting a non-existent file (which would explain CI failures); pinning can be addressed separately.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/download-ffmpeg.sh` around lines 128 - 129, The hardcoded archive
name in the download script (variable archive) doesn't match the actual asset
names served by the BtbN/FFmpeg-Builds /releases/download/latest endpoint;
replace the static "ffmpeg-master-latest-${platform}-gpl" with logic that
queries the GitHub releases API for the latest release assets and selects the
correct asset whose name matches the pattern "ffmpeg-.*-${platform}-gpl" (use
curl to fetch https://api.github.com/repos/BtbN/FFmpeg-Builds/releases/latest,
parse the .assets[].name with jq or similar, grep for the platform-specific gpl
asset, and assign that result to archive) so the script downloads the real
existing file instead of a non-existent hardcoded name.
Summary
Parse Xtream M3U-style URLs entered into the server field and auto-fill Xtream server, username, and password fields when credentials are present in the query string
Changes
parseXtreamM3ULink(link: string)helper.usernameandpasswordquery params exist, sets:xtreamServerto the URL origin (protocol + host)xtreamUsernameandxtreamPasswordto the extracted valuesxtreamServerto the raw input when parsing fails or credentials are not present.Reason
Many Xtream providers give credentials as M3U URLs. Parsing these automatically saves time from manually copying username/password and reduces friction when testing multiple streams
Example
Input:
http://hostname:8080/get.php?username=foo&password=bar&type=m3u_plus
Result:
Summary by CodeRabbit