RSS Downloader Directory placeholders

Other platforms, generic questions.
Post Reply
ATGardner

RSS Downloader Directory placeholders

Post by ATGardner »

Is it possible to use some kind of placeholder tags when selecting the target directory of the RSS downloader?
I'd like to use some generic RSS feed, and basically download everything that's on it. But use each entry's "name" field as a subfolder to download to.
Is there such a feature available somehow?
ciaobaby

Re: RSS Downloader Directory placeholders

Post by ciaobaby »

Click the [ RSS Downloader ] button and set some filers using the "Must Contain" and "Must Not Contain"  fields,  plus the "Save to a Different Directory" field.
ATGardner

Re: RSS Downloader Directory placeholders

Post by ATGardner »

I don't want to change the filters. I don't want to filter anything. I want to download every entry that appears in the feed.
I just want all entries that come with name "A" to be downloaded to "/downloads/A", and all entries that come with name "B" to be downloaded to "/downloads/B".
Is there a way to put some sort of place holder text in the "Save to" text box?
ciaobaby

Re: RSS Downloader Directory placeholders

Post by ciaobaby »

I don't want to change the filters.
You don't really have a choice, if you want to route downloads to a different folder, 'filters' ARE the only way to do that.
I just want all entries that come with name "A" to be downloaded to "/downloads/A", and all entries that come with name "B" to be downloaded to "/downloads/B".
So use a regular expression as the 'must contain' filter ie;

^[Aa].+$
or
^A|a.*$

which would route anything starting with 'A' or 'a' to the folder specified in the "Save to a different directory.

^[Bb].+$

Would route the 'B's


Basic Regular Expression tutorial:

^ means "At the start of the string"
$ means "At the end of the string"
. means "Any character"
.+ means "One or more characters"
.* means zero or more characters
Square brackets indicate a character class so [A-Z} means any upper case character [A-Za-z] means any alpha characters
'curly' brackets { } signify a count of the preceding character e.g. [0-9]{2.4} means match two to four numerals.


More regex at Regular Expression .info
ATGardner

Re: RSS Downloader Directory placeholders

Post by ATGardner »

Thanks, but this is exactly what I don't want to do.
I understand how to make different filters for different torrent types. I wanted to create one filter for all of them, with a placeholder in the directory name. That is the feature I am looking for.
Is there some qBittorrent feature request forum? Anywhere I can maybe see if such a feature is being worked on?
ciaobaby

Re: RSS Downloader Directory placeholders

Post by ciaobaby »

You do not need a 'feature request'  it is ALREADY THERE.

I do this for ONE feed (Mininova)  and use regular expressions to route items from the one feed to different labels and different folders based on words that appear (or do not appear) in the item description or title of the item(s) in the feed. At the moment, given the propensity of some up-loaders to flood the feed with fake'games that are actually virus payloads, I have a "must not contain" 'filter' for routing to the main download location, which seems to be precisely what you want to do, if it is not the case, ... ... Then a better explanation of your EXACT requirements is needed.

The download rules are matched in the order they appear in the list, so your "Match All" rule needs to be the last in the list.
ATGardner

Re: RSS Downloader Directory placeholders

Post by ATGardner »

we keep writing the same thing over and over:
you have 1 feed, and you make several different filters using regexp, to different folders.

I have 1 feed, and I want to make 1 (and only 1) filter for it, and download the torrents to
~/Downloads/${entry-name}

for example

so yeah - it seems that this feature is not currently available, and I'd like to request it.
When I later manage my feed, and add another entry to it somehow, I don't want to go to my qbittorrent settings, and change/add filters. I just want it downloaded to the right directory, according to the entry name (or some other field)
ciaobaby

Re: RSS Downloader Directory placeholders

Post by ciaobaby »

I have 1 feed, and I want to make 1 (and only 1) filter for it, and download the torrents to
~/Downloads/${entry-name}

