From 8da531359e8dc5299b438195ac75c30100ae05df Mon Sep 17 00:00:00 2001 From: sahutd Date: Sat, 18 Jan 2014 20:45:53 +0530 Subject: [PATCH 1/4] Added dropbox support. issue #2055 --- youtube_dl/extractor/dropbox.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 youtube_dl/extractor/dropbox.py diff --git a/youtube_dl/extractor/dropbox.py b/youtube_dl/extractor/dropbox.py new file mode 100644 index 000000000..0df025cd3 --- /dev/null +++ b/youtube_dl/extractor/dropbox.py @@ -0,0 +1,33 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor + +class DropBoxIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?dropbox.com/s/(?P[a-zA-Z0-9]{15})/(?P.*)' + _TEST = { + 'url': 'https://www.dropbox.com/s/mcnzehi9wo55th4/20131219_085616.mp4', + 'file': '20131219_085616.mp4', + 'md5': '2cec58eb277054eca0dbaaf3bdc72564', + + } + + + def _real_extract(self,url): + mobj = re.match(self._VALID_URL, url) + video_id=mobj.group('id') + title=mobj.group('title') + webpage = self._download_webpage(url, video_id) + video_url=url+'?dl=1' + return{ + 'id':video_id, + 'title':title, + 'formats': [{ + 'url': video_url, + 'vcodec': 'none', + }] + + } + \ No newline at end of file From f2ffd10bb202ba4bb1111a86901a0f8d1f225998 Mon Sep 17 00:00:00 2001 From: sahutd <sahutd@users.noreply.github.com> Date: Sat, 18 Jan 2014 20:48:43 +0530 Subject: [PATCH 2/4] Update __init__.py --- youtube_dl/extractor/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index d66f7b026..81c06b586 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -47,6 +47,7 @@ from .dotsub import DotsubIE from .dreisat import DreiSatIE from .defense import DefenseGouvFrIE +from .dropbox import DropBoxIE from .ebaumsworld import EbaumsWorldIE from .ehow import EHowIE from .eighttracks import EightTracksIE From 2a7c35dd46ad90872feb2ca1baf85f226624cc4c Mon Sep 17 00:00:00 2001 From: sahutd <sahutd@gmail.com> Date: Sat, 18 Jan 2014 20:50:42 +0530 Subject: [PATCH 3/4] added dropbox support --- youtube_dl/extractor/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index d66f7b026..81c06b586 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -47,6 +47,7 @@ from .dotsub import DotsubIE from .dreisat import DreiSatIE from .defense import DefenseGouvFrIE +from .dropbox import DropBoxIE from .ebaumsworld import EbaumsWorldIE from .ehow import EHowIE from .eighttracks import EightTracksIE From 6b79f40c3d37d33ac944241e205df8c5c4bbabca Mon Sep 17 00:00:00 2001 From: sahutd <sahutd@gmail.com> Date: Sun, 19 Jan 2014 10:20:26 +0530 Subject: [PATCH 4/4] Added support for Dropbox --- youtube_dl/extractor/__init__.py | 2 +- youtube_dl/extractor/dropbox.py | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 81c06b586..5605e917b 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -47,7 +47,7 @@ from .dotsub import DotsubIE from .dreisat import DreiSatIE from .defense import DefenseGouvFrIE -from .dropbox import DropBoxIE +from .dropbox import DropboxIE from .ebaumsworld import EbaumsWorldIE from .ehow import EHowIE from .eighttracks import EightTracksIE diff --git a/youtube_dl/extractor/dropbox.py b/youtube_dl/extractor/dropbox.py index 0df025cd3..e4d60d17a 100644 --- a/youtube_dl/extractor/dropbox.py +++ b/youtube_dl/extractor/dropbox.py @@ -5,13 +5,15 @@ from .common import InfoExtractor -class DropBoxIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?dropbox.com/s/(?P<id>[a-zA-Z0-9]{15})/(?P<title>.*)' +class DropboxIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?dropbox[.]com/s/(?P<id>[a-zA-Z0-9]{15})/(?P<title>[^?#]*)' _TEST = { - 'url': 'https://www.dropbox.com/s/mcnzehi9wo55th4/20131219_085616.mp4', - 'file': '20131219_085616.mp4', - 'md5': '2cec58eb277054eca0dbaaf3bdc72564', - + u'url': u'https://www.dropbox.com/s/mcnzehi9wo55th4/20131219_085616.mp4', + u'file': u'mcnzehi9wo55th4.mp4', + u'md5': u'2cec58eb277054eca0dbaaf3bdc72564', + u'info_dict': { + u'title': '20131219_085616' + } } @@ -24,10 +26,7 @@ def _real_extract(self,url): return{ 'id':video_id, 'title':title, - 'formats': [{ - 'url': video_url, - 'vcodec': 'none', - }] + 'url':video_url } \ No newline at end of file