Skip to content

Commit

Permalink
fix: check for private video in one request
Browse files Browse the repository at this point in the history
  • Loading branch information
fent committed Nov 2, 2020
1 parent 4ce324d commit 916c399
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
5 changes: 1 addition & 4 deletions lib/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exports.getBasicInfo = async(id, options) => {

let playErr = utils.playError(player_response, ['ERROR']);
let privateErr = privateVideoError(player_response);
if (playErr) {
if (playErr || privateErr) {
throw playErr || privateErr;
}

Expand All @@ -51,9 +51,6 @@ exports.getBasicInfo = async(id, options) => {
// and requires an account logged in to view, try the embed page.
let [embedded_player_response, embedbody] = await getEmbedPage(id, options);
playErr = utils.playError(player_response, ['LOGIN_REQUIRED']);
if (!embedded_player_response && playErr) {
throw playErr;
}
player_response = embedded_player_response;
html5player = html5player || getHTML5player(embedbody);
age_restricted = true;
Expand Down

0 comments on commit 916c399

Please sign in to comment.