]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/howcast.py
16677f179ecd77040e8fdc42bfb9e4095aa1774a
   1 from __future__ 
import unicode_literals
 
   3 from .common 
import InfoExtractor
 
   4 from ..utils 
import parse_iso8601
 
   7 class HowcastIE(InfoExtractor
): 
   8     _VALID_URL 
= r
'https?://(?:www\.)?howcast\.com/videos/(?P<id>\d+)' 
  10         'url': 'http://www.howcast.com/videos/390161-How-to-Tie-a-Square-Knot-Properly', 
  11         'md5': '8b743df908c42f60cf6496586c7f12c3', 
  15             'title': 'How to Tie a Square Knot Properly', 
  16             'description': 'md5:dbe792e5f6f1489027027bf2eba188a3', 
  17             'timestamp': 1276081287, 
  18             'upload_date': '20100609', 
  22             'skip_download': True, 
  26     def _real_extract(self
, url
): 
  27         video_id 
= self
._match
_id
(url
) 
  29         webpage 
= self
._download
_webpage
(url
, video_id
) 
  31         embed_code 
= self
._search
_regex
( 
  32             r
'<iframe[^>]+src="[^"]+\bembed_code=([^\b]+)\b', 
  33             webpage
, 'ooyala embed code') 
  36             '_type': 'url_transparent', 
  38             'url': 'ooyala:%s' % embed_code
, 
  40             'timestamp': parse_iso8601(self
._html
_search
_meta
( 
  41                 'article:published_time', webpage
, 'timestamp')),