What is it that you are not getting about this being EXACTLY what the [ RSS Downloader ] button actually does???

Please tell me why you are not understanding it and I'll find another way to explain it.

If you want to put ALL torrents from the feed into one particular folder you put a '*' in the "Must contain".


If you want to separate some only some torrents by, you create a filter that has a specific word or words BEFORE the "ALL" 'filter using the '*'


All I can suggest is that you try it for yourself. Your position at the moment seems to be "I don't think that is correct, ... so you [meaning me] must be incorrect.

I am not suggesting that what I tell you is fundamentally and absolutely correct (that would be religion), what I am telling you is .... This is how I use the RSS Downloader now go and try it for yourself.
If it does NOT work, then come back and explain what YOU did and we can work out what may have gone awry.
ATGardner

Re: RSS Downloader Directory placeholders

Post by ATGardner »

I'll try explaining again
Let's say I have an RSS feed of torrents. Each entry has a category (for example). Some are of category "a", and some are of category "b". The category does not necessarily appear in the torrents title.
I want the RSS Downloader to download everything, and put each down file into a subfolder according to it's category. So "a" category torrents should go to "~/Downloads/a", and "b" category torrents should go to "~/Downloads/b"

If I can count on the category to appear in the title, I could write a regexp filter for the "a" category, and save them to "~/Downloads/a". I could do the same to the "b" category torrents. But lets say that suddenly my RSS feed starts having category "c" and "d" and "e" torrents. Now I have to go back to my qBittorrent machine, and add more and more Download Rules.
I would much rather create a single Download Rule, with a single filter ("*" filter, for example), that saves each torrent to "~/Downloda/${category}" folder, and have the qBittorrent RSS Downloader automatically replace the "${category}" string in the path, with each entry's category. That way I won't have to do anything in qBittorrent whenever new categories appear. And I also won't need to rely on categories to appear in the torrent's title (which is the only field currently being tested by the filter's regexp, if I understand correctly).

I tried downloading and compiling qBittorrent on my machine today, as a first step to implementing this feature. I already figured out where in the code I should add this (rssdownloadrule should keep the path as a string, and rssfeed should get it from the rule, extract the real value from the article, and replace the placeholder with the value, before continuing). But I failed compiling the app, probably because something I skipped in the QT5 compilation (I am missing the lrelease.exe file, whatever that means). I hope to get it going sometimes next week, so I can have some pull request or POC to offer.
ciaobaby

Re: RSS Downloader Directory placeholders

Post by ciaobaby »

Each entry has a category (for example). Some are of category "a", and some are of category "b". The category does not necessarily appear in the torrents title.
If the information you want to use does not appear in the item title, .... .... You cannot use it to sort the items.
and have the qBittorrent RSS Downloader automatically replace the "${category}"
You can't, for that the RSS downloader would need to have scripting capabilities that can handle  if ... then ... else if ... else ... end if constructs, and regular expressions only work on regular (that's where the name comes from) and therefore repeatable patterns in strings of text. If the input data changes the pattern will just fail to match

I would suggest that you write an external script that reads the feed and send then sends the appropriate data to qbittorrent using the web API.
ATGardner

Re: RSS Downloader Directory placeholders

Post by ATGardner »

Thanks for the web api idea. I haven't thought about that. I'll check it out as well.

But I think a simple pattern match and replace shouldn't be that hard to implement. I just need to extract all the placeholders by something like /\${(.*?)}/g (that's in javascript. I assume there's a similar equivalent in QRegExp), and then replace it with the proper value from the current Article entry.
As soon as I manage to compile qBittorrent on my computer, I'll give it a shot.
ciaobaby

Re: RSS Downloader Directory placeholders

Post by ciaobaby »

But I think a simple pattern match and replace shouldn't be that hard to implement.
Certainly, but by their nature regular expressions are a fixed pattern and have no means of 'knowing' if the input string has changed, and how it is supposed to 'react' to that change.
Post Reply