diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-03-16 21:50:04 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-03-16 21:50:04 +0600 |
commit | c5229f3926d64bce101d328fc5acf25bda83e0d8 (patch) | |
tree | 2f27d4f3fb57a8eaeee8966cb182ff60a66d8713 /youtube_dl/utils.py | |
parent | 96f4f796fb02e3ef13fa6584b8f77ebafaabf59f (diff) |
[utils] PEP 8
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index ec186918c..8ec1bd469 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -273,15 +273,17 @@ def get_element_by_attribute(attribute, value, html): return unescapeHTML(res) + class HTMLAttributeParser(compat_HTMLParser): """Trivial HTML parser to gather the attributes for a single element""" def __init__(self): - self.attrs = { } + self.attrs = {} compat_HTMLParser.__init__(self) def handle_starttag(self, tag, attrs): self.attrs = dict(attrs) + def extract_attributes(html_element): """Given a string for an HTML element such as <el @@ -303,6 +305,7 @@ def extract_attributes(html_element): parser.close() return parser.attrs + def clean_html(html): """Clean an HTML snippet into a readable string""" |