throw error if the videoID returned is different

このコミットが含まれているのは:
Émilien Devos 2022-08-23 09:50:57 +00:00
コミット 389e49183c
2個のファイルの変更7行の追加0行の削除

ファイルの表示

@ -30,3 +30,6 @@ end
# Exception threw when an element is not found.
class NotFoundException < InfoException
end
class VideoNotAvailableException < Exception
end

ファイルの表示

@ -909,6 +909,10 @@ def extract_video_info(video_id : String, proxy_region : String? = nil, context_
"reason" => JSON::Any.new(reason),
}
end
elsif video_id != player_response.dig("videoDetails", "videoId")
# YouTube may return a different video player response than expected.
# See: https://github.com/TeamNewPipe/NewPipe/issues/8713
raise VideoNotAvailableException.new("The video returned by YouTube isn't the requested one.")
else
reason = nil
end