]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/dropbox.py
Prepare for release.
[youtubedl] / youtube_dl / extractor / dropbox.py
1 # coding: utf-8
2 from __future__ import unicode_literals
3
4 import os.path
5 import re
6
7 from .common import InfoExtractor
8
9
10 class DropboxIE(InfoExtractor):
11 _VALID_URL = r'https?://(?:www\.)?dropbox[.]com/s/(?P<id>[a-zA-Z0-9]{15})/(?P<title>[^?#]*)'
12 _TEST = {
13 'url': 'https://www.dropbox.com/s/0qr9sai2veej4f8/THE_DOCTOR_GAMES.mp4',
14 'md5': '8ae17c51172fb7f93bdd6a214cc8c896',
15 'info_dict': {
16 'id': '0qr9sai2veej4f8',
17 'ext': 'mp4',
18 'title': 'THE_DOCTOR_GAMES'
19 }
20 }
21
22 def _real_extract(self, url):
23 mobj = re.match(self._VALID_URL, url)
24 video_id = mobj.group('id')
25 title = os.path.splitext(mobj.group('title'))[0]
26 video_url = url + '?dl=1'
27
28 return {
29 'id': video_id,
30 'title': title,
31 'url': video_url,
32 }