mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Throw error if the returned videoID is different (#3278)
This commit is contained in:
commit
16b23efb4f
2 changed files with 7 additions and 0 deletions
|
@ -30,3 +30,6 @@ end
|
||||||
# Exception threw when an element is not found.
|
# Exception threw when an element is not found.
|
||||||
class NotFoundException < InfoException
|
class NotFoundException < InfoException
|
||||||
end
|
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),
|
"reason" => JSON::Any.new(reason),
|
||||||
}
|
}
|
||||||
end
|
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
|
else
|
||||||
reason = nil
|
reason = nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue