buckets
This commit is contained in:
parent
5086d344e2
commit
7b10059b87
|
|
@ -2,7 +2,7 @@ import * as fs from 'node:fs'
|
|||
const keys = JSON.parse(fs.readFileSync('s3.json', 'utf-8'))
|
||||
|
||||
async function uploadVideo(video: string) {
|
||||
const uploaded = await fetch(`${keys.endpoint}/${video.split('/')[2]}`, {
|
||||
const uploaded = await fetch(`${keys.endpoint}/preservetube/${video.split('/')[2]}`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'x-authtoken': keys.videos[0].secret
|
||||
|
|
@ -17,7 +17,7 @@ async function uploadImage(id: string, url: string) {
|
|||
const arrayBuffer = await response.arrayBuffer()
|
||||
const bufferHash = Bun.hash(Buffer.from(arrayBuffer)).toString()
|
||||
|
||||
const exists = await fetch(`${keys.endpoint}/${id}-${bufferHash}.webp`, {
|
||||
const exists = await fetch(`${keys.endpoint}/preservetube-media/${id}-${bufferHash}.webp`, {
|
||||
method: 'HEAD',
|
||||
headers: {
|
||||
'x-authtoken': keys.videos[0].secret
|
||||
|
|
@ -25,7 +25,7 @@ async function uploadImage(id: string, url: string) {
|
|||
})
|
||||
if (exists.status == 200) return `${keys.images[0].url}${id}-${bufferHash}.webp`
|
||||
|
||||
const uploaded = await fetch(`${keys.endpoint}/${id}-${bufferHash}.webp`, {
|
||||
const uploaded = await fetch(`${keys.endpoint}/preservetube-media//${id}-${bufferHash}.webp`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'x-authtoken': keys.videos[0].secret
|
||||
|
|
|
|||
Loading…
Reference in New Issue