You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
893 B

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