aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/import-youtube.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-15 18:40:24 +0100
committerChocobozzz <me@florianbigard.com>2018-02-15 18:40:24 +0100
commit02988fdc0bdd345bddf89171d258822cab4229d6 (patch)
tree7c8fb4385e9175bc8701588bd9bf1a71c68a3d2c /server/tools/import-youtube.ts
parente33b53abb397fd4d3e7e94829f2099601f03657c (diff)
downloadPeerTube-02988fdc0bdd345bddf89171d258822cab4229d6.tar.gz
PeerTube-02988fdc0bdd345bddf89171d258822cab4229d6.tar.zst
PeerTube-02988fdc0bdd345bddf89171d258822cab4229d6.zip
Fix remote image fetching
Diffstat (limited to 'server/tools/import-youtube.ts')
-rw-r--r--server/tools/import-youtube.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/tools/import-youtube.ts b/server/tools/import-youtube.ts
index 295109cd8..ab91afbc0 100644
--- a/server/tools/import-youtube.ts
+++ b/server/tools/import-youtube.ts
@@ -62,7 +62,7 @@ async function run () {
62 console.log('Will download and upload %d videos.\n', videos.length) 62 console.log('Will download and upload %d videos.\n', videos.length)
63 63
64 for (const video of videos) { 64 for (const video of videos) {
65 await processVideo(video, program['languageCode']) 65 await processVideo(video, program['language'])
66 } 66 }
67 67
68 console.log('I\'m finished!') 68 console.log('I\'m finished!')
@@ -107,7 +107,10 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag
107 const licence = getLicence(videoInfo.license) 107 const licence = getLicence(videoInfo.license)
108 let tags = [] 108 let tags = []
109 if (Array.isArray(videoInfo.tags)) { 109 if (Array.isArray(videoInfo.tags)) {
110 tags = videoInfo.tags.filter(t => t.length < CONSTRAINTS_FIELDS.VIDEOS.TAG.max).slice(0, 5) 110 tags = videoInfo.tags
111 .filter(t => t.length < CONSTRAINTS_FIELDS.VIDEOS.TAG.max)
112 .map(t => t.normalize())
113 .slice(0, 5)
111 } 114 }
112 115
113 let thumbnailfile 116 let thumbnailfile