]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/youtube-dl.ts
Add import http enabled configuration
[github/Chocobozzz/PeerTube.git] / server / helpers / youtube-dl.ts
index 74d3e213bc84ee5e00fbc02d56714dec128c2b5c..ff1fbf59fe1eb422f4424699c75df8f9819ef994 100644 (file)
@@ -30,7 +30,7 @@ function getYoutubeDLInfo (url: string): Promise<YoutubeDLInfo> {
 }
 
 function downloadYoutubeDLVideo (url: string) {
-  const hash = crypto.createHash('sha256').update(url).digest('base64')
+  const hash = crypto.createHash('sha256').update(url).digest('hex')
   const path = join(CONFIG.STORAGE.VIDEOS_DIR, hash + '-import.mp4')
 
   logger.info('Importing video %s', url)
@@ -95,7 +95,7 @@ function titleTruncation (title: string) {
 }
 
 function descriptionTruncation (description: string) {
-  if (!description) return undefined
+  if (!description || description.length < CONSTRAINTS_FIELDS.VIDEOS.DESCRIPTION.min) return undefined
 
   return truncate(description, {
     'length': CONSTRAINTS_FIELDS.VIDEOS.DESCRIPTION.max,