Skip to content

feat: Multiple DNS / fallback URLs for Xtream playlists#898

Merged
sparkison merged 6 commits intom3ue:devfrom
Warbs816:feature/xtream-fallback-urls
Mar 30, 2026
Merged

feat: Multiple DNS / fallback URLs for Xtream playlists#898
sparkison merged 6 commits intom3ue:devfrom
Warbs816:feature/xtream-fallback-urls

Conversation

@Warbs816
Copy link
Copy Markdown
Contributor

@Warbs816 Warbs816 commented Mar 29, 2026

Summary

Closes #408

  • Adds a xtream_fallback_urls field to Xtream playlists for storing alternative server URLs
  • Automatic failover: when the primary URL is unreachable during sync or API calls, the system tries each fallback in order and promotes the first working one to primary
  • DNS health status UI in the Xtream API tab showing online/offline status and response times for all configured URLs
  • Failover is integrated into both XtreamService (covers all API calls) and ProcessM3uImport (sync job)

Test plan

  • Create an Xtream playlist and add 1-2 fallback URLs in the "Fallback URLs" repeater
  • Verify URLs save and load correctly on the edit form
  • Open the playlist view > Xtream API tab and confirm the DNS Status panel appears with status badges
  • Click "Check All" and verify statuses refresh
  • Set an unreachable URL as primary, trigger a sync, and confirm it automatically fails over to a working fallback
  • Verify xtream_config.url is updated to the new working URL after failover
  • Open a playlist with no fallback URLs and confirm no errors (Livewire root tag fix)
  • php artisan test --filter=XtreamFallback — 16 tests pass

Allow users to configure multiple server URLs per Xtream playlist.
When the primary URL becomes unreachable, the system automatically
tries fallback URLs in order and promotes the first working one to
primary. Includes a DNS health status UI in the Xtream API tab.
Livewire requires a root HTML tag in every view. When no fallback
URLs exist the @if block produced an empty view, causing a
RootTagMissingFromViewException.
@Warbs816 Warbs816 marked this pull request as ready for review March 29, 2026 21:50
@Warbs816
Copy link
Copy Markdown
Contributor Author

The failed test is not mine 😊

- Add `promoteXtreamUrl()` to Playlist model to promote a specific
  working URL to primary, rather than blindly promoting the next URL
  in sequence. Fixes multi-fallback failover promoting a still-down URL.

- Update XtreamService::call() and ProcessM3uImport to call
  promoteXtreamUrl($workingUrl) with the URL that actually succeeded.

- Add $verify param to XtreamHealthService::checkUrl() so SSL
  verification respects the playlist's disable_ssl_verification setting
  rather than always being disabled.

- Replace duplicate health check logic in ProcessM3uImport with a call
  to XtreamHealthService::findWorkingUrl(), consolidating failover
  behaviour into a single place.

- Add 4 new Pest tests covering the above, bringing the suite to 20
  passing tests.
@sparkison sparkison merged commit c917a2f into m3ue:dev Mar 30, 2026
4 checks passed
@Warbs816 Warbs816 deleted the feature/xtream-fallback-urls branch April 4, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants