diff options
| author | Émilien Devos <contact@emiliendevos.be> | 2023-01-15 12:07:58 +0000 |
|---|---|---|
| committer | Emilien Devos <contact@emiliendevos.be> | 2023-01-15 16:22:05 +0100 |
| commit | d6087fac472711376762cfb2c5f7672f84f6d4fe (patch) | |
| tree | 4ed673ad1aa27318893fb58837080a06a4de7439 /src | |
| parent | 05258d56bdc3f4de1f0da0c0dbd2d540f68cbdd5 (diff) | |
| download | invidious-d6087fac472711376762cfb2c5f7672f84f6d4fe.tar.gz invidious-d6087fac472711376762cfb2c5f7672f84f6d4fe.tar.bz2 invidious-d6087fac472711376762cfb2c5f7672f84f6d4fe.zip | |
Don't continue when LOGIN_REQUIRED and no videoDetails
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/videos/parser.cr | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index 5df49286..5c323975 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -66,8 +66,10 @@ def extract_video_info(video_id : String, proxy_region : String? = nil) reason ||= subreason.try &.[]("runs").as_a.map(&.[]("text")).join("") reason ||= player_response.dig("playabilityStatus", "reason").as_s - # Stop here if video is not a scheduled livestream - if !{"LIVE_STREAM_OFFLINE", "LOGIN_REQUIRED"}.any?(playability_status) + # Stop here if video is not a scheduled livestream or + # for LOGIN_REQUIRED when videoDetails element is not found because retrying won't help + if !{"LIVE_STREAM_OFFLINE", "LOGIN_REQUIRED"}.any?(playability_status) || + playability_status == "LOGIN_REQUIRED" && !player_response.dig?("videoDetails") return { "version" => JSON::Any.new(Video::SCHEMA_VERSION.to_i64), "reason" => JSON::Any.new(reason), |
