]> Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/trollvids.py
Prepare to upload.
[youtubedl] / youtube_dl / extractor / trollvids.py
1 # encoding: utf-8
2 from __future__ import unicode_literals
3
4 import re
5
6 from .nuevo import NuevoBaseIE
7
8
9 class TrollvidsIE(NuevoBaseIE):
10 _VALID_URL = r'http://(?:www\.)?trollvids\.com/video/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
11 IE_NAME = 'trollvids'
12 _TEST = {
13 'url': 'http://trollvids.com/video/2349002/%E3%80%90MMD-R-18%E3%80%91%E3%82%AC%E3%83%BC%E3%83%AB%E3%83%95%E3%83%AC%E3%83%B3%E3%83%89-carrymeoff',
14 'md5': '1d53866b2c514b23ed69e4352fdc9839',
15 'info_dict': {
16 'id': '2349002',
17 'ext': 'mp4',
18 'title': '【MMD R-18】ガールフレンド carry_me_off',
19 'age_limit': 18,
20 'duration': 216.78,
21 },
22 }
23
24 def _real_extract(self, url):
25 mobj = re.match(self._VALID_URL, url)
26 video_id = mobj.group('id')
27 display_id = mobj.group('display_id')
28
29 info = self._extract_nuevo(
30 'http://trollvids.com/nuevo/player/config.php?v=%s' % video_id,
31 video_id)
32 info.update({
33 'display_id': display_id,
34 'age_limit': 18
35 })
36 return info