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

feat: Improved Support for Bazarr Post-Processing Curl Command #91

Open
Shasoosh opened this issue Nov 4, 2024 · 4 comments
Open

feat: Improved Support for Bazarr Post-Processing Curl Command #91

Shasoosh opened this issue Nov 4, 2024 · 4 comments

Comments

@Shasoosh
Copy link

Shasoosh commented Nov 4, 2024

Description

Hi,

In Bazarr, there's an option to call a function in the Custom Post-Processing section. The straightforward way to use it would be to call:

curl -u 'admin:password' 'http://192.168.1.10:2875/triggers/manual?path={{directory}}'

Which will result into this:

curl -u 'admin:password' 'http://192.168.1.10:2875/triggers/manual?path="Some Movie (2024)"'

However, this approach presents two issues:

  1. URL Rejection:
curl: (3) URL rejected: Malformed input to a URL function

This error occurs due to spaces in the directory name, such as Some Movie (2024).

  1. Path Format:

The {{directory}} reference in Bazarr results in a path with apostrophes, appearing like this:

curl -u 'admin:password' 'http://192.168.1.10:2875/triggers/manual?path="MovieWithoutSpaces"'

This format causes the request to be rejected by autopulse with a not_found error.

I've written a Python script that is called from the Post-Processing section to strip apostrophes and encode the URL. However, it might be more efficient to implement a better solution directly within Autopulse.

Thank you.

Additional Information

No response

@dan-online
Copy link
Owner

Hey @Shasoosh I would love to integrate better with bazarr, perhaps @bonswouar would have the correct way to do this as they have mentioned using it before with post processing. Past that I can't really change anything on my end as it's more an issue of how they parse the Post-Processing command.

It also might be worth opening up an issue on Bazarr's side on how to do this correctly or even to add it directly as a provider instead?

@Shasoosh
Copy link
Author

Shasoosh commented Nov 7, 2024

Thanks for the reply. I was thinking maybe autopulse can ignore the apostrophes marks and perhaps using a curl POST, which typically handles spaces better (I used curl POST with autorefresh if I’m not mistaken), but that’s definitely not the cleanest solution.

I’ve started a discussion in the Bazaar support Discord, but we couldn’t find a simpler solution than the script I’m currently using. I’ll create a Bazaar issue as well.

Keep up the good work! I really like the UI component that makes everything visual.

@bonswouar
Copy link

bonswouar commented Nov 7, 2024

Imo the post-processing command is more like a hack than a proper solution, a proper webhook or something like other arrs would probably be much cleaner. Although if it's only for Autopulse I guess it's good enough for now

FYI I personally execute this simple script to work around Bazarr command restrictions:

#!/bin/sh
curl --silent -G -u "admin:password" "http://autopulse_host:2875/triggers/my_bazarr" --data-urlencode "path=$1"

But I don't think there's any issue on autopulse side (url encoding makes sense), but yeah why not accept GET and POST perhaps

@Shasoosh
Copy link
Author

Shasoosh commented Nov 8, 2024

Thanks @bonswouar, this is much cleaner than what I was using.
I've created a FR here: https://bazarr.featureupvote.com/suggestions/592486/enhancing-autopulse-integration-with-bazarr (waiting for moderation)

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

No branches or pull requests

3 participants