summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-10-05 02:27:14 +0700
committerSergey M․ <dstftw@gmail.com>2018-10-05 02:27:14 +0700
commit21c1a00dd7dbb9f7551ca9809a194f6380dee7a5 (patch)
treea7bebbcace37303693f4439e408f95983bbf5f69
parent0082f44a08e33712fcd33ceabab15215c962eaac (diff)
downloadyoutube-dl-21c1a00dd7dbb9f7551ca9809a194f6380dee7a5.tar.gz
youtube-dl-21c1a00dd7dbb9f7551ca9809a194f6380dee7a5.tar.xz
youtube-dl-21c1a00dd7dbb9f7551ca9809a194f6380dee7a5.zip
[pluralsight] Improve authentication (closes #17762)
-rw-r--r--youtube_dl/extractor/pluralsight.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/youtube_dl/extractor/pluralsight.py b/youtube_dl/extractor/pluralsight.py
index daf172570..eafe56897 100644
--- a/youtube_dl/extractor/pluralsight.py
+++ b/youtube_dl/extractor/pluralsight.py
@@ -4,6 +4,7 @@ import collections
 import json
 import os
 import random
+import re
 
 from .common import InfoExtractor
 from ..compat import (
@@ -196,7 +197,10 @@ query viewClip {
         if error:
             raise ExtractorError('Unable to login: %s' % error, expected=True)
 
-        if all(p not in response for p in ('__INITIAL_STATE__', '"currentUser"')):
+        if all(not re.search(p, response) for p in (
+                r'__INITIAL_STATE__', r'["\']currentUser["\']',
+                # new layout?
+                r'>\s*Sign out\s*<')):
             BLOCKED = 'Your account has been blocked due to suspicious activity'
             if BLOCKED in response:
                 raise ExtractorError(