Thanks Starson17 for the reply.
Unfortunately, I don't have that much Python experience (coming from .Net background) to do magic, but I guess I don't demand that much. It would be very convenient to have some global variables, which would always hold the context of currently processed article. Context could hold the source RSS item tag as well as already parsed metadata. This way, all would be well.
Currently you're dependent on the method parameters passed in and if the required object is not given to the method, you're stuck. Having a context at hand would solve all this and it would greatly simplify the recipe code. Basically for each article, you'll have a lifecycle (which you already have sort of) and you could plug your custom logic at each step and modify the context instead of recieving and returning objects.
Your solution is clever workaround for the lack of context, but a more robust way would be nice. This counter decrementing seems to rely too much on articles processed in proper order (as returned by the iterator) which I've learned the hard way is not always the case and can't be taken for granted. For example if parsing of article fails for whatever reason and is caught and handled, the recipe continues on the next article. In such case your entire code loses consistency as the counter is off.
The reasons I want to solely rely on RSS in this example is that I'm doing centralized processing and redistribution of the content. The content owner requires to parse only the RSS feed, article parsing would be considered copyright infringement.
Anyway, Calibre is a great piece of software and I'm sure I'll find a way to solve this. The worst case scenario is missing pictures
If Kovid wants to add his 2c I'm all ears