cross-seed / cross-seed

Fully-automatic cross-seeding with Torznab
https://cross-seed.org
Apache License 2.0
852 stars 69 forks source link

cross-seed incorrectly thinks torrents already exist in qBittorrent #64

Closed Drazzilb08 closed 3 years ago

Drazzilb08 commented 3 years ago

I'm getting quite a few entries in my log that state as the heading is showing. Basically saying that a cross-seed is available and it exists w/in qbit.

However, when I go to check to make sure I do not find that release with that specific tracker.

Config as follows

    // can be either "save" or "inject".
    // With "inject" you need to specify the rtorrent rpc url.
    action: "inject",

    // The url of your qBittorrent webui.
    // Only relevant with action: "inject".
    // Supply your username and password inside the url like so:
    // "http://username:password@localhost:8080"
    qbittorrentUrl: "http://<username>:<password>@192.168.1.200:8080",
Screen Shot 2021-05-06 at 2 09 57 PM

Not entirely sure why It would be doing that if there isn't that release from that tracker w/in qbit.

mmgoodnow commented 3 years ago

If you enable verbose logging, right above those log lines it should say something along the lines of [qbittorrent] Making request to /torrents/properties with body hash=<info hash>. If you manually query qBittorrent for those specific info hashes, what do you see?

Drazzilb08 commented 3 years ago

I haven't forgotten about this. Just been super busy recently.

Drazzilb08 commented 3 years ago

If you enable verbose logging, right above those log lines it should say something along the lines of [qbittorrent] Making request to /torrents/properties with body hash=<info hash>. If you manually query qBittorrent for those specific info hashes, what do you see?

I did find exactly what you described however, I'm unclear on how to manually query qbit for these specific info hashes.

the only thing I could figure was to search /BT_backup for that specific info hash. It came up with zero results. 🤷

mmgoodnow commented 3 years ago

Hoping to dig into this this weekend.

ajhorvath20 commented 3 years ago

Yes I have same but I have files inside /BT_backup but not injected in qbittorrent because cross-seed searched it while it was downloading. Might help to figure it out.

Ta

mmgoodnow commented 3 years ago

In https://github.com/mmgoodnow/cross-seed/releases/tag/v2.3.6, I added some logging that will hopefully show what cross-seed sees when it thinks a torrent already exists.

https://github.com/mmgoodnow/cross-seed/blob/d1730f4d0bc09d2a391d66ce8c88c4af966a8265/src/clients/QBittorrent.ts#L84-L99

Drazzilb08 commented 3 years ago
[393/994] Searching for TV.Show.S01.1080p.NF.WEB-DL.DDP2.0.H.264-SPiRiT
[jackett] making search with query "TV Show S01"
[decide] TV.Show.S01.1080p.NF.WEB-DL.DDP2.0.H.264-SPiRiT - no match for beyond-hd-oneurl torrent TV Show S01 1080p HMAX WEB-DL DD2.0 H.264-ViSiON - its size does not match (cached)
[decide] TV.Show.S01.1080p.NF.WEB-DL.DDP2.0.H.264-SPiRiT - no match for beyond-hd-oneurl torrent TV Show S01 1080p NF WEB-DL DDP 2.0 H.264-SPiRiT - the info hash matches a torrent you already have (cached)
[decide] TV.Show.S01.1080p.NF.WEB-DL.DDP2.0.H.264-SPiRiT - no match for broadcasthenet torrent TV.Show.S01.1080p.NF.WEB-DL.DDP2.0.H.264-SPiRiT - the info hash matches a torrent you already have (cached)
[decide] TV.Show.S01.1080p.NF.WEB-DL.DDP2.0.H.264-SPiRiT - no match for broadcasthenet torrent TV.Show.S01.DVDRip.AAC2.0.x264-GHOULS - its size does not match (cached)
[decide] TV.Show.S01.1080p.NF.WEB-DL.DDP2.0.H.264-SPiRiT - no match for broadcasthenet torrent TV.Show.S01.720p.HDTV.DD5.1.x264-W4F - its size does not match (cached)
[qbittorrent] Making request to /torrents/properties with body hash=<HASH>
[qbittorrent] info hash <HASH> found in client: Forbidden
Found TV.Show.S01.1080p.NF.WEB-DL.DDP2.0.H.264-SPiRiT on blutopia - exists
Screen Shot 2021-05-26 at 3 56 41 PM

