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

Fixed EZTV plugin #291

Merged
merged 6 commits into from
Aug 17, 2024
Merged

Conversation

ducalex
Copy link
Contributor

@ducalex ducalex commented Aug 10, 2024

There's another PR to fix it, #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: qbittorrent/qBittorrent#21184

But, 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).

@xavier2k6
Copy link
Member

@ducalex Does the URL need to be changed as per #267 (comment)?

It requires a post parameter in order to get magnet links
@ducalex ducalex force-pushed the ducalex/fix-eztv-plugin branch from 658b48f to 42fbcc1 Compare August 10, 2024 21:04
@ducalex
Copy link
Contributor Author

ducalex commented Aug 10, 2024

@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 :).

@xavier2k6
Copy link
Member

This PR adds that. It is dependant on this PR being accepted in qBittorrent: qbittorrent/qBittorrent#21184

When this happens/will test this plugin PR.

nova3/engines/eztv.py Outdated Show resolved Hide resolved
@ducalex ducalex force-pushed the ducalex/fix-eztv-plugin branch from 1a9f683 to 30e878c Compare August 13, 2024 16:40
@ducalex
Copy link
Contributor Author

ducalex commented Aug 13, 2024

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?

@Chocobo1
Copy link
Member

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.

@ducalex ducalex force-pushed the ducalex/fix-eztv-plugin branch from e2a94a1 to 9a14d54 Compare August 13, 2024 19:40
@ducalex ducalex force-pushed the ducalex/fix-eztv-plugin branch from 9a14d54 to 7e5504d Compare August 13, 2024 19:41
@ducalex
Copy link
Contributor Author

ducalex commented Aug 13, 2024

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.

@ducalex ducalex mentioned this pull request Aug 13, 2024
@xavier2k6
Copy link
Member

@Chocobo1 I will leave this, the CI change & #292 to you.

@Chocobo1
Copy link
Member

@Chocobo1 I will leave this, the CI change & #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.

@xavier2k6 xavier2k6 merged commit cfe98da into qbittorrent:master Aug 17, 2024
7 checks passed
@xavier2k6
Copy link
Member

@ducalex Thank You!
@Chocobo1 Thanks for CI Fix!

@xavier2k6 xavier2k6 mentioned this pull request Aug 17, 2024
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.

3 participants