Repository: ytdl-org/youtube-dl

Issue:
 http://www.jove.com/video
~$ youtube-dl --verbose http://www.jove.com/video/2744/electrode-positioning-montage-transcranial-direct-current
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.jove.com/video/2744/electrode-positioning-montage-transcranial-direct-current']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.06.26
[debug] Python version 2.7.6 - Linux-3.13.0-30-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] Proxy map: {}
[generic] electrode-positioning-montage-transcranial-direct-current: Requesting header
WARNING: Falling back on generic information extractor.
[generic] electrode-positioning-montage-transcranial-direct-current: Downloading webpage
[generic] electrode-positioning-montage-transcranial-direct-current: Extracting information
ERROR: Unsupported URL: http://www.jove.com/video/2744/electrode-positioning-montage-transcranial-direct-current; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/generic.py", line 451, in _real_extract
    doc = parse_xml(webpage)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/utils.py", line 1406, in parse_xml
    return xml.etree.ElementTree.XML(s.encode('utf-8'), **kwargs)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1300, in XML
    parser.feed(text)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1642, in feed
    self._raiseerror(v)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
    raise err
ParseError: syntax error: line 1, column 0
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 516, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 167, in extract
    return self._real_extract(url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/generic.py", line 741, in _real_extract
    raise ExtractorError('Unsupported URL: %s' % url)
ExtractorError: Unsupported URL: http://www.jove.com/video/2744/electrode-positioning-montage-transcranial-direct-current; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.



Discussion:

Resolving patch:
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -144,6 +144,7 @@
 from .izlesene import IzleseneIE
 from .jadorecettepub import JadoreCettePubIE
 from .jeuxvideo import JeuxVideoIE
+from .jove import JoveIE
 from .jukebox import JukeboxIE
 from .justintv import JustinTVIE
 from .jpopsukitv import JpopsukiIE
diff --git a/youtube_dl/extractor/jove.py b/youtube_dl/extractor/jove.py
new file mode 100644
--- /dev/null
+++ b/youtube_dl/extractor/jove.py
@@ -0,0 +1,64 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import re
+from datetime import datetime
+
+from .common import InfoExtractor
+from ..utils import determine_ext, ExtractorError
+
+
+class JoveIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?jove\.com/video/(?P<id>[0-9]+)'
+    _CHAPTERS_URL = 'http://www.jove.com/video-chapters?videoid={video_id:}'
+    _TEST = {
+        'url': 'http://www.jove.com/video/2744/electrode-positioning-montage-transcranial-direct-current',
+        'md5': '93723888d82dbd6ba8b3d7d0cd65dd2b',
+        'info_dict': {
+            'id': '2744',
+            'ext': 'mp4',
+            'title': 'Electrode Positioning and Montage in Transcranial Direct Current Stimulation',
+            'description': 'Transcranial direct current stimulation (tDCS) is an established technique to modulate cortical excitability1,2. It has been ...',
+            'thumbnail': 're:^https?://.*\.png$',
+            'upload_date': '20110523',
+        }
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group('id')
+
+        webpage = self._download_webpage(url, video_id)
+        title = self._html_search_meta('citation_title', webpage, 'title')
+        thumbnail = self._og_search_thumbnail(webpage)
+        description = self._html_search_meta(
+            'description', webpage, 'description', fatal=False)
+        publish_date = self._html_search_meta(
+            'citation_publication_date', webpage, 'publish date', fatal=False)
+        if publish_date:
+            publish_date = datetime.strptime(publish_date,
+                                             '%Y/%m/%d').strftime('%Y%m%d')
+
+        # Not the same as video_id.
+        chapters_id = self._html_search_regex(
+            r'/video-chapters\?videoid=([0-9]+)', webpage, 'chapters id')
+        chapters_xml = self._download_xml(
+            self._CHAPTERS_URL.format(video_id=chapters_id),
+            video_id, note='Downloading chapter XML',
+            errnote='Failed to download chapter XML'
+        )
+        video_url = chapters_xml.attrib.get('video')
+        if not video_url:
+            raise ExtractorError('Failed to get the video URL')
+
+        ext = determine_ext(video_url)
+
+        return {
+            'id': video_id,
+            'title': title,
+            'url': video_url,
+            'ext': ext,
+            'thumbnail': thumbnail,
+            'description': description,
+            'upload_date': publish_date,
+        }


Test patch: