Skip to content

fix filenames with special characters like spaces + fix mime type uploads for bash uploader #786

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

Merged
merged 4 commits into from
Apr 29, 2025

Conversation

rlko
Copy link
Contributor

@rlko rlko commented Apr 17, 2025

Hey,

I especially noticed that if you upload a video (tried with webm/mp4) you end up with an application/octet-stream

This PR:

  • encapsulates the flag option to pass filenames that have special characters like spaces (thanks to windows).
  • adds a proper MIME type for uploads using file command in shell script that is pretty much installed in the vast majority of any UNIX host.

rlko added 3 commits April 17, 2025 16:10
* Add proper MIME type for uploads (especially videos)
  in shell script
* encapsulating all headers
* tr not needed (anymore?)
* removing `echo` as it is not returning anything
  because it is already printing on stdout
* parsing correct key for url uploader
@rlko
Copy link
Contributor Author

rlko commented Apr 17, 2025

Well I ended up fixing the whole script uploader. And pointing the url shortener at the right json key.

Also if you add the -s flag to curl it will stop printing from stderr the download progress:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7792k  100   112  100 7792k    127  8839k --:--:-- --:--:-- --:--:-- 8845k

But it's a personal thing and I don't mind, so I didn't touch.

Other stuff, the flameshot config is as broken as the bash uploader since it uses curl and the same logic can be applied. I don't use flameshot but I can probably do a PR for this as well and apply the same diff.

Personally I'd rather progress this script into a more complete script than a one liner that does one thing. For instance, it's not bad to have some disposable sharing links ('x-zipline-max-views) for privacy reasons. But not everytime, I'd rather have a flag to switch.

@diced
Copy link
Owner

diced commented Apr 29, 2025

thanks for your pr and fixing some oversights on my end lol

But it's a personal thing and I don't mind, so I didn't touch.

this is mostly the case, and the script generators are more for people who don't want to go and create their own scripts and want to have something working ootb (in this case it looks like it isn't sadly 😭)

Personally I'd rather progress this script into a more complete script than a one liner that does one thing. For instance, it's not bad to have some disposable sharing links ('x-zipline-max-views) for privacy reasons. But not everytime, I'd rather have a flag to switch.

like above, i think i'd just let people make their own scripts to their liking while keeping this as simple as it can be.

@diced diced merged commit 567a855 into diced:trunk Apr 29, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants