Skip to content

Commit

Permalink
Return a better error if the video is restricted to subscribers.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Jun 13, 2021
1 parent 77cd97c commit f402f79
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@

response = App::HTTP.get(playlist_url)
return [response.code, "Video does not exist."] if response.code == 404
return [response.code, "This video is restricted to subscribers."] if response.code == 403 && response.json[0]["error_code"] == "vod_manifest_restricted"
raise(App::TwitchError, response) if !response.success?
streams = response.body.split("\n").reject { |line| line[0] == "#" } + [playlist_url]
elsif channel_name
Expand Down

0 comments on commit f402f79

Please sign in to comment.