Commit graph

125 commits

Author SHA1 Message Date
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
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
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
a12bfeab46 Enhancement: Increase max_length of URL field in EPGSource model to 1000 characters 2025-09-24 16:12:17 -05:00
SergeantPanda
6f79845b21 Enhancement: Only grab first display name for a channel during epg scanning. 2025-09-21 12:40:20 -05:00
SergeantPanda
99122cac7c Bug fix: If URL for Channel element in EPG is longer than 500 characters parsing would fail. Added validation during scanning. 2025-09-21 12:23:48 -05:00
SergeantPanda
f4f29a0e27 Break out of channel child elements once required data is acquired. 2025-09-18 10:34:51 -05:00
SergeantPanda
d2d1984797 Switch bulk epg name and logo to backend celery tasks for efficiency and scrape epg channel logo during epg scanning. 2025-09-16 17:17:07 -05:00
Dispatcharr
00cc83882a DVR update 2025-09-03 21:35:45 -05:00
SergeantPanda
6f6c28ca7c Convert custom_properties to jsonb in the backend. 2025-09-02 09:41:51 -05:00
SergeantPanda
eec53d5874
Merge pull request #294 from pantherale0/feat/chunked-extractor
Fix: Prevent memory exhaustion when extracting large compressed files
2025-08-14 09:50:52 -05:00
Jordan
72fee02ec4
ensure chunk is either null or empty to exit loop 2025-08-12 11:26:50 +01:00
Jordan
429b01b569
prevent memory issues by implementing a chunked extractor 2025-08-11 16:28:23 +01:00
SergeantPanda
7b5a617bf8 Use custom validator for urls fields to allow for non fqdn hostnames.
Fixes #63
2025-08-01 11:28:51 -05:00
SergeantPanda
d24520d3d8 Enhance EPG XML generation with additional metadata extraction and improved handling for keywords, languages, ratings, and credits. 2025-07-10 13:22:42 -05:00
dekzter
a1576bd493 merged in dev 2025-06-10 08:55:14 -04:00
SergeantPanda
e7bf8cbede Added support for LIVE tag and dd_progrid numbering systems for epg. 2025-06-03 22:00:17 -05:00
dekzter
9f96529707 merged in main 2025-06-03 17:49:24 -04:00
dekzter
3f445607e0 looooots of updates for user-management, initial commit of access control 2025-05-31 18:01:46 -04:00
SergeantPanda
67663e2946 Add remove_blank_text=True to lxml parser. Fixes crashes related to poorly formatted xmltv files. 2025-05-30 10:25:47 -05:00
SergeantPanda
906fbef9c2 Output errors from parser if found. 2025-05-29 13:56:20 -05:00
dekzter
6504db3bd4 merged in dev 2025-05-28 18:34:45 -04:00
SergeantPanda
4dbb363211 Removed display-name from logging as it may not exist. 2025-05-27 18:00:35 -05:00
SergeantPanda
3fa5301894 If cached file doesn't exist for compressed mapped file, properly re-exctract. 2025-05-27 09:54:28 -05:00
SergeantPanda
45239b744c Delete cached files when deleting epg account. 2025-05-26 16:19:57 -05:00
SergeantPanda
5d2c604a4a Peak inside gz files to see if they contain xml files. Check file list for zip files to see if they contain xml files. 2025-05-26 15:49:51 -05:00
SergeantPanda
8f4e05b0b8 Add extracted_file_path to EPGSource model and update extraction logic 2025-05-26 15:10:54 -05:00
SergeantPanda
182a009d69 Track extracted files for mapped epg files. 2025-05-25 18:14:27 -05:00
SergeantPanda
7dbd41afa8 Extract compressed files after downloading and delete original. 2025-05-25 17:39:41 -05:00
SergeantPanda
d270e988bd Greatly improve filetype detection. 2025-05-25 16:50:03 -05:00
SergeantPanda
0322a5c904 Smarter logging for file type. 2025-05-25 15:47:22 -05:00
SergeantPanda
c1eb3a6ecf Add Zip file support for EPG. 2025-05-25 14:05:59 -05:00
SergeantPanda
391a1d9707 A little more cleanup. 2025-05-25 13:29:39 -05:00
SergeantPanda
d7023bcdac Some more code cleanup 2025-05-25 13:19:49 -05:00
SergeantPanda
6c3102a60c Removed sleep from debugging. 2025-05-24 17:46:17 -05:00
SergeantPanda
f77b3b9756 Little more cleanup. 2025-05-24 17:40:45 -05:00
SergeantPanda
3f17c90a8b Cleaned up some old unneeded code. 2025-05-24 17:31:52 -05:00
SergeantPanda
759cbe2f7d Search entire epg for channels to accomodate non standard epg files. 2025-05-24 15:07:49 -05:00
dekzter
eb1bbdd299 merged in dev 2025-05-24 07:19:43 -04:00
SergeantPanda
48e76273d1 Attempt at fixing timezone issues. 2025-05-22 10:23:59 -05:00
SergeantPanda
6de565857d Set default refresh interval for files added via mapping to 0 since they will auto-update when modified. 2025-05-21 14:59:24 -05:00
dekzter
e979113935 merged in dev 2025-05-21 15:24:30 -04:00
SergeantPanda
500e0941e2 Fixed calling process when it may not exist (log level higher than debug) 2025-05-21 12:11:03 -05:00
dekzter
a96c5f0f5c merged in dev 2025-05-21 08:16:35 -04:00
SergeantPanda
72783090cd Delete all instead of using a loop. 2025-05-20 20:36:04 -05:00
SergeantPanda
55089044fa Cleaned up code and logging a bit more. 2025-05-20 20:07:10 -05:00
SergeantPanda
451c892457 Changed logging levels. 2025-05-20 19:49:55 -05:00
SergeantPanda
cfad5621ce Found the problem. I hate lxml. 2025-05-20 18:43:43 -05:00