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.

32 lines
935 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. 'url': 'https://www.dropbox.com/s/mcnzehi9wo55th4/20131219_085616.mp4',
  9. 'file': '20131219_085616.mp4',
  10. 'md5': '2cec58eb277054eca0dbaaf3bdc72564',
  11. }
  12. def _real_extract(self,url):
  13. mobj = re.match(self._VALID_URL, url)
  14. video_id=mobj.group('id')
  15. title=mobj.group('title')
  16. webpage = self._download_webpage(url, video_id)
  17. video_url=url+'?dl=1'
  18. return{
  19. 'id':video_id,
  20. 'title':title,
  21. 'formats': [{
  22. 'url': video_url,
  23. 'vcodec': 'none',
  24. }]
  25. }