jarun / nnn

n³ The unorthodox terminal file manager
BSD 2-Clause "Simplified" License
19.4k stars 763 forks source link

Added New Plugin #1900

Closed Zazucki closed 4 months ago

Zazucki commented 5 months ago

Added upl0ad: Upload files to 0x0.st

I'm open to alternative names, or integrating this into the upload plugin.

jarun commented 5 months ago

Please integrate with the existing upload plugin.

Zazucki commented 4 months ago

ix.io and ffsend services are both deprecated, but file.io still works. file.io allows 2 GB, 0x0.st max filesize is 512 MB. Is it fine to remove ffsend and ix.io and replace with 0x0.st, leaving file.io logic for larger files?

KlzXS commented 4 months ago

You are right, those two don't work anymore. Remove ffsend, it's been years and it's officially discontinued. See what that new Thunderbird Send stuff is if you can. Keep ix for now, maybe it comes back.

Other than that just add the new service and offer the user to choose which one to use. Don't force a default.

jarun commented 4 months ago

@Zazucki can you please address the comments?

Zazucki commented 4 months ago

I have seen nothing about Thunderbird Send since this podcast from September 27, 2023. Specifically this part. I doubt it'll be available for use until they officially release the modernized Thunderbird.

ix.io has been down since December of last year, I'm not sure how long is acceptable to wait. Also, according to the most recent live version of ix.io:

If you are distributing software that uses this automatically, talk to me first.

Was this ever done when initially implementing the plugin?

Other than the Client, it seems to only have a few more features over 0x0.st, like color highlighting.

I'm fine with implementing the changes into the original upload plugin, but it may take me some time to get around to it.

jarun commented 4 months ago

OK, take your time. Remove ix.io as well.

Zazucki commented 4 months ago

Here's a first attempt, it's rough but it works. Still need to test with bad filenames.

https://gist.github.com/Zazucki/d3d843cd26053f6ff38e16082b40b4af

I know line 16 is a mess, but xargs complains if I try to split the line. Also, this was the only way I found it to work with selections.

If it's not clear, please ask questions.

edit: forgot to mention, you can add -t to xargs command to show what file corresponds to which link via showing the command xargs is running, but it makes the output kinda messy.

jarun commented 4 months ago

@Zazucki make sure to run chellcheck. @KlzXS can you please review?

Zazucki commented 4 months ago

Shellcheck only found 1 problem, I fixed and updated the gist.

jarun commented 4 months ago

@N-R-K please review if you have the time.

KlzXS commented 4 months ago

I left a comment on the gist @Zazucki.

N-R-K commented 4 months ago

Do you guys know any pastebin which has syntax highlighting and can auto-detect language? I was looking at https://bpa.st but it doesn't seem to auto-detect filetype.

Zazucki commented 4 months ago

I used to use hastebin for that but I heard Toptal ruined it.

There's some promising things here you can look through: https://alternativeto.net/software/pastebin/