Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ In podfox, every podcast is identified with its own `shortname`, which is restri
podfox.py feeds
podfox.py episodes <shortname>
podfox.py download [<shortname> --how-many=<n>]
podfox.py fetch [<shortname> --how-many=<n>]
```
### Import

Expand Down Expand Up @@ -107,3 +108,7 @@ Extortion Startups | TechSNAP 229 | Not Downloaded

`podfox download ts --how-many=3` will download the 3 newest techsnap podcasts that have not yet been downloaded. (Skipping newer, but already downloaded ones). If the `--how-many` parameter is omitted, the `maxnum` parameter from the configuration file is used instead.

### Fetch

`podfox fetch` will go through the `update` and `download` processes together,
allowing the user to run both with a single command.
24 changes: 24 additions & 0 deletions podfox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
podfox.py feeds [-c=<path>]
podfox.py episodes <shortname> [-c=<path>]
podfox.py download [<shortname> --how-many=<n>] [-c=<path>]
podfox.py fetch [<shortname> --how-many=<n>] [-c=<path>]
podfox.py rename <shortname> <newname> [-c=<path>]

Options:
Expand Down Expand Up @@ -375,5 +376,28 @@ def main():
for feed in available_feeds():
download_multiple(feed, maxnum)
exit(0)
if arguments['fetch']:
if arguments['--how-many']:
maxnum = int(arguments['--how-many'])
else:
maxnum = CONFIGURATION['maxnum']
#download episodes for a specific feed
if arguments['<shortname>']:
feed = find_feed(arguments['<shortname>'])
if feed:
print_green('updating and downloading {}'.format(feed['title']))
update_feed(feed)
download_multiple(feed, maxnum)
exit(0)
else:
print_err("feed {} not found".format(arguments['<shortname>']))
exit(-1)
#download episodes for all feeds.
else:
for feed in available_feeds():
print_green('updating and downloading {}'.format(feed['title']))
update_feed(feed)
download_multiple(feed, maxnum)
exit(0)
if arguments['rename']:
rename(arguments['<shortname>'], arguments['<newname>'])