projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[refactor] Do not specify redundant None as second argument in dict.get()
[youtube-dl]
/
youtube_dl
/
extractor
/
vimeo.py
diff --git
a/youtube_dl/extractor/vimeo.py
b/youtube_dl/extractor/vimeo.py
index 2389e7f0f4af5b828f76f17765fa4bcf61b424f8..c7df6b0c5990d06e5a2701c14c98f5209c230c9a 100644
(file)
--- a/
youtube_dl/extractor/vimeo.py
+++ b/
youtube_dl/extractor/vimeo.py
@@
-57,7
+57,7
@@
class VimeoBaseInfoExtractor(InfoExtractor):
def _extract_xsrft_and_vuid(self, webpage):
xsrft = self._search_regex(
def _extract_xsrft_and_vuid(self, webpage):
xsrft = self._search_regex(
- r'
xsrft\s*[=:]
\s*(?P<q>["\'])(?P<xsrft>.+?)(?P=q)',
+ r'
(?:(?P<q1>["\'])xsrft(?P=q1)\s*:|xsrft\s*[=:])
\s*(?P<q>["\'])(?P<xsrft>.+?)(?P=q)',
webpage, 'login token', group='xsrft')
vuid = self._search_regex(
r'["\']vuid["\']\s*:\s*(["\'])(?P<vuid>.+?)\1',
webpage, 'login token', group='xsrft')
vuid = self._search_regex(
r'["\']vuid["\']\s*:\s*(["\'])(?P<vuid>.+?)\1',
@@
-232,7
+232,7
@@
class VimeoIE(VimeoBaseInfoExtractor):
return mobj.group(1)
def _verify_video_password(self, url, video_id, webpage):
return mobj.group(1)
def _verify_video_password(self, url, video_id, webpage):
- password = self._downloader.params.get('videopassword'
, None
)
+ password = self._downloader.params.get('videopassword')
if password is None:
raise ExtractorError('This video is protected by a password, use the --video-password option', expected=True)
token, vuid = self._extract_xsrft_and_vuid(webpage)
if password is None:
raise ExtractorError('This video is protected by a password, use the --video-password option', expected=True)
token, vuid = self._extract_xsrft_and_vuid(webpage)
@@
-252,7
+252,7
@@
class VimeoIE(VimeoBaseInfoExtractor):
'Verifying the password', 'Wrong password')
def _verify_player_video_password(self, url, video_id):
'Verifying the password', 'Wrong password')
def _verify_player_video_password(self, url, video_id):
- password = self._downloader.params.get('videopassword'
, None
)
+ password = self._downloader.params.get('videopassword')
if password is None:
raise ExtractorError('This video is protected by a password, use the --video-password option')
data = urlencode_postdata(encode_dict({'password': password}))
if password is None:
raise ExtractorError('This video is protected by a password, use the --video-password option')
data = urlencode_postdata(encode_dict({'password': password}))
@@
-516,7
+516,7
@@
class VimeoChannelIE(VimeoBaseInfoExtractor):
if not login_form:
return webpage
if not login_form:
return webpage
- password = self._downloader.params.get('videopassword'
, None
)
+ password = self._downloader.params.get('videopassword')
if password is None:
raise ExtractorError('This album is protected by a password, use the --video-password option', expected=True)
fields = self._hidden_inputs(login_form)
if password is None:
raise ExtractorError('This album is protected by a password, use the --video-password option', expected=True)
fields = self._hidden_inputs(login_form)