Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Loading Multiple Configurations from a Single Source #944

Open
alpgul opened this issue Jan 27, 2025 · 3 comments
Open

Support for Loading Multiple Configurations from a Single Source #944

alpgul opened this issue Jan 27, 2025 · 3 comments

Comments

@alpgul
Copy link

alpgul commented Jan 27, 2025

Support for Loading Multiple Configurations from a Single Source

Description

Currently, the IPTV Simple PVR add-on requires users to manually input IPTV channels and EPG (Electronic Program Guide) information one by one. This process can be time-consuming and prone to errors, especially when multiple sources are used. Therefore, we are requesting a new feature that allows users to load multiple configurations from a single source.

Proposed Solution

1. Loading Configuration via JSON or XML

  • Users should be able to define multiple configurations through a single JSON or XML file.
  • This file should include the following information:
    • M3U8 URL Definition: The URL of the M3U8 file containing the list of IPTV channels.
    • EPG URL Definition: The URL of the XMLTV file containing the Electronic Program Guide (EPG) information.
    • Channel Logo URL Definition: The URLs where channel logos are located.
  • Users should be able to load this file either from a local file path or a URL.

2. Filtering Duplicate M3U8 URLs

  • If multiple M3U8 definitions contain the same channel URLs, the add-on should automatically filter out these duplicates and display only one instance.
  • This feature will allow users to view their channel lists in a cleaner and more organized manner.

Example JSON Structure

{
  "configurations": [
    {
      "name": "Config 1",
      "m3u8_url": "http://example.com/playlist1.m3u8",
      "epg_url": "http://example.com/epg1.xml",
      "logo_base_url": "http://example.com/logos/"
    },
    {
      "name": "Config 2",
      "m3u8_url": "http://example.com/playlist2.m3u8",
      "epg_url": "http://example.com/epg2.xml",
      "logo_base_url": "http://example.com/logos/"
    }
  ]
}

Example XML Structure

<configurations>
  <configuration>
    <name>Config 1</name>
    <m3u8_url>http://example.com/playlist1.m3u8</m3u8_url>
    <epg_url>http://example.com/epg1.xml</epg_url>
    <logo_base_url>http://example.com/logos/</logo_base_url>
  </configuration>
  <configuration>
    <name>Config 2</name>
    <m3u8_url>http://example.com/playlist2.m3u8</m3u8_url>
    <epg_url>http://example.com/epg2.xml</epg_url>
    <logo_base_url>http://example.com/logos/</logo_base_url>
  </configuration>
</configurations>

Benefits

  • Time Savings: Users save time by loading multiple configurations at once.
  • Error Reduction: Minimizes errors that can occur with manual input.
  • Cleaner Channel List: Automatic filtering of duplicate channel URLs ensures users see a more organized channel list.
@phunkyfish
Copy link
Member

phunkyfish commented Jan 27, 2025

I don’t think this is possible. A PVR addon cannot create an instance of itself.

Filtering duplicates URLs would not be possible either. Simply because each instance cannot communicate with another instance nor can it access that instances data.

I think what you really want is: xbmc/xbmc#23648

Which would allow a Python addon to be written that would do what you want. You could even handle duplicates.

@alpgul
Copy link
Author

alpgul commented Jan 28, 2025

In Kodi, doesn't the addon have access to the Kodi\userdata\addon_data\pvr.iptvsimple directory, or can't files be created in this directory? However, there is code in the src/iptvsimple/utilities/FileUtils.cpp file that performs file operations in this directory.

@phunkyfish
Copy link
Member

That would be a hack. Kodi core must provide an API for this.

I can see an APi for Python happening, but an API accessible by PVR addons is unlikely.

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

No branches or pull requests

2 participants