Skip to content

Fix orangetv.orange.es segment cache leaking programs across channels - #3274

Merged
PopeyeTheSai10r merged 3 commits into
iptv-org:masterfrom
oscarbc96:fix-orangetv-segment-cache
Oct 23, 2026
Merged

PopeyeTheSai10r merged 3 commits into
iptv-org:masterfrom
oscarbc96:fix-orangetv-segment-cache

Conversation

@oscarbc96

Copy link
Copy Markdown
Contributor

Problem

sites/orangetv.orange.es/orangetv.orange.es.config.js fetches each day in three 8-hour segments and caches segments 2-3 in a module-level caches object. But it stores the items after filtering them for the channel that happened to fetch the segment first:

const segments = parseItems(res, channel)
items.push(...segments)
if (caches[queue.url] === undefined) {
  caches[queue.url] = segments   // <- channel-filtered!
}

Every channel parsed afterwards for the same date does items.push(...caches[url]) and inherits that first channel's segment 2-3 programs. In a multi-channel grab this puts the same show on ~100 channels (screenshot below shows TRECE's "El cascabel" appearing on virtually every channel at 22:00):

Two smaller issues fixed along the way:

  • The if (items.length) guard skipped segments 2-3 whenever a channel had no programs in segment 1 (00:00-08:00), so channels idle overnight came out completely empty even though the feed has their programs in segments 2-3.
  • i.channelExternalId === channel.site_id compares strictly while the feed mixes numeric and string ids; compare as strings.

Fix

Cache the raw segment payload and run parseItems per channel; always fetch segments 2-3; compare ids as strings.

Testing

  • npm test --- orangetv.orange.es passes (3/3)
  • Full grab of 131 Orange channels × 3 days: each channel now carries only its own schedule (verified "El cascabel" appears only on TRECE, site_id 1017, matching the raw feed), and previously-empty channels (e.g. 12TV) now have programs.

oscarbc96 and others added 3 commits September 3, 2026 22:50
The cache stored segment items AFTER filtering them for whichever
channel fetched the segment first, so every channel parsed afterwards
on the same date inherited that channel's segment 2-3 programs (e.g.
TRECE's evening show appearing on ~100 other channels). Cache the raw
segment payload instead and filter per channel.

Also fetch segments 2-3 even when segment 1 has no items (channels
idle between 00:00-08:00 came out empty), and compare channel ids as
strings since the feed mixes numeric and string channelExternalId.
@PopeyeTheSai10r
PopeyeTheSai10r merged commit 839d032 into iptv-org:master Oct 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants