podget(7) | podget(7) |
Podget - Simple tool to automate downloading of podcasts.
podget <options>
Podget is a simple podcast aggregator/downloader optimized for scheduled background jobs (i.e. cron).
It features support for:
- Downloading podcasts from RSS and ATOM XML feeds.
- For sorting the files into folders and categories.
- For importing URLs from iTunes PCAST files and OPML lists.
- Automatic M3U & ASX playlist creation.
- Cleanup of old files.
- Automatic UTF-16 conversion for feeds hosted on MS Windows Servers.
By default, Podget relies on two configuration files.
If it is required to run podget with different options for certain feeds, then additional configuration files can be created and used with the --config or -c option. When this option is run with a new filename that does not exist yet, the file is created with default options that can then be customized as necessary.
If you need to separate your feeds into multiple lists, then additional files can be created with the --serverlist option. When this option is run with a new filename that does not exist yet, the file is created with a default list of a single feed. Whenever a new list is created, Podget will download a single item from the single feed included by default to verify that everything is working.
For a description of the options available for this file, please refer to the SERVER LIST CONFIGURATION section of this document.
The first time a user runs podget, it will create a configuration directory. In this directory, it will install the default configuration files.
Where this configuration directory is automatically placed is dependent upon the version of Podget that you used when you first ran it.
For version 0.8.10 and before:
For later versions:
If a user wants to clean up their $HOME directory by moving their existing configuration directory to either of the new locations, it can be done but it is necessary to remember to remove the leading period so it is no longer a hidden directory.
These locations can be overridden by the use of the --dir_config or -d option when you run podget.
Since there are at least three possible locations for the configuration directory then it is necessary to know which one podget will use. To keep things simple, Podget uses the first one it finds and tests in the following order:
1. $HOME/.podget
2. $XDG_CONFIG_HOME/podget
3. $HOME/.config/podget
This location testing is skipped by the use of the --dir_config or -d option.
You can enable automatic cleanup with every run by configuring it in your podgetrc file. Simply set the following options:
However, some people prefer to run cleanup as a separate cron session. To do that, set the options in podgetrc to:
# Autocleanup.
# 0 == disabled
# 1 == delete any old content
cleanup=1
# Number of days to keep files. Cleanup will remove anything
# older than this.
cleanup_days=7
# Autocleanup.
# 0 == disabled
# 1 == delete any old content
cleanup=0
# Number of days to keep files. Cleanup will remove anything
# older than this.
cleanup_days=7
Then add something similar to this example to your crontab:
# Once a week on Sunday at 04:07AM
07 04 * * Sun /usr/bin/podget -C
Podget checks for sessions using the same core configuration file that may already be running when it starts and exits if any are found. This insures that any long running sessions are not interrupted by new ones.
If you have feeds that require distinct configurations, then you can enable them to run simultaneously by using separate configuration files for each. Then if you have sufficient bandwidth, you can call them all at the same time.
Example Crontab configuration:
00 02 * * * /usr/bin/podget -c podgetrc-group1
00 02 * * * /usr/bin/podget -c podgetrc-group2
Sometimes, you have feed lists that use the same configuration but you wish to keep separate. There are two ways to handle this.
First, run then separately from crontab with sufficient time in between so they don't interfere with each other.
00 02 * * * /usr/bin/podget --serverlist RSS-Feeds
00 03 * * * /usr/bin/podget --serverlist ATOM-Feeds
The second option is to place them into a shell script so they are called sequentially and do not interfere with each other and then add it to your crontab.
#!/usr/bin/env bash
/usr/bin/podget --serverlist RSS-Feeds
/usr/bin/podget --serverlist ATOM-Feeds
Debug output can be enabled in two ways.
The first way is by uncommenting the DEBUG option in your podgetrc and setting it to '1'. However this way will not enable DEBUG until just over 1400 lines of script have run and when podgetrc finally is read. This is sufficient for most issues.
The second way is from the command-line and enables debug as early as possible.
Simply execute podget like so:
$ DEBUG=1 podget -vvvv
You can enable other options as well if you need to but for debugging purposes, it is highly recommended that you enabled as much verbosity as possible.
By default, Podget uses serverlist for the default list of servers to contact. However you can configure the name with the config_serverlist variable in your podgetrc file.
Feeds are listed one per line in the serverlist file.
Default format with category and name:
Alternate Formats:
1. With a category but no name.
<url> No_Category <name>
<url> . <name>
1. URL Rules:
B. You may use underscores and dashes.
C. You can insert date substitutions.
%MM% == Month
%DD% == Day
D. Category disabling:
- With a name, the category must either be a single period (.) or 'No_Category'.
- If the name is blank, the category can also be blank.
3. Name Rules:
A. If you are creating ASX playlists, make sure the feed name does not have any spaces in it and the filename cannot be blank.
B. You can leave the feed name blank, and files will be saved in the category directory.
C. Names with spaces are only compatible with filesystems that allow for spaces in filenames. For example, spaces in feed names are OK for feeds saved to Linux ext partitions but are not OK for those saved to Microsoft FAT partitions.
D. Feed names can be disabled by leaving them blank.
4. Disable the downloading of any feed by commenting it out with a leading #.
Example:
http://www.lugradio.org/episodes.rss Linux LUG Radio
Example with date substitution in the category and a blank feed
name:
http://downloads.bbc.co.uk/rmhttp/downloadtrial/worldservice/summary/rss.xml
News-%YY%-%MM%-%DD%
Example of two ways to do a feed with authentication:
http://somesite.com/feed.rss CATEGORY Feed Name USER:username PASS:password
http://username:password@somesite.com/feed.rss CATEGORY Feed Name
NOTE: The second method will fail if a colon (:) is part of the username or password. Both methods will fail if a space is part of the username or password.
Examples:
http://somesite.com/feed.rss CATEGORY Feed Name OPT_PREFER_IPv4
http://somesite.com/feed.rss CATEGORY Feed Name OPT_PREFER_IPv6
http://somesite.com/feed.rss CATEGORY Feed Name OPT_NO_CERT_CHECK
http://somesite.com/feed.rss CATEGORY Feed Name OPT_CONTENT_DISPOSITION
http://somesite.com/feed.rss CATEGORY Feed Name OPT_CONTENT_DISPOSITION
OPT_DISPOSITION_FAIL
http://somesite.com/feed.rss CATEGORY Feed Name OPT_FILENAME_LOCATION
http://somesite.com/feed.rss CATEGORY Feed Name OPT_FILENAME_RENAME_MDATE
http://somesite.com/feed.rss CATEGORY Feed Name OPT_FILENAME_LOCATION
OPT_FILENAME_RENAME_MDATE
http://somesite.com/feed.rss CATEGORY Feed Name OPT_FEED_ORDER_ASCENDING
http://somesite.com/feed.rss CATEGORY Feed Name OPT_FEED_PLAYLIST_NEWFIRST
http://somesite.com/feed.rss CATEGORY Feed Name
OPT_FEED_PLAYLIST_OLDFIRST
Note: If you do not enable any of the ATOM_FILTER options on a feed with multiple enclosures per item, when you run podget it will tell you the count per type or language to help you decide if you should enable the filters to reduce the number of files to be downloaded.
Examples:
http://somesite.com/feed CATEGORY Feed Name ATOM_FILTER_SIMPLE
http://somesite.com/feed CATEGORY Feed Name
ATOM_FILTER_TYPE="audio/mpeg"
http://somesite.com/feed CATEGORY Feed Name
ATOM_FILTER_TYPE="(audio|video)/.*"
http://somesite.com/feed CATEGORY Feed Name ATOM_FILTER_LANG="en"
http://somesite.com/feed CATEGORY Feed Name
ATOM_FILTER_LANG="(en|es|fr)"
http://somesite.com/feed CATEGORY Feed Name
ATOM_FILTER_TYPE="audio/mpeg" ATOM_FILTER_LANG="en"
Some servers provide their feeds in UTF-16 format rather than the more common UTF-8.
To automatically convert these files, create a secondary serverlist in your configuration directory:
Remember to change the name of the serverlist to match what you set it to with config_serverlist if you changed it.
serverlist.utf16
Once podget is running correctly, it's most useful if you run it from a cron job so that the new episodes are available to play or load onto a portable player and you don't have to wait for them to download.
To edit your crontab, do:
$ crontab -e
Then add one line similar to this example:
15 04 * * * /usr/bin/podget -s
This will run podget at 4:15 AM every day.
In some cases, you might need to add a few directories to your PATH variable so that Podget can find everything it needs.
Then the job might look like:
15 04 * * * PATH=/opt/local/bin:/usr/local/bin:$PATH /usr/bin/podget -s
Dave Vehrs
19 April 2022 |