Commit graph

818 commits

Author SHA1 Message Date
SergeantPanda
92d499a274 Enhancement: Switch regex compilation from re to regex module
Use the 'regex' package instead of Python's standard 're' module for pattern
compilation in custom dummy EPG generation. This enables variable-width
lookbehind support, matching JavaScript regex behavior and removing the
fixed-width limitation of the standard library.

This fixes issues where patterns like (?<=\d{1,2}...) would fail with
"look-behind requires fixed-width pattern" errors.
2025-10-19 19:39:53 -05:00
SergeantPanda
4b74673795 Bug fix: Use search instead of match for checking if the title matches the title_match regex for custom dummy. 2025-10-19 17:06:44 -05:00
SergeantPanda
6a85475402 Enhancement: Adds ability to specify categories (comma separted) as well as include date and live tags in custom epg dummy output. 2025-10-19 10:06:48 -05:00
SergeantPanda
163b1dd7cf Move buttons to the right side and correctly load in output timezone for custom dummy epg. 2025-10-18 21:19:54 -05:00
SergeantPanda
603c9f9269 Enhancement: Added ability to specify output timezone for custom epg dummy. 2025-10-18 21:12:20 -05:00
SergeantPanda
fe540045fc Enhancement: Add a {time} and {time24} output for better output formatting of the time. 2025-10-18 21:06:27 -05:00
SergeantPanda
dee672287b Bug fix: Fixes bug where if minute was not specified matching would fail for custom dummy. 2025-10-18 20:50:56 -05:00
SergeantPanda
c21ea5ecbe Bug Fix: Use event timezone for date calculation in custom dummy channels
Previously used UTC date which caused events to be scheduled a day late when current UTC time had crossed midnight but the event timezone hadn't.
2025-10-18 20:46:06 -05:00
SergeantPanda
8494f615d0 Bug fix: Use correct name if stream name is supposed to be used to build dummy. 2025-10-18 17:29:44 -05:00
SergeantPanda
0d987aae99 Enhancement: If a stream profile is set for a custom stream, when previewing the stream Dispatcharr will now use the assigned stream profile. Fixes #186 2025-10-18 16:24:47 -05:00
SergeantPanda
1a541bd133 Bug fix: Unable to preview custom streams. 2025-10-18 15:52:48 -05:00
SergeantPanda
91eaa64ebb Enhancement: Force a specific EPG for auto channel sync channels. 2025-10-18 13:43:49 -05:00
SergeantPanda
0a4c7cae25 Bug fix: Fix bug where channel logo would revert back to provider logo after a refresh (for auto channel sync channels) 2025-10-18 12:38:43 -05:00
SergeantPanda
22fb0b3bdd Enhancement: Add Custom Dummy EPG with Dynamic Pattern Matching and Name Source Selection
This enhancement introduces a powerful custom dummy EPG system that allows users to generate EPG programs on-demand by parsing channel or stream names using configurable regex patterns.

Key Features:
- Custom Pattern Matching: Define regex patterns to extract information from channel/stream names (teams, leagues, times, dates, etc.)
- Flexible Name Source: Choose to parse either the channel name or a specific stream name (by index)
- Timezone-Aware Scheduling: Automatic DST handling using pytz timezone names (e.g., 'US/Eastern', 'Europe/London')
- Time Format Support: Parse both 12-hour (AM/PM) and 24-hour time formats
- Date Parsing: Extract dates from names with flexible month/day/year patterns
- Custom Templates: Format EPG titles and descriptions using captured groups with {placeholder} syntax
- Upcoming/Ended Customization: Define custom titles and descriptions for programs before and after scheduled events
- Live Preview: Test patterns and templates in real-time with sample input
- Smart Program Generation: Automatically creates "Upcoming" and "Ended" programs around scheduled events

Use Cases:
- Sports channels with event details in stream names (e.g., "NHL 01: Bruins VS Leafs @ 8:00PM ET")
- Movie channels with genre/title/year information
- Racing events with driver/track/series details
- Any scenario where EPG data is embedded in channel/stream naming conventions

Technical Implementation:
- Backend: Pattern matching engine with timezone conversion and program scheduling logic
- Frontend: Interactive form with validation, pattern testing, and visual group preview
- Name Source Options: Parse from channel name or selectable stream index (1-based)
- Fallback Behavior: Uses standard dummy EPG if patterns don't match
- Custom Properties: Stores all configuration in EPGSource.custom_properties JSON field

