For proper automation, you probably want a script in python or ruby to use some torrent library, but if you usually use a more flexible selection of files, then you can try using the web interfaces that many torrent clients offer.
As an example, we use the Tixati client and a hypothetical torrent, where there are hundreds of directories, each of which has a subdirectory that you do not need (let it be called "RUS"). So, after enabling the web interface from the Tixati settings, you will go to localhost: 8888, open the javascript console and write something like this:
var jq = document.createElement('script'); jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); $('.xferstable tr:has(td)').each(function(i,td){ var fname= $('td:eq(1)', td).text(); $('input', td).prop('checked', fname.match(/\\RUS\\/) == null); })
You can visually check that he has selected the files you need and click "Apply", et voilà.
source share