Closed ducalex closed 2 months ago
@ducalex Does the URL need to be changed as per https://github.com/qbittorrent/search-plugins/pull/267#issuecomment-2080641164?
@ducalex Does the URL need to be changed as per #267 (comment)?
Yes it does. I didn't want to interfere with the other PR work but it's silly, I've now updated the URL in this PR as well :).
This PR adds that. It is dependant on this PR being accepted in qBittorrent: https://github.com/qbittorrent/qBittorrent/pull/21184
When this happens/will test this plugin PR.
I've updated the code so that it tries retrieve_url
but if it raises a TypeError (because it's missing request_data
) then it does the call manually using urllib. This means it will work for people using current/older helpers.py
but will still benefit from future updates to helpers.py
.
Unfortunately the linter is complaining about my usage of urllib and I'm unsure how to fix this, any ideas?
Unfortunately the linter is complaining about my usage of urllib and I'm unsure how to fix this, any ideas?
# nosec B310
https://bandit.readthedocs.io/en/latest/config.html#exclusions
It also seem to me that this B310
rule is useless and stupid: https://stackoverflow.com/a/53040523
I don't mind if it is disabled at the CI, assuming you are willing to submit a PR for it before I do.
Thanks I've added the nosec, seems to do the trick :)
I don't mind if it is disabled at the CI, assuming you are willing to submit a PR for it before I do.
I will let you do it if you don't mind, because I'm not sure what to say as the reason why we're disabling it.
@Chocobo1 I will leave this, the CI change & #292 to you.
@Chocobo1 I will leave this, the CI change & https://github.com/qbittorrent/search-plugins/pull/292 to you.
Given the situation now. I'll handle the CI change and you can continue with #291 and #292. No big problems remain in those.
@ducalex Thank You! @Chocobo1 Thanks for CI Fix!
There's another PR to fix it, https://github.com/qbittorrent/search-plugins/pull/267, but keeping track of cookies and random user agent doesn't seem necessary for me. Maybe the protection kicks in when using a VPN?
In any case, there is now an additional requirement of also doing a POST to request links to be shown.
This PR adds that.
It is dependant on this PR being accepted in qBittorrent: https://github.com/qbittorrent/qBittorrent/pull/21184But, like #267, I can also bundle the patched retrieve_url with POST support in the plugin, so that it works for everybody...
I've updated the code to fall back to raw urllib, it should work regardless of the user's helpers.py version (or if the qbt PR is rejected).