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
29 stars 16 forks source link

m3u-parser returns empty list #22

Open chaosblog opened 9 months ago

chaosblog commented 9 months ago

I try to parse an m3u file from an Fritz!Box, that I can access with python requests without problems - m3u-parser returns a empty list. Since all the entries in the m3u link to rtsp streams I also diasabled the live check.

Here is the (to one entry shortend) content of the m3u-File:

#EXTM3U
#EXTINF:0,Dlf
#EXTVLCOPT:network-caching=1000
rtsp://10.0.0.1:554/?avm=1&freq=514&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,800,810,850

This is my python-code:

from m3u_parser import M3uParser
url = "http://10.0.0.1/dvb/m3u/radio.m3u"
parser = M3uParser()
parser.parse_m3u(path= url, check_live=False)
print(parser.get_list())

And this is the output from the code:

INFO: Started parsing m3u link...
INFO: Parsing completed !!!
[]

Is there anything I'm doing wrong or is this a problem with m3u-parser?

chaosblog commented 9 months ago

After looking into the closed issues, it seams to be the same thing like in issue #16 - rtsp is missing in the list of correct URI schemes. Is there a reason why there are only this few schemes supported? Since tthe IANA has a much longer list of official registered and allowed schemes

pawanpaudel93 commented 7 months ago

Hey @chaosblog Thanks for the issue. Its in the works. I will update you as soon as i am finished up with this issue.

pawanpaudel93 commented 7 months ago

@chaosblog Please install the latest version 0.4.0. Here is the example which should work for you.

async def rtsp_checker(url: str) -> bool:
    # Checker implementation
    # Return either True for good status or False for bad status
    return True

from m3u_parser import M3uParser
url = "http://10.0.0.1/dvb/m3u/radio.m3u"
parser = M3uParser()
parser.parse_m3u(url, schemes=['http', 'https', 'rtsp'], status_checker={"rtsp": rtsp_checker}, check_live=True)
print(parser.get_list())