aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/camdemy.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-02-12 00:11:33 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-02-12 00:11:33 +0800
commit8367d3f3cbad7ddae5116c3cd5d39ebfed9711c5 (patch)
tree9473c882a174e5993ac27f1861c0a61b1c35f0e8 /youtube_dl/extractor/camdemy.py
parent8708d764252a83e650f36fe47f89ace4f2a91a5b (diff)
[camdemy] Detection of external sources
Diffstat (limited to 'youtube_dl/extractor/camdemy.py')
-rw-r--r--youtube_dl/extractor/camdemy.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/youtube_dl/extractor/camdemy.py b/youtube_dl/extractor/camdemy.py
index 54959f2cf..9a6341f0f 100644
--- a/youtube_dl/extractor/camdemy.py
+++ b/youtube_dl/extractor/camdemy.py
@@ -38,6 +38,19 @@ class CamdemyIE(InfoExtractor):
'upload_date': '20140620',
'timestamp': 1403271569,
}
+ }, {
+ # External source
+ 'url': 'http://www.camdemy.com/media/14842',
+ 'md5': '50e1c3c3aa233d3d7b7daa2fa10b1cf7',
+ 'info_dict': {
+ 'id': '2vsYQzNIsJo',
+ 'ext': 'mp4',
+ 'upload_date': '20130211',
+ 'uploader': 'Hun Kim',
+ 'description': 'Excel 2013 Tutorial for Beginners - How to add Password Protection',
+ 'uploader_id': 'hunkimtutorials',
+ 'title': 'Excel 2013 Tutorial - How to add Password Protection',
+ }
}]
def _real_extract(self, url):
@@ -45,6 +58,13 @@ class CamdemyIE(InfoExtractor):
page = self._download_webpage(url, video_id)
+ srcFrom = self._html_search_regex(
+ r"<div class='srcFrom'>Source: <a title='([^']+)'", page,
+ 'external source', default=None)
+
+ if srcFrom:
+ return self.url_result(srcFrom)
+
oembed_obj = self._download_json(
'http://www.camdemy.com/oembed/?format=json&url=' + url, video_id)