aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools
diff options
context:
space:
mode:
Diffstat (limited to 'server/tools')
-rw-r--r--server/tools/peertube-import-videos.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts
index 4032c5e0d..04e24e818 100644
--- a/server/tools/peertube-import-videos.ts
+++ b/server/tools/peertube-import-videos.ts
@@ -11,7 +11,7 @@ import { truncate } from 'lodash'
11import * as prompt from 'prompt' 11import * as prompt from 'prompt'
12import { remove } from 'fs-extra' 12import { remove } from 'fs-extra'
13import { sha256 } from '../helpers/core-utils' 13import { sha256 } from '../helpers/core-utils'
14import { safeGetYoutubeDL } from '../helpers/youtube-dl' 14import { safeGetYoutubeDL, buildOriginallyPublishedAt } from '../helpers/youtube-dl'
15import { getSettings, netrc } from './cli' 15import { getSettings, netrc } from './cli'
16 16
17let accessToken: string 17let accessToken: string
@@ -212,7 +212,7 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, cwd: st
212 }, thumbnailfile) 212 }, thumbnailfile)
213 } 213 }
214 214
215 const date = videoInfo.upload_date.slice(0,4) + ',' + videoInfo.upload_date.slice(4,6) + ',' + videoInfo.upload_date.slice(6,8) 215 const originallyPublishedAt = buildOriginallyPublishedAt(videoInfo)
216 216
217 const videoAttributes = { 217 const videoAttributes = {
218 name: truncate(videoInfo.title, { 218 name: truncate(videoInfo.title, {
@@ -234,7 +234,7 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, cwd: st
234 fixture: videoPath, 234 fixture: videoPath,
235 thumbnailfile, 235 thumbnailfile,
236 previewfile: thumbnailfile, 236 previewfile: thumbnailfile,
237 originallyPublishedAt: new Date(date).toISOString() 237 originallyPublishedAt: originallyPublishedAt ? originallyPublishedAt.toISOString() : null
238 } 238 }
239 239
240 console.log('\nUploading on PeerTube video "%s".', videoAttributes.name) 240 console.log('\nUploading on PeerTube video "%s".', videoAttributes.name)