podcast-dl icon indicating copy to clipboard operation
podcast-dl copied to clipboard

Enhancing template options

Open 0x646a73 opened this issue 10 months ago • 2 comments
trafficstars

Curious if among past comments here anyone has asked about some of these options for templating:

  • Strip spaces
  • Strip special characters
  • Replace spaces with underscores
  • Replace " - " or ": " with underscores
  • Convert to UpperCamelCase

e.g. "Serial- S01 E01: The Alibi" --> "Serial_S01E01_TheAlibi"

Don't want to expand the scope too far beyond what maintainer is interested in, so seeing if there's interest here.

0x646a73 avatar Jan 06 '25 19:01 0x646a73

How do you expect these options to be specified?

For example: -B (Strip spaces), -S (Strip special chars), -BU (Replace blank with underscore), -JU (Replace joining chars of - and : by underscore) AND finally -Camel?

Thoughts, suggestions?

rajeevaroraau avatar Feb 13 '25 04:02 rajeevaroraau

Locally, I implemented --alphanumeric and --upperCamelCase flags, and applied them to both the title and podcastTitle fields whenever they were set.

More flexible would be to include the options as flags within the templating, e.g.

  • Current: --episode-template "{{podcast_title}} - {{title}}"
  • Updated: --episode-template "{{podcast_title -C -S -B}} - {{title -J}}

But in my opinion, specifying the string manipulation on a per-field basis like the above is overkill. Really it's just the title and podcastTitle fields that would be affected.

0x646a73 avatar Feb 21 '25 20:02 0x646a73

Now that this has marinated a bit, what are your thoughts? @lightpohl

It would spare me (maybe others) from passing the downloaded files through a file-renamer after downloading, but if it's beyond your intended scope, feel free to close the issue.

How others are archiving the six-bajillion podcasts out there, idk, but this has saved me dozens of hours. ty.

0x646a73 avatar Aug 16 '25 03:08 0x646a73