- webpage, u'thumbnail', fatal=False)
-
- info = {
- 'id': video_id,
- 'url': video_url,
- 'ext': 'flv',
- 'title': video_title,
- 'uploader': uploader,
- 'thumbnail': thumbnail,
- }
- return info
-
-# More robust than regular expressions
-
-class ChannelParser(compat_html_parser.HTMLParser):
- """
- <meta name="ustream:channel_id" content="1234">
- """
- channel_id = None
-
- def handle_starttag(self, tag, attrs):
- if tag != 'meta':
- return
- values = dict(attrs)
- if values.get('name') != 'ustream:channel_id':
- return
- value = values.get('content', '')
- if value.isdigit():
- self.channel_id = value
-
-class SocialstreamParser(compat_html_parser.HTMLParser):
- """
- <li class="content123 video" data-content-id="123" data-length="1452"
- data-href="/recorded/123" data-og-url="/recorded/123">
- """
- def __init__(self):
- compat_html_parser.HTMLParser.__init__(self)
- self.content_ids = []
-
- def handle_starttag(self, tag, attrs):
- if tag != 'li':
- return
- for (attr, value) in attrs:
- if attr == 'data-content-id' and value.isdigit():
- self.content_ids.append(value)
+ webpage, 'thumbnail', fatal=False)
+
+ return {
+ 'id': video_id,
+ 'url': video_url,
+ 'ext': 'flv',
+ 'title': video_title,
+ 'uploader': uploader,
+ 'thumbnail': thumbnail,
+ }
+