]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[animeondemand] Relax login error regex
authorSergey M․ <dstftw@gmail.com>
Tue, 19 Dec 2017 15:53:04 +0000 (22:53 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 19 Dec 2017 15:53:04 +0000 (22:53 +0700)
youtube_dl/extractor/animeondemand.py

index 34c2b363ea3fbb69765be83b57244913e48c85c5..be032d5b42a22d18c2e0fa2d2c43c258f4e18fd6 100644 (file)
@@ -85,8 +85,8 @@ class AnimeOnDemandIE(InfoExtractor):
 
         if all(p not in response for p in ('>Logout<', 'href="/users/sign_out"')):
             error = self._search_regex(
-                r'<p class="alert alert-danger">(.+?)</p>',
-                response, 'error', default=None)
+                r'<p[^>]+\bclass=(["\'])(?:(?!\1).)*\balert\s(?:(?!\1).)*\1[^>]*>(?P<error>.+?)</p>',
+                response, 'error', default=None, group='error')
             if error:
                 raise ExtractorError('Unable to login: %s' % error, expected=True)
             raise ExtractorError('Unable to log in')