Merge remote-tracking branch 'lenaten/8tracks'
[youtube-dl] / youtube_dl / utils.py
index 29739a4833de0a782b359d958d331316cbaf1c24..079e8d2c3f5168b3f0af233f3a5377f15e5a46f3 100644 (file)
@@ -205,6 +205,10 @@ def get_element_by_attribute(attribute, value, html):
 
 def clean_html(html):
     """Clean an HTML snippet into a readable string"""
+
+    if html is None:  # Convenience for sanitizing descriptions etc.
+        return html
+
     # Newline vs <br />
     html = html.replace('\n', ' ')
     html = re.sub(r'\s*<\s*br\s*/?\s*>\s*', '\n', html)