Configuration Options:
- Title Pattern: Extract primary information (required)
- Time Pattern: Extract hour/minute/AM-PM (optional)
- Date Pattern: Extract month/day/year (optional)
- Timezone: Event timezone with automatic DST support
- Program Duration: Length of generated programs in minutes
- Title Template: Format EPG title using captured groups
- Description Template: Format EPG description using captured groups
- Upcoming Title Template: Custom title for programs before event starts (optional)
- Upcoming Description Template: Custom description for programs before event starts (optional)
- Ended Title Template: Custom title for programs after event ends (optional)
- Ended Description Template: Custom description for programs after event ends (optional)
- Name Source: Channel name or stream name
- Stream Index: Which stream to use when parsing stream names (1, 2, 3, etc.)

Closes #293
2025-10-18 12:08:56 -05:00
SergeantPanda
ca8e9d0143 Enhancement: Add custom logo support for channel groups in Auto Sync Channels.
Closes #555
2025-10-17 10:03:21 -05:00
SergeantPanda
ec21e8329d Enhancement: Increase time for a client to search for an available connection from 1.5 seconds to 3 seconds. This will help when clients are changing channels and release the old connection AFTER attempting to start the new connection. Closes #503
Bug Fix: Fix a bug where searching for an available stream could clear out stream locks for streams that it never acquired a lock for.
2025-10-16 17:38:23 -05:00
SergeantPanda
9b2ebf169b Better database connection cleanup. 2025-10-16 14:22:19 -05:00
SergeantPanda
4df2f79bcf Bug fix: Fixes bug where if there were no channel profiles other than ALL, streamer and standard accounts could not stream any channels even if they had ALL profiles selected. 2025-10-14 15:03:42 -05:00
SergeantPanda
ed065f718d Enhancement: Implement caching for proxy settings to improve performance and reduce database load. Also, ensure database connections are closed after use in both config and stream manager. 2025-10-14 13:44:28 -05:00
SergeantPanda
404d2f82a3 Switch HTTP streamer to a thread and pipe its output to a local pipe where the fetch chunk can access it the same way our transcode processes would be accessed. Simplifies the code. 2025-10-12 09:42:15 -05:00
SergeantPanda
74280baa85 Changed read timeout for http connection for the proxy server to 10 secounds to avoid unnecessary timeouts.
Improved try_next_stream to not fail if the returned stream is the same. It will now try a different stream.
Force a client to jump ahead in the buffer if they fall to far behind.
2025-10-11 19:45:21 -05:00
SergeantPanda
fa08216600 Enhancement: Add chunk timeout configuration in ConfigHelper. Improve StreamManager timeout handling for consistency. Only 1 heartbeat thread per worker should be started now. Timeout on proxy reduced from 60 seconds to 5. 2025-10-11 18:08:20 -05:00
SergeantPanda
d5f9ba7e5e Sort EPG output by channel number. 2025-10-10 17:55:51 -05:00
SergeantPanda
f58bc81c36 Enhancement: Optimize EPG program fetching by implementing chunked retrieval and explicit ordering to improve performance and reduce memory issues. 2025-10-10 17:52:05 -05:00
SergeantPanda
fefab4c4c6 Enhancement: Improve resource cleanup in ProxyServer and StreamManager classes to avoid "SystemError: (libev) error creating signal/async pipe: Too many open files" errors 2025-10-10 15:26:02 -05:00
SergeantPanda
9dc54fdcff Fix: Ensure channel_id and channel.uuid are converted to strings before processing. This fixes an issue where sending a stream switch event would fail if the event was sent from a non owning worker.
Fixes [Bug]: Manually switching active stream not working when using XC client.
Fixes #269
2025-10-09 19:10:38 -05:00
SergeantPanda
951af5f3fb Enhancement: Add auto-enable settings for new groups and categories in M3U and VOD components
Bug Fix: Remove orphaned categories for VOD and Series
Fixes #540
Closes #208
2025-10-09 15:28:37 -05:00
SergeantPanda
da245c409a Bug fix: Backend now notifies frontend when a new playlist is creating. This should fix where accounts will sometimes only show fetching groups after a new account is added. 2025-10-07 09:55:35 -05:00
SergeantPanda
d1aa9fe441 Bug fix: Add logo URL validation to prevent PostgreSQL btree index errors during channel creation from stream 2025-10-06 21:22:16 -05:00
SergeantPanda
3326b9fbdc Bug fix: Add logo URL validation to prevent PostgreSQL btree index errors during bulk channel creation
Fixes #519
2025-10-06 21:11:53 -05:00
SergeantPanda
13874d64ad Bug fix: If no streams are found during an XC account refresh we were not releasing the task lock and we weren't processing vods.
Fixes #449
2025-10-06 20:04:22 -05:00
SergeantPanda
bc574c272c Bug fix: convert commas to decimals and verify float before saving vod/series to database.
Fixes #526
2025-10-06 19:45:43 -05:00
SergeantPanda
144a861142 Bug fix: When using direct urls in m3u output, use the correct stream based on the order for the channel.
Fixes #528
2025-10-06 18:18:05 -05:00
SergeantPanda
e01338f055 Enhancement: Properly track channel creation time and channel update times in the database. XC Get Live streams will now use this for the added field. 2025-10-06 18:07:51 -05:00
SergeantPanda
22493c2797 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into dev 2025-10-06 16:50:28 -05:00
SergeantPanda
a4a677a6fb Bug fix: Streamers with ALL assigned will now get all channels they have access to instead of All profiles. If there wasn't a profile other than default before, the streamer would not get any channels. 2025-10-06 16:50:17 -05:00
OkinawaBoss
8db9689999
Merge branch 'DVR-Update' into dev 2025-10-06 06:25:40 -07:00
Dispatcharr
dea6411e1c Time Zones
- Added time zone settings
2025-10-06 07:46:23 -05:00
SergeantPanda
a31feee311 Bug fix: Ensure distinct channel results in generate_m3u, generate_epg, and xc_get_live_streams functions. Fixes duplicate channels output for streamer profiles that were set to "All" 2025-10-05 19:32:40 -05:00
SergeantPanda
25d6322186 Merge branch 'dev' of https://github.com/Dispatcharr/Dispatcharr into Assign-tvg-id-from-epg 2025-10-04 16:59:53 -05:00
SergeantPanda
29ee837b24 Add recover=True to iterparse for parse_programs_for_tvg_id as well to fix cloudflare script injection. 2025-10-04 16:36:49 -05:00
SergeantPanda
94f966e027 Reverted to old method for parsing xml. Still will not break if Cloudflare adds a new root element. 2025-10-04 16:25:35 -05:00
SergeantPanda
d1ac5b11e5 Add EPG TVG-ID setting functionality
- Implemented API endpoint to set channel TVG-IDs from EPG data.
- Created Celery task to handle TVG-ID updates for multiple channels.
- Added frontend methods to initiate TVG-ID setting from EPG for both single and batch channel forms.
- Enhanced notifications for task status updates.
2025-10-04 15:20:35 -05:00
SergeantPanda
0a15e09805 Refactor XMLTV parsing to use iterparse for <tv> element. This fixes issues where Cloudflare is adding a root element and breaking the xml.
Fixes #497: Cloudflare hosted EPG not supported in dispatcharr
2025-10-03 13:30:20 -05:00
SergeantPanda
d06c5bfdf3 Add recover to xmltv parser if there are errors. 2025-10-03 10:15:24 -05:00
SergeantPanda
c73271c617 Bug Fix: Sort order while bulk creating channels will now be in the order they were selected in not reverse order. 2025-10-02 13:23:24 -05:00
SergeantPanda
e841343e5b Dont convert m3u_id to string for hash. 2025-10-02 11:06:10 -05:00
SergeantPanda
a3e4f23891 Enhancement: Add m3u_id parameter to generate_hash_key and update related calls 2025-10-02 09:14:22 -05:00
SergeantPanda
93dd37e822 Enhancement: Add x-tg-url and url-tvg URL generation with preserved query parameters to M3U content 2025-09-26 14:10:42 -05:00
SergeantPanda
70f7484fb5 Better connection tracking for apps that do not reuse connections during seeking operations. 2025-09-26 09:18:43 -05:00