pawanpaudel93 / m3u-parser

A parser for m3u files. It parses the contents of the m3u file to a list of streams information which can be saved as a JSON/CSV/M3U file.
MIT License
33 stars 16 forks source link

Removing stream information from streams using multiple filters in filter_by not working #8

Closed dineiar closed 3 years ago

dineiar commented 3 years ago

Sample M3U input:

#EXTM3U
#EXTINF:-1 tvg-id="google" tvg-name="Google" group-title="Google Group", Google
http://www.google.com/
#EXTINF:-1 tvg-id="youtube" tvg-name="YouTube" group-title="YouTube Group", YouTube
http://www.youtube.com/
#EXTINF:-1 tvg-id="facebook" tvg-name="Facebook" group-title="Facebook Group", Facebook
http://www.facebook.com/

Let's say I want to remove two groups: Google and YouTube. It works if i call filter_by two times passing two filters:

parser.filter_by('category', ['Google.*'], retrieve=False)
parser.filter_by('category', ['YouTube.*'], retrieve=False)

However, if I call filter_by passing a single filter with the two regexes criteria it does not work:

parser.filter_by('category', ['Google.*', 'YouTube.*'], retrieve=False)

I would expect it to work just the same as the above two lines in this case.

pawanpaudel93 commented 3 years ago

Thank you for your PR @dineiar.