Request: configurable filenames

As far as I can tell, the current logic for picking filenames is roughly


link = {enclosure["href"], entry.link}
downloadlinks[urlparse(link).path.split("/")[-1]] = link
for podname in downloadlinks:
   ...
   Placeholders(..., ..., filename=podname, ..., ...)

All the CD rippers I've used, and also EasyTag, let me normalize filename formats using variables. There's a comment in the config file "# {filename} the name of the file to be downloaded (which need not be the name under which you will save it locally)" which sounds like it is implying I should be able to do this with greg, but I can't figure out how to change the local filename, and unless I'm misreading the code badly this logic insists filename == link.split("/")[-1] (ii.e. $(basename $link)) and gives no way to change it.

I would like a new config option filename_format with default


filename_format = {filename}

I would also like a new variable {n} for the podcast entry's ID number, and {-n} for the podcast entry's ID in reverse -- that is, counting from the start of the podcast -- that is, like its track number; for podcasts like history and audiobooks it is really important to be able to number them in order like this:


filename_format = {-n} - {title}.{ext}

该提问来源于开源项目:manolomartinez/greg

查看全部
weixin_39966922
weixin_39966922
2020/12/01 14:50
  • 点赞
  • 收藏
  • 回答
    私信

3个回复