Skip to content
This repository has been archived by the owner on Mar 2, 2021. It is now read-only.

Enhancement: CSV Based Filter #14

Open
ramarnat opened this issue Jan 15, 2020 · 8 comments
Open

Enhancement: CSV Based Filter #14

ramarnat opened this issue Jan 15, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@ramarnat
Copy link
Contributor

ramarnat commented Jan 15, 2020

I would like to suggest a way to specify an input csv file to batch filter/set individual streams:

core:
  server_listen: localhost:8080
  update_schedule: "*/24 * * * *"
  output: m3u
  group_order:
    - Entertainment
    - Family/Kids
    - News
    - Drama
providers:
  - uri: file:///path/to/m3u/playlist.m3u
    csv_filter: file:///path/to/m3u/filter.csv
    csv_setter:
        - Id: tvg_id_csv_col
        csv_filter_field: CUID_csv_col

what do you think @hoshsadiq ?

@hoshsadiq
Copy link
Owner

If your aim is to make avoid writing conditionals, I'm not sure I see a reason to use CSV over a more simple YAML based filtering mechanism. I'm curious what the use case is. Also, what would the CSV look like?

@ramarnat
Copy link
Contributor Author

ramarnat commented Jan 15, 2020

Here is my (albeit) personal workflow:

  1. Use m3ufilter to generate a csv starting point (all streams)
  2. Clean up the big items (Titles, remove low bw etc.) using the global filters
  3. Regenerate the csv
  4. use the csv map the channels that I have access to clean epg data (schedules direct), in the csv - basically a whitelist
  5. (this proposal) Use the whitelist csv to generate the streams via m3ufilter. CSV, because its just easier to maintain, and has the feedback loop with the csv output of m3ufilter.
  6. I'd also want to continue to publish channels that are not in the whitelist using the global filters
  7. The csv is also useful to filter the source epg list.
  8. This filtered m3u and epg then goes into my xteve proxy server

@ramarnat
Copy link
Contributor Author

ramarnat commented Jan 15, 2020

To answer the specific question, I was thinking the csv would have a column for the CUID (column specified in the yaml example as csv_filter_field) to identify the stream, and then columns that would override the value that is coming from the stream. In the above example yaml above, you would specify what the mapping is. Any field not mapped, would use the original value.

@ramarnat
Copy link
Contributor Author

btw, not proposing for you to build this, I was going to do it for my workflow, but if you have suggestions on how it could be done so it can be accepted as a PR (while still working for my workflow) was the purpose of opening the issue.

@hoshsadiq
Copy link
Owner

Seems like an interesting workflow. Would potentially make the yaml config much simpler. Feel free to raise a PR and I'd be happy to review and accept.

@ramarnat
Copy link
Contributor Author

I'll take a crack at it, and post the PR

@stale
Copy link

stale bot commented Jan 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 29, 2020
@hoshsadiq hoshsadiq added enhancement New feature or request and removed stale labels Jan 29, 2020
@hoshsadiq
Copy link
Owner

An initial implementation for CSV usage is done in #36, to be merged into master soon. Test it out and let me know!

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

No branches or pull requests

2 participants