Merge pull request #6554 from reddraggone9/readme-line-numbers
authorSergey M. <dstftw@gmail.com>
Fri, 14 Aug 2015 16:15:13 +0000 (22:15 +0600)
committerSergey M. <dstftw@gmail.com>
Fri, 14 Aug 2015 16:15:13 +0000 (22:15 +0600)
Updated line numbers in the fragment portion of README links.

README.md
youtube_dl/extractor/lynda.py

index e91119d847422db9869b5f54f70d587a94d1a557..e52cdb94159173c89bec6a11d6e3d506a0f9b45a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -272,6 +272,7 @@ The `-o` option allows users to indicate a template for the output file names. T
  - `autonumber`: The sequence will be replaced by a five-digit number that will be increased with each download, starting at zero.
  - `playlist`: The name or the id of the playlist that contains the video.
  - `playlist_index`: The index of the video in the playlist, a five-digit number.
+ - `format_id`: The sequence will be replaced by the format code specified by `--format`.
 
 The current default template is `%(title)s-%(id)s.%(ext)s`.
 
index deead220af21bd5e37deab93446dc9e9cac59ba8..5b9157ed43efb0169baac327ce37ec7d46eb69f5 100644 (file)
@@ -11,6 +11,7 @@ from ..compat import (
 )
 from ..utils import (
     ExtractorError,
+    clean_html,
     int_or_none,
 )
 
@@ -70,6 +71,15 @@ class LyndaBaseIE(InfoExtractor):
                     'Confirming log in and log out from another device')
 
         if all(not re.search(p, login_page) for p in ('isLoggedIn\s*:\s*true', r'logout\.aspx', r'>Log out<')):
+            if 'login error' in login_page:
+                mobj = re.search(
+                    r'(?s)<h1[^>]+class="topmost">(?P<title>[^<]+)</h1>\s*<div>(?P<description>.+?)</div>',
+                    login_page)
+                if mobj:
+                    raise ExtractorError(
+                        'lynda returned error: %s - %s'
+                        % (mobj.group('title'), clean_html(mobj.group('description'))),
+                        expected=True)
             raise ExtractorError('Unable to log in')