Comparing version 0.1.10 to 0.1.11
@@ -49,2 +49,4 @@ const ENTITIES = require('html-entities').AllHtmlEntities; | ||
return null; | ||
} else if (titles.includes('yt-lockup-clarification')) { | ||
return null; | ||
} else { | ||
@@ -134,2 +136,4 @@ const dir = PATH.resolve(__dirname, '../dumps/'); | ||
.splice(1); | ||
const live = string.includes('yt-badge-live" >Live now</span>'); | ||
const live_views = parseInt(metaInfo[0].replace(/\.|,/g, '')); | ||
const thumbnailRaw = exports.between(string, 'data-thumb="', '"'); | ||
@@ -140,2 +144,3 @@ const thumbnail = thumbnailRaw ? thumbnailRaw : exports.between(string, 'src="', '"'); | ||
type: 'video', | ||
live: live, | ||
title: exports.removeHtml(exports.between(exports.between(string, '<a href="', '</a>'), '>')), | ||
@@ -152,5 +157,5 @@ link: URL.resolve(BASE_URL, exports.removeHtml(exports.between(string, 'href="', '"'))), | ||
description: exports.removeHtml(rawDesc) || null, | ||
views: metaInfo[1] ? Number(metaInfo[1].split(' ')[0].replace(/\.|,/g, '')) : null, | ||
duration: exports.between(string, '<span class="video-time" aria-hidden="true">', '</span>'), | ||
uploaded_at: metaInfo[0] || null, | ||
views: live ? live_views : (metaInfo[1] ? Number(metaInfo[1].split(' ')[0].replace(/\.|,/g, '')) : null), | ||
duration: live ? null : exports.between(string, '<span class="video-time" aria-hidden="true">', '</span>'), | ||
uploaded_at: live ? null : metaInfo[0] || null, | ||
}; | ||
@@ -157,0 +162,0 @@ }; |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"repository": { | ||
@@ -30,6 +30,6 @@ "type": "git", | ||
"eslint": "^6.0.0", | ||
"assert-diff": "^2.0.0", | ||
"assert-diff": "^3.0.0", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^6.0.0", | ||
"nock": "^11.1.0" | ||
"mocha": "^7.0.1", | ||
"nock": "^12.0.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "engines": { |
22497
371