rumanzo / bt2qbt

bt2qbt is cli tool for export from uTorrent\Bittorrent into qBittorrent
https://qbforums.shiki.hu/viewtopic.php?f=14&t=5889
GNU General Public License v3.0
249 stars 9 forks source link

"Can't process convert resume.dat" when trackers are not perfectly separated by empty lines [uTorrent 2.2.1] #37

Closed zerofool closed 2 years ago

zerofool commented 2 years ago

Describe the bug When I tried using the program, I got the following message: "Can't process convert resume.dat" and after ~30 seconds the console becomes responsive again.

After many experiments, I found what was causing this - if the trackers in the list are not properly separated by an empty line, it fails. Such trackers appear as a separate "ITEM" subgroup in the BEncode Editor. Please account for such cases by implementing functionality which fixes such occurrences.

To Reproduce I'm attaching an archive containing example resume.dat files and torrents - one is BAD, and the other one has been manually FIXED. DAT.torr.zip

Steps to reproduce the behavior:

  1. Run the program with command pointing to the directory containing the extracted BAD resume.dat file
  2. See error

Expected behavior The program should complete the procedure successfully. It should account for cases like this and fix occurrences of trackers not separated by empty line (as seen in the uTorrent Torrent Properties window), or empty tracker lines (three consecutive empty lines, as seen in the uTorrent Torrent Properties window, see the first attached screenshot below).

Desktop:

An extra request Please consider adding the option to display more details why the program fails, why it can't process the resume.dat file. I fear that even if the issue above is fixed, there will be other issues with some of the rest of my torrents (~3400 in total).

Screenshots Screenshots to help explain the problem and the solution. They were taken in Win10 to avoid messing all my torrents on the Win7 machine: torr1_BADvsFixed torr2_BADvsFixed torr3_BADvsFixed torr4_BADvsFixed

rumanzo commented 2 years ago

You made great work! Will fix it soon

zerofool commented 2 years ago

Just a quick update - I'm ashamed to say that even though I've been using uTorrent for over 15 years, I'm learning just now that it supported tracker tiers. :blush:

According to the help file:

Does µTorrent support multi-tracker .torrent files? Yes, µTorrent supports multi-tracker .torrent files. µTorrent announces to all tracker tiers simultaneously, but only one tracker per tier.

Apparently uTorrent treats trackers which are bundled one after another without a separating empty line (like the examples above, the ITEM sub-group) as a single tier, similarly to the qBittorrent tracker tier behavior I suppose.

If technically possible, please take this information into consideration when implementing the fix - basically "port" these tiers from uT to the qbt tiers, if you think it's a good idea.

rumanzo commented 2 years ago

I rewrited handling trackers function and add functionality for different tiers. Check it out https://github.com/rumanzo/bt2qbt/commit/b66b5f8e75a21a303a12c0b34737b763d8fad180 https://github.com/rumanzo/bt2qbt/releases/tag/v1.16 Let me know if it helps you