1

I have a windows program which can download streams, I specify the output. Would like to use as output filename the epoch time + extension (for example mp4). I've tried this example but doesn't work:

PS C:\>streamlink --hls-live-restart -o (Get-Date -Date ((Get-Date).DateTime) -UFormat %s)+".mp4" URL best

How can I format the filename properly?

Smeterlink
  • 716
  • 6
  • 20

1 Answers1

1

Solved by myself. The filename has to be output from $() and perform all concatenation operations inside:

PS C:\> echo (Get-Date -Date ((Get-Date).DateTime) -UFormat %s)+".mp4"
1585338575
+.mp4
PS C:\> echo $((Get-Date -Date ((Get-Date).DateTime) -UFormat %s)+".mp4")
1585338562.mp4

Proper command:

streamlink --hls-live-restart -o $((Get-Date -Date ((Get-Date).DateTime) -UFormat %s)+".mp4") URL best
Smeterlink
  • 716
  • 6
  • 20