zlin / wgetpaste

MIT License
34 stars 18 forks source link

wgetpaste fails with bpaste #15

Closed mjeveritt closed 3 years ago

mjeveritt commented 4 years ago

When bpaste (or more recently bpa.st) throws a 304 redirect, it confuses wgetpaste and it fails. However, running with --verbose or --debug you can see the request is sent successfully and a URL is generated, it just fails to be parsed correctly.

bcattaneo commented 4 years ago

Hello,

Thanks for reporting it. Updating the location regex for pinnwand does the trick. I'll send a PR later with the fix, but it's basically:

Changing this line:

REGEX_LOC_pinnwand="\(/show/[^ ]*\).*$|https://bpaste.net\1"

For this one:

REGEX_LOC_pinnwand="\(/[^ ]*\).*$|https://bpaste.net\1"
mjeveritt commented 4 years ago

Thanks - I'll give that a roll locally! :smiley:

mjeveritt commented 4 years ago

Seems to work fine here - is it a good opportunity to add a commit to change the output URL to the new 'bpa.st' format yet?

bcattaneo commented 4 years ago

Seems to work fine here - is it a good opportunity to add a commit to change the output URL to the new 'bpa.st' format yet?

I think it is, yes. You could create a PR to get some feedback, or did you mean to include it in mine?

mjeveritt commented 4 years ago

I can do either ... :smiley:

mjeveritt commented 4 years ago

Hmm, looking more closely, the bpa.st endpoint doesn't accept the 'old'/deprecated method of POST that wgetpaste is using, so we need to transition to JSON and use one of https://pinnwand.readthedocs.io/en/latest/usage.html . This is a little more involved than I'd hoped we could achieve with a couple of URL changes .. and perhaps a fresh PR/issue is worthwhile after all !

bcattaneo commented 4 years ago

Hey! In case you want to give it a try, I just made the changes here: https://raw.githubusercontent.com/bcattaneo/wgetpaste/feature/bpaste_v1_api/wgetpaste

mjeveritt commented 3 years ago

@nvinson @Cogitri any chance of merging this? (or its successor)

nvinson commented 3 years ago

@mjeveritt I cannot merge it (no write permissions), so it is up to @Cogitri . However, I'd rather see #16 updated and merged. If @bcattaneo isn't interested in it anymore, I'll take up the task of updating it.

mjeveritt commented 3 years ago

Thanks @nvinson :)