sangwonl / python-mpegdash

MPEG-DASH MPD(Media Presentation Description) Parser
MIT License
104 stars 53 forks source link

urlopen doesn't take HTTPS #63

Open BogdanRusu-03 opened 3 months ago

BogdanRusu-03 commented 3 months ago

When I try to open an MPD file from an HTTPS link, urlopen throws the following error:

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1007)> parse.py:16

I would suggest the following changes in parse.py:

def parse(cls, string_or_url)  ->  **def parse(cls, string_or_url, verifiySSL=false):**
def load_xmldom(cls, string_or_url)  ->  def load_xmldom(cls, string_or_url, verifiySSL)
    ...
    mpd_string = urlopen(string_or_url).read()  -> requests.get(string_or_url, verify=verifiySSL)
    ....
onovy commented 3 months ago

not verifying SSL is bad practice. Make your self-signed certificated trusted.