]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/groupon.py
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
6 class GrouponIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?groupon\.com/deals/(?P<id>[^/?#&]+)'
10 'url': 'https://www.groupon.com/deals/bikram-yoga-huntington-beach-2#ooid=tubGNycTo_9Uxg82uESj4i61EYX8nyuf',
12 'id': 'bikram-yoga-huntington-beach-2',
13 'title': '$49 for 10 Yoga Classes or One Month of Unlimited Classes at Bikram Yoga Huntington Beach ($180 Value)',
14 'description': 'Studio kept at 105 degrees and 40% humidity with anti-microbial and anti-slip Flotex flooring; certified instructors',
20 'title': 'Bikram Yoga Huntington Beach | Orange County !tubGNycTo@9Uxg82uESj4i61EYX8nyuf',
21 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
23 'upload_date': '20160405',
24 'uploader_id': 'groupon',
25 'uploader': 'Groupon',
29 'skip_download': True,
34 'ooyala': ('ooyala:%s', 'Ooyala'),
35 'youtube': ('%s', 'Youtube'),
38 def _real_extract(self
, url
):
39 playlist_id
= self
._match
_id
(url
)
40 webpage
= self
._download
_webpage
(url
, playlist_id
)
42 payload
= self
._parse
_json
(self
._search
_regex
(
43 r
'(?:var\s+|window\.)payload\s*=\s*(.*?);\n', webpage
, 'payload'), playlist_id
)
44 videos
= payload
['carousel'].get('dealVideos', [])
47 provider
= v
.get('provider')
48 video_id
= v
.get('media') or v
.get('id') or v
.get('baseURL')
49 if not provider
or not video_id
:
51 url_pattern
, ie_key
= self
._PROVIDERS
.get(provider
.lower())
54 '%s: Unsupported video provider %s, skipping video' %
55 (playlist_id
, provider
))
57 entries
.append(self
.url_result(url_pattern
% video_id
, ie_key
))
63 'title': self
._og
_search
_title
(webpage
),
64 'description': self
._og
_search
_description
(webpage
),