snobu / destreamer

Save Microsoft Stream videos for offline enjoyment.
MIT License
2.37k stars 439 forks source link

Ability to set a custom name without templates restriction #344

Closed goldmont closed 3 years ago

goldmont commented 3 years ago

OS: Ubuntu 20.04

Launch command used: ./destreamer.sh --format mp4 -o out -i "my_url" -t "Lesson 5"

Hi there,

I'm not able to set a custom template name like the one above. I must set at least one of the "magic sequences" to make it work.

For example: "Lesson 5" -> This is not a valid title template. Thus, destreamer refuses to use my custom file name and simply fallbacks to the default one.

"Lesson 5 {author}" -> This one is a valid template. Destreamer accepts my custom title template.

I don't understand this behaviour. Why I can't set a custom name?

goldmont commented 3 years ago

This line is the problem. You are looking for at least one match. Otherwise you set manually the default template here

snobu commented 3 years ago

If you send a PR to amend the regex we'd be happy to merge it.

goldmont commented 3 years ago

You don't have to modify current regex. We only need to verify that there is a match in order to ensure that all the "magic sequences" are correctly spelled. Code from line #197 to line #201 no longer exists. The key part of the formatting process is here. Already fixed and tested. I'm going to make a pull request.