projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e7ddaef
)
[safari] Use raise_login_required
author
Sergey M․
<dstftw@gmail.com>
Wed, 26 Aug 2015 15:26:24 +0000
(21:26 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 26 Aug 2015 15:26:24 +0000
(21:26 +0600)
youtube_dl/extractor/safari.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/safari.py
b/youtube_dl/extractor/safari.py
index f3c80708c86ab2fc29fbd029b245bbe894af2dfb..a602af6928d2a9d054fc8670342a6ddf7d9ef4da 100644
(file)
--- a/
youtube_dl/extractor/safari.py
+++ b/
youtube_dl/extractor/safari.py
@@
-20,7
+20,6
@@
from ..utils import (
class SafariBaseIE(InfoExtractor):
_LOGIN_URL = 'https://www.safaribooksonline.com/accounts/login/'
_SUCCESSFUL_LOGIN_REGEX = r'<a href="/accounts/logout/"[^>]*>Sign Out</a>'
class SafariBaseIE(InfoExtractor):
_LOGIN_URL = 'https://www.safaribooksonline.com/accounts/login/'
_SUCCESSFUL_LOGIN_REGEX = r'<a href="/accounts/logout/"[^>]*>Sign Out</a>'
- _ACCOUNT_CREDENTIALS_HINT = 'Use --username and --password options to supply credentials for safaribooksonline.com'
_NETRC_MACHINE = 'safari'
_API_BASE = 'https://www.safaribooksonline.com/api/v1/book'
_NETRC_MACHINE = 'safari'
_API_BASE = 'https://www.safaribooksonline.com/api/v1/book'
@@
-37,9
+36,7
@@
class SafariBaseIE(InfoExtractor):
def _login(self):
(username, password) = self._get_login_info()
if username is None:
def _login(self):
(username, password) = self._get_login_info()
if username is None:
- raise ExtractorError(
- self._ACCOUNT_CREDENTIALS_HINT,
- expected=True)
+ self.raise_login_required('safaribooksonline.com account is required')
headers = std_headers
if 'Referer' not in headers:
headers = std_headers
if 'Referer' not in headers: