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

ability to combine 2 or more line/ providers #137

Open
aniel300 opened this issue Dec 18, 2024 · 14 comments
Open

ability to combine 2 or more line/ providers #137

aniel300 opened this issue Dec 18, 2024 · 14 comments
Labels
enhancement New feature or request

Comments

@aniel300
Copy link

ability to combine 2 or more line/ providers using either same domain or different domains

@euzu
Copy link
Owner

euzu commented Dec 18, 2024

I dont understand what you mean. Can you describe it a little more .

@aniel300
Copy link
Author

let say i have two m3u lines/ accounts from the same provider (either same domain or different domain) and they both have 1 cxn allow to each line. i would like the ability to group then together and then have the proxy load balance across them base on the defined allowed cxn. so in this case if 1 user is using 1 cxn from line 1, next user that starts watching will use the next line/cxn available from the next line and so on.

@aniel300
Copy link
Author

let me know if u still confuse and i will try to break it down more

@euzu euzu added the enhancement New feature or request label Jan 14, 2025
@aniel300
Copy link
Author

i have some more ideas about this feature request, i will add it soon

@jojo141185
Copy link
Contributor

jojo141185 commented Jan 25, 2025

It is certainly a lot of effort to implement, but in my view, the best approach for this feature request would be the following implementation:

  1. Automated Content Identification and Backup Assignment:
  • Automatically identify identical content across multiple providers by name using techniques like fuzzy matching (e.g., Levenshtein distance) and metadata comparison (e.g., title, release date, duration).
  • Assign backup providers for each piece of content to ensure availability if the primary provider is unavailable or the content is being accessed by another user.
  1. Fallback Mechanism:
  • When a user requests content, the system should first attempt to retrieve it from the primary provider.
  • If the primary provider is unavailable, the system should automatically redirect the request to a backup provider. This fallback should be seamless for the user.
  1. Web Interface for Manual Editing:
    Provide an easy-to-use web editor where administrators can:
  • Search for content across providers.
  • Review and manually adjust automated matches.
  • Assign or modify backup providers as needed.

This implementation would ensure high availability and a smooth user experience while allowing for flexibility and manual intervention where needed.

@aniel300
Copy link
Author

yes this all are good ideas. i still need to break down mines. btw this is related to that discussion i mentioned and the webui admin idea is a whole another discussion i wanted to tell you about but i don't want to overwhelm or push my luck with you, so u know one thing at the time.

@aniel300
Copy link
Author

aniel300 commented Jan 26, 2025

@jojo141185 my comment might be a little off because I thought it was @euzu who replied.

@euzu
Copy link
Owner

euzu commented Jan 26, 2025

@jojo141185 No, any help and contributions are welcome. The more people get involved, the better. So please don’t hesitate to share your opinion.

@euzu
Copy link
Owner

euzu commented Feb 14, 2025

I have started working on this feature.

The initial implementation will support multiple credentials for the same provider.

This means that the content remains identical across these credentials and is fetched only once.
Requests to the provider should be distributed in a cyclic manner (using the Round Robin technique).
One of the challenges with handling multiple connections is that many providers disconnect the previous connection when a new one is opened. This behavior ensures that a new connection does not result in an "access denied" response. For the first version, we will ignore this issue and focus on enabling the basic functionality.

In the first step, we are assuming that the content is identical across different credentials for the same provider. This is because we currently lack the capability to determine whether the content provided by different providers might overlap or be identical. Addressing this challenge is a complex task and will require further investigation in the future.

This feature introduces "input aliases" for the same provider, assuming the content is identical but accessed using different credentials. This approach simplifies access management while ensuring that content is fetched only once, thereby improving efficiency.

@aniel300 and @jojo141185 any suggestions or improvements to this initial draft are highly welcome!

- sources:
- inputs:
  - url: 'http://provider.net'
    name: my_provider
    username: xyz
    password: secret1
    aliases:
    - url: 'http://provider.net'
      username: abcd
      password: secret2
    - url: 'http://provider.net'
      username: defg
      password: secret3
  targets:
  - name: test

@aniel300
Copy link
Author

@euzu u are cooking. am sending u a edit version of my latest break down when it comes to this via discord as i have new ideas and concerns.

@jojo141185
Copy link
Contributor

jojo141185 commented Feb 15, 2025

@euzu I don't know if @aniel300 had the same thought when he opened this feature request. With my contribution I just wanted to try to describe and concretize this feature from my point of view, as there seem to have been open questions and unclarities for some time.
Your draft sounds like a solid initial approach! But in my perspective the greatest benefit would be a robust backup/failover system as described before. This would allow using different providers as backups or dynamically switching m3u-filter to free alternatives when one provider is busy. To achieve this, automated mapping of alternative channels (same content, different source/resolution) within or across providers is crucial, ideally with a web UI for manual adjustments. This would maximize uptime and user experience.
In my opinion, this would make m3u-filter unrivaled and provide a killer feature that many users are looking for. However, I personally don't have a use for it at the moment and therefore probably can't contribute much concrete to this.
It's important to emphasize that achieving this, especially the automated mapping and fallback mechanism, will require significant effort in developing a user-friendly web UI. A well-designed interface will be crucial for users to easily manage providers, review automated matches, and make manual adjustments.

@aniel300
Copy link
Author

aniel300 commented Feb 15, 2025

@jojo141185 i don't need anything done in the ui except for maybe fallbacks adjustments since i cant come up with a good way to do that via config. i actually prefer to do as much initial manual work in the config that way it can pay up in the long run. since u could change providers but your pre done work should work for the most part across provider and if anything, few tweaks might be need but that is about it. i have sent him a new edited broken-down logic on this and am waiting to see what he says. send me an invite on discord and i will send it to u.

@euzu
Copy link
Owner

euzu commented Feb 17, 2025

@aniel300 here your ideas

   url: '/xxx.txt'
   priority: 1,2,
   max_connections_per_line: option 1,5,3

url can be a texfile containing the provider url per line.
priority : prioritize the provider, and use max connections from this provider, then use the next in line until max connections reached. if the same priority number is on 2 or more source/imput then the load balancer should loadbalance across them. i think this might be usefull to use different providers while doing loadbalancing across them. this idea is for the fallback thing and will define a tiered system as to how the proxy should handle fallbacks base on provider/priorites.

@euzu
Copy link
Owner

euzu commented Feb 18, 2025

@jojo141185 , @aniel300

Based on our discussions, I’ve implemented an initial version of a Provider Manager.

The core idea behind this implementation is to keep the initial input configuration unchanged while extending it with the capability to add backup providers. To prioritize provider selection, we can fine-tune the configuration using max_connections and priority.

I’ve described in the method documentation how providers are selected. It’s important to note that the main input configuration and alias structure do not imply that the main input config acts as a master. Provider selection is solely based on priority. While the current structure may not seem like the perfect fit, it needs to be maintained to ensure compatibility with the old configuration style, where one provider corresponds to one input by default.

If you have any suggestions on how to improve this approach, feel free to share your thoughts.

ConfigInput {
  name,
  url,
  username,
  password,
  max_connections,
  priority,
  aliases: [
      ConfigInputAlias {
            url,
             username,
            password,
            max_connections,
            priority,          
      },
     ...
  ]
}

active_provider_manager.rs

@jojo141185 currently it is only for 1:1 same providers. I need to think about howto wrap channel based provider mappings in this structure.

If you have any suggestions to the current implementation please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants