aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-02-14 14:25:04 +0600
committerSergey M․ <dstftw@gmail.com>2016-02-14 14:25:04 +0600
commitd800609c62703e4e6edd2891a8432306462e4db3 (patch)
treeb38bc875bcaeac5a82d7e622b5188112cecd4bb6 /youtube_dl/extractor
parentc78c9cd10dfbb4fc3fd49df4f9c98e9c94c9aae9 (diff)
[refactor] Do not specify redundant None as second argument in dict.get()
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/common.py8
-rw-r--r--youtube_dl/extractor/smotri.py4
-rw-r--r--youtube_dl/extractor/vimeo.py6
-rw-r--r--youtube_dl/extractor/youku.py2
4 files changed, 10 insertions, 10 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 444d412d9..144d8c6b6 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -636,7 +636,7 @@ class InfoExtractor(object):
downloader_params = self._downloader.params
# Attempt to use provided username and password or .netrc data
- if downloader_params.get('username', None) is not None:
+ if downloader_params.get('username') is not None:
username = downloader_params['username']
password = downloader_params['password']
elif downloader_params.get('usenetrc', False):
@@ -663,7 +663,7 @@ class InfoExtractor(object):
return None
downloader_params = self._downloader.params
- if downloader_params.get('twofactor', None) is not None:
+ if downloader_params.get('twofactor') is not None:
return downloader_params['twofactor']
return compat_getpass('Type %s and press [Return]: ' % note)
@@ -744,7 +744,7 @@ class InfoExtractor(object):
'mature': 17,
'restricted': 19,
}
- return RATING_TABLE.get(rating.lower(), None)
+ return RATING_TABLE.get(rating.lower())
def _family_friendly_search(self, html):
# See http://schema.org/VideoObject
@@ -759,7 +759,7 @@ class InfoExtractor(object):
'0': 18,
'false': 18,
}
- return RATING_TABLE.get(family_friendly.lower(), None)
+ return RATING_TABLE.get(family_friendly.lower())
def _twitter_search_player(self, html):
return self._html_search_meta('twitter:player', html,
diff --git a/youtube_dl/extractor/smotri.py b/youtube_dl/extractor/smotri.py
index 30210c8a3..015ef75f3 100644
--- a/youtube_dl/extractor/smotri.py
+++ b/youtube_dl/extractor/smotri.py
@@ -170,7 +170,7 @@ class SmotriIE(InfoExtractor):
'getvideoinfo': '1',
}
- video_password = self._downloader.params.get('videopassword', None)
+ video_password = self._downloader.params.get('videopassword')
if video_password:
video_form['pass'] = hashlib.md5(video_password.encode('utf-8')).hexdigest()
@@ -356,7 +356,7 @@ class SmotriBroadcastIE(InfoExtractor):
url = 'http://smotri.com/broadcast/view/url/?ticket=%s' % ticket
- broadcast_password = self._downloader.params.get('videopassword', None)
+ broadcast_password = self._downloader.params.get('videopassword')
if broadcast_password:
url += '&pass=%s' % hashlib.md5(broadcast_password.encode('utf-8')).hexdigest()
diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py
index 6a8f9b49d..c7df6b0c5 100644
--- a/youtube_dl/extractor/vimeo.py
+++ b/youtube_dl/extractor/vimeo.py
@@ -232,7 +232,7 @@ class VimeoIE(VimeoBaseInfoExtractor):
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)
@@ -252,7 +252,7 @@ class VimeoIE(VimeoBaseInfoExtractor):
'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}))
@@ -516,7 +516,7 @@ class VimeoChannelIE(VimeoBaseInfoExtractor):
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)
diff --git a/youtube_dl/extractor/youku.py b/youtube_dl/extractor/youku.py
index 49687371a..5c1f84a09 100644
--- a/youtube_dl/extractor/youku.py
+++ b/youtube_dl/extractor/youku.py
@@ -214,7 +214,7 @@ class YoukuIE(InfoExtractor):
return raw_data['data']
- video_password = self._downloader.params.get('videopassword', None)
+ video_password = self._downloader.params.get('videopassword')
# request basic data
basic_data_url = "http://play.youku.com/play/get.json?vid=%s&ct=12" % video_id