From 03f4ec9e7450234f359a2352ae9318606fc45d11 Mon Sep 17 00:00:00 2001 From: Yuanle Song Date: Wed, 13 May 2020 23:36:24 +0800 Subject: [PATCH] v0.8.7 bugfix: do not rewrite KEY URI if it is already a local file path. --- README.rst | 4 ++++ m3u8downloader/__init__.py | 2 +- m3u8downloader/main.py | 4 ++++ operational | 5 ++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index d54971c..367378e 100644 --- a/README.rst +++ b/README.rst @@ -79,6 +79,10 @@ added to the HLS spec which this tool isn't aware of. ChangeLog --------- +* v0.8.7 + + - bugfix: do not rewrite KEY URI if it is already a local file path. + * v0.8.6 - fix a regression in v0.8.4. the v0.8.4 release should be avoided. Either diff --git a/m3u8downloader/__init__.py b/m3u8downloader/__init__.py index de77196..686e10f 100644 --- a/m3u8downloader/__init__.py +++ b/m3u8downloader/__init__.py @@ -1 +1 @@ -__version__ = "0.8.6" +__version__ = "0.8.7" diff --git a/m3u8downloader/main.py b/m3u8downloader/main.py index 40e9111..aacadb2 100644 --- a/m3u8downloader/main.py +++ b/m3u8downloader/main.py @@ -152,6 +152,10 @@ def rewrite_key_uri(tempdir, m3u8_url, key_line): uri = mo.group(2) suffix = mo.group(3) + if uri and uri.startswith(tempdir): + # already using local file path in uri. + return key_line + url = urljoin(m3u8_url, uri) local_key_file = get_local_file_for_url(tempdir, url, key_line) if re.match('^.:\\\\', local_key_file): diff --git a/operational b/operational index f749015..60a8304 100644 --- a/operational +++ b/operational @@ -1,6 +1,6 @@ * COMMENT -*- mode: org -*- #+Date: 2019-03-02 -Time-stamp: <2020-05-08> +Time-stamp: <2020-05-13> #+STARTUP: content * notes :entry: ** 2020-05-08 how to distribute pkg on pypi? :doc: @@ -45,6 +45,9 @@ to handle it on ryzen5. * current :entry: ** +** 2020-05-13 bug: key URI may be rewritten twice. +rewrite_key_uri() + ** 2020-05-08 add travis CI for this project. - add travis CI to run unit tests on linux and windows. - add badge in README.rst -- GitLab