]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/thisoldhouse.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
7 class ThisOldHouseIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?thisoldhouse\.com/(?:watch|how-to|tv-episode)/(?P<id>[^/?#]+)'
10 'url': 'https://www.thisoldhouse.com/how-to/how-to-build-storage-bench',
11 'md5': '946f05bbaa12a33f9ae35580d2dfcfe3',
15 'title': 'How to Build a Storage Bench',
16 'description': 'In the workshop, Tom Silva and Kevin O\'Connor build a storage bench for an entryway.',
17 'timestamp': 1442548800,
18 'upload_date': '20150918',
21 'url': 'https://www.thisoldhouse.com/watch/arlington-arts-crafts-arts-and-crafts-class-begins',
22 'only_matching': True,
24 'url': 'https://www.thisoldhouse.com/tv-episode/ask-toh-shelf-rough-electric',
25 'only_matching': True,
28 def _real_extract(self
, url
):
29 display_id
= self
._match
_id
(url
)
30 webpage
= self
._download
_webpage
(url
, display_id
)
31 drupal_settings
= self
._parse
_json
(self
._search
_regex
(
32 r
'jQuery\.extend\(Drupal\.settings\s*,\s*({.+?})\);',
33 webpage
, 'drupal settings'), display_id
)
34 video_id
= drupal_settings
['jwplatform']['video_id']
35 return self
.url_result('jwplatform:' + video_id
, 'JWPlatform', video_id
)