Don't log if it's google bot

This error is expected
pull/6544/head
Chocobozzz 2024-08-08 13:40:34 +02:00
parent 1ed2007190
commit 64f943c1cb
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 5 additions and 2 deletions

View File

@ -286,8 +286,11 @@ export class Html5Hlsjs {
if (this.errorCounts[data.type]) this.errorCounts[data.type] += 1
else this.errorCounts[data.type] = 1
if (data.fatal) logger.error(error.message, { currentTime: this.player.currentTime(), data })
else logger.warn(error.message)
// Google Bot doesn't support our codecs, but we don't really care
if (!/googlebot/i.test(navigator.userAgent)) {
if (data.fatal) logger.error(error.message, { currentTime: this.player.currentTime(), data })
else logger.warn(error.message)
}
if (data.type === Hlsjs.ErrorTypes.NETWORK_ERROR) {
error.code = 2