chandler-stimson / live-stream-downloader

Download M3U8 live streams to the local disk
https://webextension.org/listing/hls-downloader.html
201 stars 70 forks source link

[Feature request] Filter illegal characters from filename #46

Open gruppler opened 7 months ago

gruppler commented 7 months ago

When using [title] in the filename format, I'm unable to download the file because it contains illegal characters ("|").

gruppler commented 7 months ago

It would also be nice to see the meta.name in the list regardless of the filename format, since using [title] makes all the files appear the same in the download selection list. Perhaps underneath the generated filename, you could also show the meta.name?

chandler-stimson commented 7 months ago

The extension tries to extract the filename from the "Content-Disposition" header. If this fails, it tries to extract the name from the link. So, we are not using page titles. Can you provide an example?

gruppler commented 7 months ago

You are not using page titles, even if I set the filename format to [title]?

Unfortunately, the videos I'm trying to download are behind a paywall so I would have to find another example. But I can see in the page title there is a pipe character (|) which is illegal at least on Windows.

gruppler commented 7 months ago

image Here's a screenshot from a recent attempt.

chandler-stimson commented 7 months ago

Please try the latest commit to see if the issue is fixed or not

gruppler commented 7 months ago

I installed the unpacked extension and set my filename format to [title]. The download succeeded, but when the Save dialog popped up, the name was "_undefined.txt" and type was ".txt". When I selected "All files" as the type and manually added the ".mkv" extension, I was able to successfully open the file in a video player. image