Fix detection of unavailable videos

This commit is contained in:
Omar Roth 2019-08-05 14:19:02 -05:00
parent 14206efb09
commit cc956583fb
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2

View file

@ -1178,7 +1178,7 @@ def fetch_video(id, region)
end
end
if info["errorcode"]?.try &.== "2" || !info["player_response"]
if !info["player_response"]? || info["errorcode"]?.try &.== "2"
raise "Video unavailable."
end