This commit is contained in:
craftingmod 2021-04-18 04:19:02 +09:00
commit 3d102f2a9c

View file

@ -1525,15 +1525,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
lambda x: x['errorScreen']['playerErrorMessageRenderer'], lambda x: x['errorScreen']['playerErrorMessageRenderer'],
dict) or {} dict) or {}
reason = get_text(pemr.get('reason')) or playability_status.get('reason') reason = get_text(pemr.get('reason')) or playability_status.get('reason')
if reason != None and reason.find("This video is only available to Music Premium members") >= 0: if reason is not None and reason.find("This video is only available to Music Premium members") >= 0:
# accept only music premium # accept only music premium
self.report_warning(reason.replace("video", "URL") + ". Using youtube mode instead of yt-music mode.", video_id) self.report_warning(reason.replace("video", "URL") + ". Using youtube mode instead of yt-music mode.", video_id)
else: else:
self.to_screen("Using yt-music.") self.to_screen("Using yt-music.")
player_response = pr player_response = pr
if player_response is None and webpage:
if player_response == None and webpage:
player_response = self._extract_yt_initial_variable( player_response = self._extract_yt_initial_variable(
webpage, self._YT_INITIAL_PLAYER_RESPONSE_RE, webpage, self._YT_INITIAL_PLAYER_RESPONSE_RE,
video_id, 'initial player response') video_id, 'initial player response')