2 from __future__ import unicode_literals
7 from .common import InfoExtractor
8 from ..utils import compat_urllib_parse_unquote
11 class DropboxIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?dropbox[.]com/s/(?P<id>[a-zA-Z0-9]{15})/(?P<title>[^?#]*)'
14 'url': 'https://www.dropbox.com/s/nelirfsxnmcfbfh/youtube-dl%20test%20video%20%27%C3%A4%22BaW_jenozKc.mp4?dl=0',
16 'id': 'nelirfsxnmcfbfh',
18 'title': 'youtube-dl test video \'รค"BaW_jenozKc'
22 def _real_extract(self, url):
23 mobj = re.match(self._VALID_URL, url)
24 video_id = mobj.group('id')
25 fn = compat_urllib_parse_unquote(mobj.group('title'))
26 title = os.path.splitext(fn)[0]
28 re.sub(r'[?&]dl=0', '', url) +
29 ('?' if '?' in url else '&') + 'dl=1')