diff --git a/lib/info.js b/lib/info.js index dd63faff..429d77a3 100644 --- a/lib/info.js +++ b/lib/info.js @@ -88,7 +88,7 @@ exports.getBasicInfo = async(id, options) => { // and requires an account logged in to view, try the embed page. let embedUrl = `${EMBED_URL + id}?${params}`; body = await miniget(embedUrl, options.requestOptions).text(); - let jsonStr = util.between(body, /['"]PLAYER_CONFIG['"]:\s?/, ''); + let jsonStr = util.between(body, /(['"])PLAYER_(CONFIG|VARS)\1:\s?/, ''); let config; if (!jsonStr) { throw Error('Could not find player config'); @@ -99,9 +99,12 @@ exports.getBasicInfo = async(id, options) => { throw Error(`Error parsing config: ${err.message}`); } playErr = util.playError(info, 'LOGIN_REQUIRED'); - if (!config.args.player_response && !config.args.embedded_player_response && playErr) { + if ((!config.args || (!config.args.player_response && !config.args.embedded_player_response)) && + !config.embedded_player_response && playErr) { throw playErr; } + let html5playerRes = / + + + +