Skip to content

Commit

Permalink
fix: Update getWatchHTMLPage right pos (#946)
Browse files Browse the repository at this point in the history
* fix:update getWatchHTMLPage right pos

* fix: move all findJSON </script> right pos.
  • Loading branch information
mome0320 committed Jun 26, 2021
1 parent 6320df0 commit bcd8719
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ const getWatchHTMLPage = async(id, options) => {
let info = { page: 'watch' };
try {
info.player_response = findJSON('watch.html', 'player_response',
body, /\bytInitialPlayerResponse\s*=\s*\{/i, '\n', '{');
body, /\bytInitialPlayerResponse\s*=\s*\{/i, '</script>', '{');
} catch (err) {
let args = findJSON('watch.html', 'player_response', body, /\bytplayer\.config\s*=\s*{/, '</script>', '{');
info.player_response = findPlayerResponse('watch.html', args);
}
info.response = findJSON('watch.html', 'response', body, /\bytInitialData("\])?\s*=\s*\{/i, '\n', '{');
info.response = findJSON('watch.html', 'response', body, /\bytInitialData("\])?\s*=\s*\{/i, '</script>', '{');
info.html5player = getHTML5player(body);
return info;
};
Expand Down

0 comments on commit bcd8719

Please sign in to comment.