aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/theplatform.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2017-02-17 23:13:51 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2017-02-17 23:13:51 +0800
commitfef51645d6c224f898ff6f44d041a458d21e8547 (patch)
tree0acf97ee5884fac9ddceffcaf178bdcf3aa5581b /youtube_dl/extractor/theplatform.py
parent4cead6a614b5a293e78dce5cd5eda7476f83985d (diff)
[theplatform] Recognize URLs with whitespaces (closes #12044)
Diffstat (limited to 'youtube_dl/extractor/theplatform.py')
-rw-r--r--youtube_dl/extractor/theplatform.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/theplatform.py b/youtube_dl/extractor/theplatform.py
index 5c5987c6a..9a424b1c6 100644
--- a/youtube_dl/extractor/theplatform.py
+++ b/youtube_dl/extractor/theplatform.py
@@ -179,10 +179,12 @@ class ThePlatformIE(ThePlatformBaseIE, AdobePassIE):
if m:
return [m.group('url')]
+ # Are whitesapces ignored in URLs?
+ # https://github.com/rg3/youtube-dl/issues/12044
matches = re.findall(
- r'<(?:iframe|script)[^>]+src=(["\'])((?:https?:)?//player\.theplatform\.com/p/.+?)\1', webpage)
+ r'(?s)<(?:iframe|script)[^>]+src=(["\'])((?:https?:)?//player\.theplatform\.com/p/.+?)\1', webpage)
if matches:
- return list(zip(*matches))[1]
+ return [re.sub(r'\s', '', list(zip(*matches))[1][0])]
@staticmethod
def _sign_url(url, sig_key, sig_secret, life=600, include_qs=False):