diff --git a/bin/gpo b/bin/gpo index 4509d37..0b33bdf 100755 --- a/bin/gpo +++ b/bin/gpo @@ -898,15 +898,24 @@ class gPodderCli(object): Use {pending} to see a list of episodes that would be downloaded. """ count = 0 + max = self._config.get_field('limit.downloads.podcast_max_new') for podcast in self._get_podcasts(url): podcast_printed = False + current = 0 for episode in podcast.episodes: + if episode.state == gpodder.STATE_DOWNLOADED: + current += 1 + if current >= max: + break if self._is_episode_new(episode): if not podcast_printed: out(inblue(podcast.title)) podcast_printed = True self._download_episode(episode) count += 1 + current += 1 + if current >= max: + break self._download_summary(count) return True @@ -1136,7 +1145,7 @@ class gPodderCli(object): out(*args) def _checkargs(self, func, command_line): - args, varargs, keywords, defaults = inspect.getargspec(func) + args, varargs, keywords, defaults, _, _, _ = inspect.getfullargspec(func) args.pop(0) # Remove "self" from args defaults = defaults or () minarg, maxarg = len(args)-len(defaults), len(args) diff --git a/src/gpodder/config.py b/src/gpodder/config.py index 5c1cae5..1387ced 100644 --- a/src/gpodder/config.py +++ b/src/gpodder/config.py @@ -43,6 +43,7 @@ 'downloads': { 'enabled': True, 'concurrent': 1, + 'podcast_max_new': 200, # per podcast download limit same as episode limit }, 'episodes': 200, # max episodes per feed },