mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Simplify regular expressions
This commit is contained in:
@@ -468,12 +468,12 @@ function getNormalPlaylist(response: any, body: any): YouTubePlayList {
|
||||
if (!data.title.runs || !data.title.runs.length) throw new Error('Failed to Parse Playlist info.');
|
||||
|
||||
const author = playlist_details[1]?.playlistSidebarSecondaryInfoRenderer.videoOwner;
|
||||
const views = data.stats.length === 3 ? data.stats[1].simpleText.replace(/[^0-9]/g, '') : 0;
|
||||
const views = data.stats.length === 3 ? data.stats[1].simpleText.replace(/\D/g, '') : 0;
|
||||
const lastUpdate =
|
||||
data.stats
|
||||
.find((x: any) => 'runs' in x && x['runs'].find((y: any) => y.text.toLowerCase().includes('last update')))
|
||||
?.runs.pop()?.text ?? null;
|
||||
const videosCount = data.stats[0].runs[0].text.replace(/[^0-9]/g, '') || 0;
|
||||
const videosCount = data.stats[0].runs[0].text.replace(/\D/g, '') || 0;
|
||||
|
||||
const res = new YouTubePlayList({
|
||||
continuation: {
|
||||
|
||||
Reference in New Issue
Block a user