aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-08-26 21:24:47 +0600
committerSergey M․ <dstftw@gmail.com>2015-08-26 21:24:47 +0600
commit43e7d3c9453338ae29552311b1447fe95be05db5 (patch)
treeb4a78504c4252b4409420915f40da7186f6157df
parent2f72e83bbd915054cac0e8f70df0c2cab4b9c116 (diff)
downloadyoutube-dl-43e7d3c9453338ae29552311b1447fe95be05db5.tar.xz
[extractor/common] Add raise_login_required
-rw-r--r--youtube_dl/extractor/common.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 5d24bcb6a..39cef9c5b 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -510,6 +510,12 @@ class InfoExtractor(object):
"""Report attempt to log in."""
self.to_screen('Logging in')
+ @staticmethod
+ def raise_login_required(msg='This video is only available for registered users'):
+ raise ExtractorError(
+ '%s. Use --username and --password or --netrc to provide account credentials.' % msg,
+ expected=True)
+
# Methods for following #608
@staticmethod
def url_result(url, ie=None, video_id=None, video_title=None):