Added Lets Doe It scraper. Added timestamp matching to qu's duration method.

This commit is contained in:
2020-07-13 03:51:17 +02:00
parent 6fd2bc2687
commit 1eab3be7f6
90 changed files with 412 additions and 9 deletions

View File

@@ -185,6 +185,16 @@ function duration(context, selector, match, attr = 'textContent') {
return moment.duration(segments.join(':')).asSeconds();
}
const timestampMatch = durationString.match(/T(\d+H)?(\d+M)?\d+S/);
if (timestampMatch) {
const hours = timestampMatch[0].match(/(\d+)H/)?.[1] || 0;
const minutes = timestampMatch[0].match(/(\d+)M/)?.[1] || 0;
const seconds = timestampMatch[0].match(/(\d+)S/)?.[1] || 0;
return (Number(hours) * 3600) + (Number(minutes) * 60) + Number(seconds);
}
return null;
}