podcast-dl 8.0.1 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/bin/async.js +1 -1
- package/bin/commander.js +1 -1
- package/bin/naming.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,6 +71,7 @@ Options that support templating allow users to specify a template for the genera
|
|
|
71
71
|
|
|
72
72
|
- `title`: The title of the episode.
|
|
73
73
|
- `release_date`: The release date of the episode in `YYYYMMDD` format.
|
|
74
|
+
- `episode_num`: The location number of where the episodes appears in the feed.
|
|
74
75
|
- `url`: URL of episode audio file.
|
|
75
76
|
- `duration`: Provided `mm:ss` duration (if found).
|
|
76
77
|
- `podcast_title`: Title of the podcast feed.
|
package/bin/async.js
CHANGED
package/bin/commander.js
CHANGED
package/bin/naming.js
CHANGED
|
@@ -12,6 +12,7 @@ const getSafeName = (name) => {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const getFilename = ({ item, ext, url, feed, template }) => {
|
|
15
|
+
const episodeNum = feed.items.length - item._originalIndex;
|
|
15
16
|
const formattedPubDate = item.pubDate
|
|
16
17
|
? dayjs(new Date(item.pubDate)).format("YYYYMMDD")
|
|
17
18
|
: null;
|
|
@@ -19,6 +20,7 @@ const getFilename = ({ item, ext, url, feed, template }) => {
|
|
|
19
20
|
const templateReplacementsTuples = [
|
|
20
21
|
["title", item.title || ""],
|
|
21
22
|
["release_date", formattedPubDate || ""],
|
|
23
|
+
["episode_num", episodeNum],
|
|
22
24
|
["url", url],
|
|
23
25
|
["podcast_title", feed.title || ""],
|
|
24
26
|
["podcast_link", feed.link || ""],
|