aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/youtube-dl.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/youtube-dl.ts')
-rw-r--r--server/helpers/youtube-dl.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts
index b74351b42..4d4b37ef9 100644
--- a/server/helpers/youtube-dl.ts
+++ b/server/helpers/youtube-dl.ts
@@ -16,6 +16,7 @@ export type YoutubeDLInfo = {
16 nsfw?: boolean 16 nsfw?: boolean
17 tags?: string[] 17 tags?: string[]
18 thumbnailUrl?: string 18 thumbnailUrl?: string
19 originallyPublishedAt?: string
19} 20}
20 21
21const processOptions = { 22const processOptions = {
@@ -173,6 +174,9 @@ function normalizeObject (obj: any) {
173} 174}
174 175
175function buildVideoInfo (obj: any) { 176function buildVideoInfo (obj: any) {
177
178 const date = obj.upload_date.slice(0,4)+","+obj.upload_date.slice(4,6)+","+obj.upload_date.slice(6,8)
179
176 return { 180 return {
177 name: titleTruncation(obj.title), 181 name: titleTruncation(obj.title),
178 description: descriptionTruncation(obj.description), 182 description: descriptionTruncation(obj.description),
@@ -180,7 +184,8 @@ function buildVideoInfo (obj: any) {
180 licence: getLicence(obj.license), 184 licence: getLicence(obj.license),
181 nsfw: isNSFW(obj), 185 nsfw: isNSFW(obj),
182 tags: getTags(obj.tags), 186 tags: getTags(obj.tags),
183 thumbnailUrl: obj.thumbnail || undefined 187 thumbnailUrl: obj.thumbnail || undefined,
188 originallyPublishedAt: new Date(date).toISOString()
184 } 189 }
185} 190}
186 191