piperun / torrent-clipper

Torrent clipper is a fork of torrent control intended for chrome users
GNU Lesser General Public License v2.1
22 stars 5 forks source link

Can't get it to work on Edge-Chromium #2

Closed kabutocub closed 4 years ago

kabutocub commented 5 years ago

Same exact settings as the Firefox version.

Has this been tested on the Edge-Chromium browser? Thanks again for any feedback you can give.

piperun commented 5 years ago

Hi! Thanks for reporting this, I'm afraid I haven't tried it out on edge chromium, the "err_blocked_by_client" is expected since chrome doesn't share 100% the same api as Firefox, since the extension cancel the request and in Firefox it doesn't alarm you about it.

Did you install the extension via github or chrome store?

Also could you provide what error message it gives in the console (Developer Tools)?

Alternatively if you built the addon yourself and loaded it, there should be a specific console window (in extensions) that logs all the addon errors.

kabutocub commented 5 years ago

I installed it through the Chrome Web Store.

Also, I'm not sure how to access the console/Developer Tools (sorry) :P If you can point me in the right direction I'll be happy to do it. I will say when I try to add a magnet link manually through the context menu there's no error, just that nothing happens. When I try to catch the links automatically I get this:

Requests to the server have been blocked by an extension. Try disabling your extensions. ERR_BLOCKED_BY_CLIENT

I will report this in the right location once I know how. Thanks again so much for replying and for all your work. :)

piperun commented 5 years ago

Hi again!

If you go to Extensions in the browser menu and then follow the provided screenshot, you should be able to see what error the extension is giving out.

msedge_2019-05-13_09-57-39

I manage to setup the new edge browser and install torrent clipper, testing remotely adding a magnet link to rutorrent and both clicking on the link and adding it via context menu worked.

Which torrent client do you use?

kabutocub commented 5 years ago

Using qBittorrent 4.1.6

It generated two errors, the first one:

Unchecked runtime.lastError: Invalid header specification '{"name":"Referer"}'.
_generated_background_page.html:1

The second one says: POST [my server URL with port] 403 (Forbidden) qbittorrent.js:91 I tried it with my local IP and with my Dynamic DNS too. :/ Same exact settings work on Firefox though, which is weird since you got it working. :P

Thanks again btw

kabutocub commented 5 years ago
2019-05-13 (3) 2019-05-13 (4)
piperun commented 5 years ago

Thanks a lot for the info!

Yeah when I replicated the result on my end it seems to give out similar message, I'll have to look deeper into this as this is an issue from my end.

piperun commented 5 years ago

Alright I got some good news and some bad news, the good news is that I manage to find the culpit (I'm pretty sure at least), it's qbittorrent Security setting for it's Web UI that is most likely spooking around, for now I would advice to disable them for the short term as I try and get to the bottom of it.

kabutocub commented 5 years ago

Progress! So I disabled/unchecked the three settings under the Security section on the Web UI tab. When I clicked on a download/magnet-link it added it to qBittorrent !! I would rather not have those options disabled but It's nice to know we can make it work.

Even though it added the torrent on the remote client I still got an error on the browser when I clicked it.

www.XXXXXX.org is blocked Requests to the server have been blocked by an extension. Try disabling your extensions. ERR_BLOCKED_BY_CLIENT

Nothing hitting the back button can't fix. Thanks for actively working on this. MUCH APPRECIATED!

piperun commented 5 years ago

Glad to hear this (temporarily) fix worked, whoever your other problem I'm pretty sure can't be fixed due to how chrome handles the request cancelling (firefox does it differently in a nutshell), it should still technically add the magnet/torrent at hand, just that it'll redirect you to the "ERR_BLOCKED_BY_CLIENT".

Unfortunately your only option is to use the context menu, so far.

kabutocub commented 5 years ago

Just a quick update. You were right, the context menu doesn't produce an error (thanks for mentioning that!)

Also, under the Security section in the Web UI tab in qBittorrent settings...

It works fine with "Enable clickjacking protection" checked and enabled. 👍

It does NOT work with "Enable Cross-Site Request Forgery" checked. So whatever the issue is it HAS to do with that particular setting/option. 👎

piperun commented 5 years ago

Aye, I've been tied up with real life to really get to the bottom of it, but as I get more free time I may be able to fix it unless upstream has already done so.

Kahana82 commented 4 years ago

Can confirm it works with qbt 4.15 by disabling "Cross-Site Request Forgery (CSRF) protection" and "Host header validation"

Maybe the culprit lies in the fetch calls in qbittorrent.js (in addTorrent / addTorrentUrl) and index.js (in fetchTorrent). It should be possible to do this without CORS checks with mode: 'no-cors' and some other headers. See here on stackoverflow.

Hawk1988 commented 4 years ago

I am also getting the error ERR_BLOCKED_BY_CLIENT in Chrome when adding a torrent.

@piperun any news regarding fix? :-)

I am running Qbittorrent 4.2.5

piperun commented 4 years ago

ERR_BLOCKED_BY_CLIENT should be a "fluke" or rather it's a side effect of using web request, but just to make sure you can check if it is via it's "background page" in the Google Extension's settings (where you can set it on and off).

As for the bug, unfortunately I haven't had any serious free time to handle it atm. The fix atm. is to disable "Cross-Site Request Forgery (CSRF) protection" and "Host header validation".

piperun commented 4 years ago

So finally I can safely say I've manage to fix this, so you don't have to disable CSRF on qbittorrent anymore.