The original for this one is from BHD, there is a cross seed associated with BTN, however, nothing shows up in qbit for Blu

[356/994] Searching for  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69
[jackett] making search with query " Movie 2017"
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for blutopia torrent  Movie 2017 2160p NF WEB-DL DD 5.1 H.265-PLAYREADY - its size does not match
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for blutopia torrent  Movie 2017 720p NF WEB-DL DD 5.1 H.264-AJP69 - its size does not match
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for hdtorrents torrent Carnage: Swallowing the Past 2017 720p WEB DD2 0 x264-WaLMaRT - its size does not match
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for passthepopcorn torrent  Movie.2017.NF.WEB-DL.DD5.1.x264-AJP69 [480p / WEB / x264 / MKV / Checked] - its size does not match
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for passthepopcorn torrent  Movie.2017.720p.NF.WEB-DL.DD5.1.x264-AJP69 [720p / WEB / x264 / MKV / Checked] - its size does not match
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for passthepopcorn torrent  Movie.2017.2160p.NF.WEB-DL.DD5.1.HEVC-PLAYREADY [2160p / WEB / H.265 / MKV / Checked / 10-bit] - its size does not match
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for broadcasthenet torrent  Movie.2017.2160p.NF.WEB-DL.DD5.1.H.265-PLAYREADY - its size does not match
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for hdtorrents torrent  Movie 2017 2160p WEBRip DD5.1 x264-TrollUHD - its size does not match
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for passthepopcorn torrent  Movie.2017.576p.Netflix.WEBRip.DD+5.1.x264-QOQ [576p / WEB / x264 / MKV / Checked] - its size does not match
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for blutopia torrent  Movie 2017 1080p NF WEB-DL DD 5.1 H.264-AJP69 - the info hash matches a torrent you already have
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for broadcasthenet torrent  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-monkee - it has a different file tree
[decide]  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv - no match for hdtorrents torrent  Movie 2017 1080p WEB-DL DD5.1 H.264-monkee - it has a different file tree
[qbittorrent] Making request to /torrents/properties with body hash=<HASH>
[qbittorrent] info hash <HASH> found in client: Forbidden
Found  Movie.2017.1080p.NF.WEB-DL.DD5.1.x264-AJP69.mkv on passthepopcorn - exists

The original for this came from Blu and the one from PTP is no where to be found

Screen Shot 2021-05-26 at 3 57 05 PM

I checked within qbit's BT_backup/ dir for both the hashs' and could not find the info hash associated with this movie.

Also I verified I'm running 2.3.6 with the -v tag

mmgoodnow commented 3 years ago

This is perfect! Something must be going on with authentication.

The line

[qbittorrent] info hash <HASH> found in client: Forbidden

means that we're getting a 403 Forbidden error from the qBittorrent API. The reason this was showing up as "exists" is because the code was doing roughly the following logic:

if responseText is "Not Found", then the torrent doesn't exist
Otherwise, the torrent must exist. 

But that was an erroneous assumption, clearly.

@bobokun are you familiar with this behavior of qBittorrent's api? Maybe I need to re-authenticate every so often due to session expiration? Or maybe just retry individual requests? I'll take a look at the Flood codebase.

bobokun commented 3 years ago

Hey, sorry I didn't get a notification for this so I didn't see this message. I'm not too familiar with this and I added my network to the whitelist IP subnets so I never have to authenticate. You could probably use the api to set the application preference to whitelist the ip of cross-seed so it doesn't need to authenticate. image

https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#set-application-preferences

mmgoodnow commented 3 years ago

Thanks for the input @bobokun.

@Drazzilb08 @ajhorvath20 could you try this out and see if the error persists?

I do plan to solve this permanently without any workarounds though. I took a look at the qBittorrent source code yesterday and I think I may have a solution, just have to find some time to write it.

Drazzilb08 commented 3 years ago

I've been having that set up as bobo described for the longest.

bobokun commented 3 years ago

I've been having that set up as bobo described for the longest.

Make sure to include the docker IP address subnet which cross seed is running on

Drazzilb08 commented 3 years ago

I've updated it and will report

Screen Shot 2021-06-01 at 6 44 40 PM
Drazzilb08 commented 3 years ago

Well so far, that seems tot be a valid work around.

mmgoodnow commented 3 years ago

I've added some logic to re-login after receiving a 403, feel free to test it out if you like.