Merge remote-tracking branch 'sahutd/master'
[youtube-dl] / youtube_dl / extractor / dropbox.py
1 # coding: utf-8
2 from __future__ import unicode_literals
3
4 import re
5
6 from .common import InfoExtractor
7
8 class DropboxIE(InfoExtractor):
9     _VALID_URL = r'https?://(?:www\.)?dropbox[.]com/s/(?P<id>[a-zA-Z0-9]{15})/(?P<title>[^?#]*)'
10     _TEST = {
11         u'url': u'https://www.dropbox.com/s/mcnzehi9wo55th4/20131219_085616.mp4',
12         u'file': u'mcnzehi9wo55th4.mp4',
13         u'md5': u'2cec58eb277054eca0dbaaf3bdc72564',
14         u'info_dict': {
15             u'title': '20131219_085616'
16         }
17     }
18     
19     
20     def _real_extract(self,url):
21         mobj = re.match(self._VALID_URL, url)
22         video_id=mobj.group('id')
23         title=mobj.group('title')
24         webpage = self._download_webpage(url, video_id)
25         video_url=url+'?dl=1'
26         return{
27                'id':video_id,
28                'title':title,
29                'url':video_url
30                
31                }
32