aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/helpers/youtube-dl.ts2
-rw-r--r--server/tools/peertube-import-videos.ts5
2 files changed, 5 insertions, 2 deletions
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts
index 4d4b37ef9..a5ab92df0 100644
--- a/server/helpers/youtube-dl.ts
+++ b/server/helpers/youtube-dl.ts
@@ -175,7 +175,7 @@ function normalizeObject (obj: any) {
175 175
176function buildVideoInfo (obj: any) { 176function buildVideoInfo (obj: any) {
177 177
178 const date = obj.upload_date.slice(0,4)+","+obj.upload_date.slice(4,6)+","+obj.upload_date.slice(6,8) 178 const date = obj.upload_date.slice(0,4) + ',' + obj.upload_date.slice(4,6) + ',' + obj.upload_date.slice(6,8)
179 179
180 return { 180 return {
181 name: titleTruncation(obj.title), 181 name: titleTruncation(obj.title),
diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts
index 151c5a989..4032c5e0d 100644
--- a/server/tools/peertube-import-videos.ts
+++ b/server/tools/peertube-import-videos.ts
@@ -212,6 +212,8 @@ 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)
216
215 const videoAttributes = { 217 const videoAttributes = {
216 name: truncate(videoInfo.title, { 218 name: truncate(videoInfo.title, {
217 'length': CONSTRAINTS_FIELDS.VIDEOS.NAME.max, 219 'length': CONSTRAINTS_FIELDS.VIDEOS.NAME.max,
@@ -231,7 +233,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, cwd: st
231 privacy: VideoPrivacy.PUBLIC, 233 privacy: VideoPrivacy.PUBLIC,
232 fixture: videoPath, 234 fixture: videoPath,
233 thumbnailfile, 235 thumbnailfile,
234 previewfile: thumbnailfile 236 previewfile: thumbnailfile,
237 originallyPublishedAt: new Date(date).toISOString()
235 } 238 }
236 239
237 console.log('\nUploading on PeerTube video "%s".', videoAttributes.name) 240 console.log('\nUploading on PeerTube video "%s".', videoAttributes.name)