Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Video uploads fail on newer version #656

Closed
909oce opened this issue Jan 6, 2025 · 2 comments
Closed

Bug: Video uploads fail on newer version #656

909oce opened this issue Jan 6, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@909oce
Copy link

909oce commented Jan 6, 2025

What happened?

This script used to work just fine for me, however now whenever I use it, a link does not get copied at the end and the file does not upload. Removing type=video/mp4 "fixes" it but then it no longer embeds or plays when opening the URL and shows the "cannot show preview, please download" message.

#!/bin/bash

if pgrep -f "wf-recorder" >/dev/null; then
  pkill -f wf-recorder
  notify-send "Recording stopped."
  pkill -RTMIN+8 waybar
  exit 0
fi

output_file="/tmp/recording.mp4"
slurp_region=$(slurp)
if [ -z "$slurp_region" ]; then
  notify-send "No region selected."
  exit 1
fi

notify-send "Recording started."
pkill -RTMIN+8 waybar
wf-recorder -g "$slurp_region" -f "$output_file" -y
while [ ! -z $(pgrep -x slurp) ]; do wait; done
if [ ! -s "$output_file" ]; then
  exit 1
fi

curl -H "authorization: $TOKEN" $URL \
  -F "file=@$output_file;type=video/mp4" \
  -H "Content-Type: multipart/form-data" \
  -H "Format: random" \
  -H "Embed: true" | jq -r '.files[0]' | tr -d '\n' | wl-copy

I'm unsure if something has changed that I missed which would cause this to fail. I know its not a token issue since my screenshot upload script still works fine.

Version

latest (ghcr.io/diced/zipline or ghcr.io/diced/zipline:latest)

What browser(s) are you seeing the problem on?

No response

Zipline Logs

No response

Browser Logs

No response

Additional Info

No response

@909oce 909oce added the bug Something isn't working label Jan 6, 2025
@diced
Copy link
Owner

diced commented Jan 7, 2025

you can try https://zipline.diced.sh/docs/config/uploader#uploader_assume_mimetypes (set the env var UPLOADER_ASSUME_MIMETYPES=true), if the server receives a "application/octet-stream" mimetype it will try to guess the mimetype through the file extension - in this case .mp4 correlates to video/mp4. And you will probably have to remove the type=video/mp4 part as well

@909oce
Copy link
Author

909oce commented Jan 7, 2025

That fixed it, thank you!

@909oce 909oce closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants