aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknown <blackjack4494@web.de>2020-10-07 04:31:23 +0200
committerUnknown <blackjack4494@web.de>2020-10-07 04:31:23 +0200
commit4bb9c8802e85211b67250fca726f3403ffc9be5e (patch)
tree8ea2dbebb37f6ff4c5665627ab2d4232f397e1e8
parent9d9314cb66cc2c815844fa8778360e1b0098b0f7 (diff)
downloadhypervideo-pre-4bb9c8802e85211b67250fca726f3403ffc9be5e.tar.lz
hypervideo-pre-4bb9c8802e85211b67250fca726f3403ffc9be5e.tar.xz
hypervideo-pre-4bb9c8802e85211b67250fca726f3403ffc9be5e.zip
flake8
-rw-r--r--youtube_dlc/extractor/youtube.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py
index 8946b7df8..8c7e57b29 100644
--- a/youtube_dlc/extractor/youtube.py
+++ b/youtube_dlc/extractor/youtube.py
@@ -1870,28 +1870,28 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
# check if video is only playable on youtube - if so it requires auth (cookies)
if re.search(r'player-unavailable">', embed_webpage) is not None:
if ({'VISITOR_INFO1_LIVE', 'HSID', 'SSID', 'SID'} <= cookie_keys
- or {'VISITOR_INFO1_LIVE', '__Secure-3PSID', 'LOGIN_INFO'} <= cookie_keys):
- age_gate = False
- # Try looking directly into the video webpage
- ytplayer_config = self._get_ytplayer_config(video_id, video_webpage)
- if ytplayer_config:
- args = ytplayer_config['args']
- if args.get('url_encoded_fmt_stream_map') or args.get('hlsvp'):
- # Convert to the same format returned by compat_parse_qs
- video_info = dict((k, [v]) for k, v in args.items())
- add_dash_mpd(video_info)
- # Rental video is not rented but preview is available (e.g.
- # https://www.youtube.com/watch?v=yYr8q0y5Jfg,
- # https://github.com/ytdl-org/youtube-dl/issues/10532)
- if not video_info and args.get('ypc_vid'):
- return self.url_result(
- args['ypc_vid'], YoutubeIE.ie_key(), video_id=args['ypc_vid'])
- if args.get('livestream') == '1' or args.get('live_playback') == 1:
- is_live = True
- if not player_response:
- player_response = extract_player_response(args.get('player_response'), video_id)
- if not video_info or self._downloader.params.get('youtube_include_dash_manifest', True):
- add_dash_mpd_pr(player_response)
+ or {'VISITOR_INFO1_LIVE', '__Secure-3PSID', 'LOGIN_INFO'} <= cookie_keys):
+ age_gate = False
+ # Try looking directly into the video webpage
+ ytplayer_config = self._get_ytplayer_config(video_id, video_webpage)
+ if ytplayer_config:
+ args = ytplayer_config['args']
+ if args.get('url_encoded_fmt_stream_map') or args.get('hlsvp'):
+ # Convert to the same format returned by compat_parse_qs
+ video_info = dict((k, [v]) for k, v in args.items())
+ add_dash_mpd(video_info)
+ # Rental video is not rented but preview is available (e.g.
+ # https://www.youtube.com/watch?v=yYr8q0y5Jfg,
+ # https://github.com/ytdl-org/youtube-dl/issues/10532)
+ if not video_info and args.get('ypc_vid'):
+ return self.url_result(
+ args['ypc_vid'], YoutubeIE.ie_key(), video_id=args['ypc_vid'])
+ if args.get('livestream') == '1' or args.get('live_playback') == 1:
+ is_live = True
+ if not player_response:
+ player_response = extract_player_response(args.get('player_response'), video_id)
+ if not video_info or self._downloader.params.get('youtube_include_dash_manifest', True):
+ add_dash_mpd_pr(player_response)
else:
raise ExtractorError('Video is age restricted and only playable on Youtube. Requires cookies!', expected=True)
else: