Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Reduce error logs from import

Chocobozzzf775258f8e52
diff --git a/server/core/helpers/youtube-dl/youtube-dl-wrapper.ts b/server/core/helpers/youtube-dl/youtube-dl-wrapper.ts
index 71d4d0f0e2..be74c0d7f1 100644
--- a/server/core/helpers/youtube-dl/youtube-dl-wrapper.ts
+++ b/server/core/helpers/youtube-dl/youtube-dl-wrapper.ts
@@ -18,7 +18,8 @@ export const YoutubeDlImportErrorCode = {
FETCH_ERROR: 0,
NOT_ONLY_UNICAST_URL: 1,
SKIP_PUBLICATION_DATE: 2,
- IS_LIVE: 3
+ IS_LIVE: 3,
+ AGE_RESTRICTION: 4
}
export type YoutubeDlImportErrorCodeType = typeof YoutubeDlImportErrorCode[keyof typeof YoutubeDlImportErrorCode]
@@ -48,21 +49,25 @@ export class YoutubeDlImportError extends Error {
isUnavailableVideoError () {
const stderr = this.getStderr()
- if (stderr.includes('Video unavailable') || stderr.includes(' 429 ')) {
- return true
- }
+ return stderr.includes('Video unavailable') || stderr.includes(' 429 ')
+ }
- return false
+ isAgeLimitError () {
+ const stderr = this.getStderr()
+
+ return stderr.includes('Sign in to confirm your age')
}
- isRateLimitError () {
+ isRemovedVideoError () {
const stderr = this.getStderr()
- if (stderr.includes('Sign in to confirm you’re not a bot')) {
- return true
- }
+ return stderr.includes('This video has been removed')
+ }
+
+ isRateLimitError () {
+ const stderr = this.getStderr()
- return false
+ return stderr.includes('Sign in to confirm you’re not a bot')
}
private getStderr () {
diff --git a/server/core/lib/hls.ts b/server/core/lib/hls.ts
index 3870150374..cf2f566c2c 100644
--- a/server/core/lib/hls.ts
+++ b/server/core/lib/hls.ts
@@ -164,7 +164,7 @@ function updateMasterHLSPlaylist (video: MVideo, playlistArg: MStreamingPlaylist
content: masterPlaylistContent
})
- logger.info(`Updated master playlist file of video ${video.uuid} to object storage ${playlist.playlistUrl}`, lTags(video.uuid))
+ logger.info(`Updated master playlist file of video ${video.uuid} to object storage`, lTags(video.uuid))
} else {
const masterPlaylistPath = VideoPathManager.Instance.getFSHLSOutputPath(video, playlist.playlistFilename)
await writeFile(masterPlaylistPath, masterPlaylistContent)
diff --git a/server/core/lib/sync-channel.ts b/server/core/lib/sync-channel.ts
index 09190247e1..f86470a86f 100644
--- a/server/core/lib/sync-channel.ts
+++ b/server/core/lib/sync-channel.ts
@@ -77,7 +77,9 @@ export async function synchronizeChannel (options: {
if (
err.code === YoutubeDlImportErrorCode.SKIP_PUBLICATION_DATE ||
err.code === YoutubeDlImportErrorCode.IS_LIVE ||
- err.isUnavailableVideoError()
+ err.isUnavailableVideoError() ||
+ err.isAgeLimitError() ||
+ err.isRemovedVideoError()
) {
continue
}