about summary refs log tree commit diff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorTithen-Firion <tithen.firion.0@gmail.com>2017-04-28 17:34:27 +0200
committerTithen-Firion <tithen.firion.0@gmail.com>2017-04-28 17:34:27 +0200
commitedd9221cd22614b9d06f52b16bad278201fabd01 (patch)
treeb11abb5899ae457bfc48fdf0e40e945f099147d5 /youtube_dl/utils.py
parentbc8a2ea07107c65e3561826b066888d450b98391 (diff)
downloadyoutube-dl-edd9221cd22614b9d06f52b16bad278201fabd01.tar.gz
youtube-dl-edd9221cd22614b9d06f52b16bad278201fabd01.tar.xz
youtube-dl-edd9221cd22614b9d06f52b16bad278201fabd01.zip
[utils] Fix inconsistent output of clean_html
`\s` in Python 2.x doesn't match unicode whitespace characters by
default
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 91e235ff2..41bc20544 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -421,8 +421,8 @@ def clean_html(html):
 
     # Newline vs <br />
     html = html.replace('\n', ' ')
-    html = re.sub(r'\s*<\s*br\s*/?\s*>\s*', '\n', html)
-    html = re.sub(r'<\s*/\s*p\s*>\s*<\s*p[^>]*>', '\n', html)
+    html = re.sub(r'(?u)\s*<\s*br\s*/?\s*>\s*', '\n', html)
+    html = re.sub(r'(?u)<\s*/\s*p\s*>\s*<\s*p[^>]*>', '\n', html)
     # Strip html tags
     html = re.sub('<.*?>', '', html)
     # Replace html entities