]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/macgamestore.py
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
4 from ..utils
import ExtractorError
7 class MacGameStoreIE(InfoExtractor
):
8 IE_NAME
= 'macgamestore'
9 IE_DESC
= 'MacGameStore trailers'
10 _VALID_URL
= r
'https?://www\.macgamestore\.com/mediaviewer\.php\?trailer=(?P<id>\d+)'
13 'url': 'http://www.macgamestore.com/mediaviewer.php?trailer=2450',
14 'md5': '8649b8ea684b6666b4c5be736ecddc61',
22 def _real_extract(self
, url
):
23 video_id
= self
._match
_id
(url
)
24 webpage
= self
._download
_webpage
(
25 url
, video_id
, 'Downloading trailer page')
27 if '>Missing Media<' in webpage
:
29 'Trailer %s does not exist' % video_id
, expected
=True)
31 video_title
= self
._html
_search
_regex
(
32 r
'<title>MacGameStore: (.*?) Trailer</title>', webpage
, 'title')
34 video_url
= self
._html
_search
_regex
(
35 r
'(?s)<div\s+id="video-player".*?href="([^"]+)"\s*>',