mirror of https://github.com/yt-dlp/yt-dlp
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
Python
42 lines
1.3 KiB
Python
12 years ago
|
from .common import InfoExtractor
|
||
9 years ago
|
from ..utils import parse_iso8601
|
||
12 years ago
|
|
||
|
|
||
|
class HowcastIE(InfoExtractor):
|
||
11 years ago
|
_VALID_URL = r'https?://(?:www\.)?howcast\.com/videos/(?P<id>\d+)'
|
||
12 years ago
|
_TEST = {
|
||
11 years ago
|
'url': 'http://www.howcast.com/videos/390161-How-to-Tie-a-Square-Knot-Properly',
|
||
9 years ago
|
'md5': '7d45932269a288149483144f01b99789',
|
||
11 years ago
|
'info_dict': {
|
||
|
'id': '390161',
|
||
|
'ext': 'mp4',
|
||
|
'title': 'How to Tie a Square Knot Properly',
|
||
9 years ago
|
'description': 'md5:dbe792e5f6f1489027027bf2eba188a3',
|
||
|
'timestamp': 1276081287,
|
||
|
'upload_date': '20100609',
|
||
9 years ago
|
'duration': 56.823,
|
||
9 years ago
|
},
|
||
9 years ago
|
'params': {
|
||
|
'skip_download': True,
|
||
|
},
|
||
9 years ago
|
'add_ie': ['Ooyala'],
|
||
12 years ago
|
}
|
||
12 years ago
|
|
||
|
def _real_extract(self, url):
|
||
9 years ago
|
video_id = self._match_id(url)
|
||
12 years ago
|
|
||
11 years ago
|
webpage = self._download_webpage(url, video_id)
|
||
12 years ago
|
|
||
9 years ago
|
embed_code = self._search_regex(
|
||
|
r'<iframe[^>]+src="[^"]+\bembed_code=([^\b]+)\b',
|
||
|
webpage, 'ooyala embed code')
|
||
12 years ago
|
|
||
11 years ago
|
return {
|
||
9 years ago
|
'_type': 'url_transparent',
|
||
|
'ie_key': 'Ooyala',
|
||
|
'url': 'ooyala:%s' % embed_code,
|
||
11 years ago
|
'id': video_id,
|
||
9 years ago
|
'timestamp': parse_iso8601(self._html_search_meta(
|
||
|
'article:published_time', webpage, 'timestamp')),
|
||
11 years ago
|
}
|