plugins.youtube: Better API age-gate bypassing#4058
Conversation
Doesn't seem to work
Doesn't work either |
Based on yt-dlp/yt-dlp#574 (comment) - Works in videos like https://www.youtube.com/watch?v=Tq92D6wQ1mg - embedUrl is required for videos like https://www.youtube.com/watch?v=HsUATh_Nc2U but I can't find any examples that aren't protected so I left it out - Still doesn't work for videos like https://www.youtube.com/watch?v=Cr381pDsSsA which seem to have embedding explicitly disabled (since it returns an `Playback on other websites has been disabled by the video owner.` error)
a9e8ee1 to
feadc7c
Compare
|
@bastimeyer I'm so sorry, I thought I already changed it before pushing 😅 It should be fixed now |
|
This works, but there's an unnecessary error log message which needs to be fixed. This is caused by the A bit messy and not ideal, but this should do: diff --git a/src/streamlink/plugins/youtube.py b/src/streamlink/plugins/youtube.py
index 0d4de670..1a9ea804 100644
--- a/src/streamlink/plugins/youtube.py
+++ b/src/streamlink/plugins/youtube.py
@@ -279,12 +279,13 @@ class YouTube(Plugin):
if videoId is not None:
return videoId
- def _data_status(self, data):
+ def _data_status(self, data, errorlog=False):
if not data:
return False
status, reason = self._schema_playabilitystatus(data)
if status != "OK":
- log.error(f"Could not get video info - {status}: {reason}")
+ if errorlog:
+ log.error(f"Could not get video info - {status}: {reason}")
return False
return True
@@ -303,7 +304,7 @@ class YouTube(Plugin):
data = self._get_data_from_regex(res, self._re_ytInitialPlayerResponse, "initial player response")
if not self._data_status(data):
data = self._get_data_from_api(res)
- if not self._data_status(data):
+ if not self._data_status(data, True):
return
video_id, self.author, self.title, is_live = self._schema_videodetails(data) |
|
@MinePlayersPE could you please add the diff I've posted to your changes, so that the incorrect log message can be fixed? |
@bastimeyer Done! 👍 I thought by |
|
Thanks |
Based on yt-dlp/yt-dlp#574 (comment)
Playback on other websites has been disabled by the video owner.error)