Code Monkey home page Code Monkey logo

rtorrent-cleanup's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rtorrent-cleanup's Issues

RuntimeError: Maximum recursion depth exceeded

When trying to run this code. I ran into an issue "RuntimeError: Maximum recursion depth exceeded"

return walk(exp, index + endsub)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk
return walk(exp, index + endsub)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk
return walk(exp, index + endsub)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk
return walk(exp, index + endsub)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk
return walk(exp, index + endsub)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk
return walk(exp, index + endsub)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk
return walk(exp, index + endsub)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk
return walk(exp, index + endsub)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 58, in walk endsub = walk(exp[index:], 1)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk
return walk(exp, index + strlength)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 47, in walk
return walk(exp, endchar + 1)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk
return walk(exp, index + strlength)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 58, in walk
endsub = walk(exp[index:], 1)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk
return walk(exp, index + strlength)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk
return walk(exp, index + strlength)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk
return walk(exp, index + strlength)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk
return walk(exp, index + strlength)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 52, in walk
strlength = stringlength(exp, index)
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 33, in stringlength
n = int(collapse(num)) # Collapse them, and turn them into an int.
File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 20, in collapse
return reduce(lambda x, y: x + y, data)
RuntimeError: maximum recursion depth exceeded
bobokun@raspberrypi ~/install/rtorrent-cleanup $

Unicode error

When running this script (only tested with the --dry parameter), I get the following error:

found 889 downloaded files
found 879 rtorrent files
Traceback (most recent call last):
  File "~/./rtorrent_cleanup.py", line 154, in <module>
    main(args.rtorrent_working_dir, args.rtorrent_download_dirs)
  File "~/./rtorrent_cleanup.py", line 90, in main
    if check_if_single_file_torrent(torrent_file):
  File "~/./rtorrent_cleanup.py", line 21, in check_if_single_file_torrent
    content = f.read()
  File "/usr/lib/python-exec/python3.9/../../../lib/python3.9/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdf in position 876: invalid continuation byte

I guess one of my downloads contains some weird unicode that can't be parsed in utf-8... but I'm not sure which? I haven't dabbled in python yet...

Not working, selects all files

So I just ran a dry run and it selected everything. Then I tried it with the test files included in this repo and it did the same. Am I doing something wrong?

./rtorrent_cleanup.py  ./tests/testenv_template/workingdir/ ./tests/testenv_template/downloaddir/ --dry --debug
debug_flag=True
dryrun_flag=True
rtorrent_working_dir=./tests/testenv_template/workingdir/
rtorrent_download_dirs=['./tests/testenv_template/downloaddir/']
found 2 downloaded files
found 2 rtorrent files
single-file torrent: {{pathtotestenv}}/downloaddir/file1.txt
multi-file torrent: {{pathtotestenv}}/downloaddir/directory1
found 2 files that were referenced
found 2 files that were not referenced
deleting all unreferenced files will free up 16B of storage
Not referenced files:
./tests/testenv_template/downloaddir/directory1
./tests/testenv_template/downloaddir/file1.txt

It sees the 2 files, but seems to think they are both referenced and not referenced.

When I don't do a dry run it deletes directory1 and file1.txt

Running the script on Debian 8.8, and Python 2.7.9

Feature request: filter set by tracker

Feature request:
A way to filter the "set of files to deleted" by tracker.

Example:
./rtorrent-cleanup.py working_dir download_dir --filter-by-tracker mytracker

What I want to solve:
Sometimes the mess is so stronk, I need to do it one tracker at a time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.