aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2018-02-01 11:22:05 +0100
committerRemita Amine <remitamine@gmail.com>2018-02-01 11:22:05 +0100
commit4bf18702e6edb87143cf4a21dd5d96fee0797df9 (patch)
tree52300fe0ec87508731840b41b147f1c86f1bcc0c
parentecc218ab1410694bf7ca1df4aca63e9efee37525 (diff)
[6play] do no modify asset urls with a token(#15248)
-rw-r--r--youtube_dl/extractor/sixplay.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/extractor/sixplay.py b/youtube_dl/extractor/sixplay.py
index 547be8f95..d435f7157 100644
--- a/youtube_dl/extractor/sixplay.py
+++ b/youtube_dl/extractor/sixplay.py
@@ -4,7 +4,11 @@ from __future__ import unicode_literals
import re
from .common import InfoExtractor
-from ..compat import compat_str
+from ..compat import (
+ compat_parse_qs,
+ compat_str,
+ compat_urllib_parse_urlparse,
+)
from ..utils import (
determine_ext,
int_or_none,
@@ -57,7 +61,7 @@ class SixPlayIE(InfoExtractor):
container = asset.get('video_container')
ext = determine_ext(asset_url)
if container == 'm3u8' or ext == 'm3u8':
- if protocol == 'usp':
+ if protocol == 'usp' and not compat_parse_qs(compat_urllib_parse_urlparse(asset_url).query).get('token', [None])[0]:
asset_url = re.sub(r'/([^/]+)\.ism/[^/]*\.m3u8', r'/\1.ism/\1.m3u8', asset_url)
formats.extend(self._extract_m3u8_formats(
asset_url, video_id, 'mp4', 'm3u8_native',