iptvnator icon indicating copy to clipboard operation
iptvnator copied to clipboard

[Bug]: Series title when clicked plays some other random show

Open rsparhar opened this issue 1 month ago • 9 comments

Before you submit

  • [x] I'm on the latest release (or a nightly build) and the problem still happens there.
  • [x] I searched the existing issues and this hasn't been reported yet.
  • [x] I removed usernames, passwords, MAC addresses, tokens and private URLs from everything I paste below.

IPTVnator version

0.24.0

How do you run IPTVnator?

Linux .deb, .rpm or pacman package

Operating system and version

Fedora 44

Source type

Stalker portal

Video player

Video.js player

Did this work in an earlier version?

I don't know

Last version where it worked

No response

What happened?

I was trying to play a show (series) and it has 10 episodes in it. Every episode I clicked played a different show other than the one I wanted. I also found that using search would not show this series. I had to go to the specific group and search then it came up. I tried all the layers, same issue for VLC too. My guess is that my Stalker Portal is being incorrectly parsed and grouped. I use tivimate and it works fine on that, just not on iptvmator.

Steps to reproduce

  1. Open Stalker portal
  2. Goto Movies
  3. All my movies and series show in a single list (I researched this and because my portal uses is_series=1 it is treated this way).
  4. Go to group and search for show.
  5. Click show, then scroll down and click episode.
  6. No matter what episode you click that show does not play, it plays some other random content.

Diagnostics, logs and screenshots

No response

rsparhar avatar Oct 06 '26 03:10 rsparhar

If I can get guidance on what logs to grab I would be happy to. I tried looking at streams URLs but its hard to tell from the stream URL what it should be.

rsparhar avatar Oct 07 '26 01:10 rsparhar

Additional context on the bug:

Live TV and standalone VOD Movies play correctly, but selecting any TV Series episode consistently plays an unrelated movie, an incorrect episode, or random content from the portal.

What is happening: On Stalker/Ministra backends, episodes inside a TV series do not have standalone VOD media IDs. Instead, they exist within the parent series hierarchy. Currently, the stream resolver appears to take the episode's internal database row ID and request it as if it were an independent movie (type=vod).

Because the portal middleware receives a standalone VOD request, it searches its master movie catalog for whatever title happens to share that database row ID and streams that random file instead of the requested episode.

Expected behavior: When requesting playback for a Stalker TV series episode, the app should query the stream link through the parent series ID and season/episode index rather than passing the raw episode ID into the standalone VOD playback command.

rsparhar avatar Oct 18 '26 03:10 rsparhar

Thanks for the additional details! We reproduced an episode/file ID mismatch and merged a fix in #1996.

The fix is available in the latest nightly build and will be included in the next stable release. Could you try the nightly and confirm whether episodes now play correctly with your provider? You can also wait for the stable release if you prefer.

The search behavior you mentioned may be a separate issue; this fix specifically addresses incorrect episode playback. I’ll leave this open for now pending confirmation.

4gray avatar Oct 26 '26 15:10 4gray

@4gray you rock! I tested the nightly and the episodes now play properly vs playing some unknown content.

I am really loving IPTVNator project and how active it is.

Did you want me to file a separate issue for the search? The search is horrible. I get titles that have nothing to do with my search. "ALL" should allow me to just do 1 search for all items in the tab. It doesn't find the content I want and returns me other content that I didn't expect.

rsparhar avatar Oct 26 '26 23:10 rsparhar

Did some more testing and it appears it still has problems. It is not showing all episodes for a season. It appears to only show the last 14 episodes in the season skipping the starting bunch.

rsparhar avatar Nov 01 '26 03:11 rsparhar

In looking at this more, I think its a pagination issue but I can't paginate in a series, I just see a list of what I can pick and it only shows me the last 14.

Can we get pagination enabled? I assume some series have tonnes of episodes, like 100+ so if we get pagination I guess you would also want to take into consideration what the last episode played was and start at the page? At least I feel we have an idea of what the problem is.

Better yet if you can load the full list.. ;)

rsparhar avatar Nov 01 '26 04:11 rsparhar

Update regarding Stalker / Ministra portals & the 14-episode limit

Following up with additional details on this: the issue occurs specifically on Stalker / Ministra portals, and the limit of 14 episodes is not random. Root Cause

In Infomir’s Ministra / Stalker middleware, the default configuration file (config.ini) defines: Ini, TOML

max_page_items = 14

(This is legacy behavior inherited from MAG set-top boxes whose screen UI displayed exactly 14 rows).

When IPTVnator calls action=get_ordered_list for series/episodes, the Stalker backend returns a paginated JSON response: JSON

{ "js": { "total_items": 58, "max_page_items": 14, "cur_page": 1, "selected_item": 0, "data": [ ... 14 items ... ] } }

Because the provider’s default sort order is often descending (newest first), IPTVnator only reads cur_page: 1 (data), showing only the last 14 episodes. Episodes on pages p=2, p=3, etc., are never fetched.

Clients like TiviMate handle this by inspecting total_items in the Stalker response and recursively or concurrently fetching all pages until the entire episode list is compiled. Suggested Solution

In the Stalker API service where get_ordered_list is dispatched for series/season episodes:

Option A: Page through until total_items is reached (Most Reliable)
Many Stalker portals ignore client overrides for max_page_items. A loop or recursive rxjs / Promise.all fetch handles this cleanly:
TypeScript

async function fetchAllStalkerEpisodes(portalUrl: string, params: StalkerParams): Promise<Episode[]> {
  let currentPage = 1;
  let episodes: Episode[] = [];
  let totalItems = Infinity;

  while (episodes.length < totalItems) {
    const response = await stalkerClient.getOrderedList({
      ...params,
      p: currentPage,
    });

    const data = response?.js?.data ?? [];
    totalItems = response?.js?.total_items ?? data.length;

    if (!data.length) break;

    episodes = episodes.concat(data);
    currentPage++;
  }

  return episodes;
}

Option B: Request all items or a higher page limit (Fallback/Optimization)
Some modern Stalker instances allow overriding the MAG default in the query:

    Appending &max_page_items=500 (or max_page_items=0) to the get_ordered_list request.

    Note: Because many strict/older Ministra deployments hard-cap this server-side at 14, combining this with the pagination loop above provides the best compatibility across providers.

rsparhar avatar Nov 01 '26 04:11 rsparhar

I tested build 0.25.1104.4637 and it appears to be fixed in that all episodes are showing as far as I can tell. I'll continue to test.

rsparhar avatar Nov 05 '26 03:11 rsparhar

Fixed the episode/file mapping in #1996 and full episode pagination in #2088. Thanks for confirming the result. Closing as resolved; the separate continuation issue remains tracked in #2123.

4gray avatar Nov 06 '26 18:11 4gray