* Import original publication date when importing a video from YouTube using the CLI
* Fix lint issues
function buildVideoInfo (obj: any) {
- const date = obj.upload_date.slice(0,4)+","+obj.upload_date.slice(4,6)+","+obj.upload_date.slice(6,8)
+ const date = obj.upload_date.slice(0,4) + ',' + obj.upload_date.slice(4,6) + ',' + obj.upload_date.slice(6,8)
return {
name: titleTruncation(obj.title),
}, thumbnailfile)
}
+ const date = videoInfo.upload_date.slice(0,4) + ',' + videoInfo.upload_date.slice(4,6) + ',' + videoInfo.upload_date.slice(6,8)
+
const videoAttributes = {
name: truncate(videoInfo.title, {
'length': CONSTRAINTS_FIELDS.VIDEOS.NAME.max,
privacy: VideoPrivacy.PUBLIC,
fixture: videoPath,
thumbnailfile,
- previewfile: thumbnailfile
+ previewfile: thumbnailfile,
+ originallyPublishedAt: new Date(date).toISOString()
}
console.log('\nUploading on PeerTube video "%s".', videoAttributes.name)
updateAt: string
privacy?: VideoPrivacy
}
+ originallyPublishedAt?: string
}
function getVideoCategories (url: string) {
}
}
+ if (attributes.originallyPublishedAt !== undefined) {
+ req.field('originallyPublishedAt', attributes.originallyPublishedAt)
+ }
+
return req.attach('videofile', buildAbsoluteFixturePath(attributes.fixture))
.expect(specialStatus)
}