YouROK/TorrServer

Allow for randomization / sanitization of file names

knackrack615 opened this issue · 6 comments

By providing filename randomization as an optional configuration option, it would allow users to overcome compatibility issues with players that do not support special characters in file names.

For example if the current path to a torrent file is: /stream/Big.Bunny.1080p.WEBRip.x264.AAC5.1-%5BREL.GRP%5D.mp4?link=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&index=1&play

Enabling filename randomization would create links that would look something like this: /stream/cc9e8df2ed764528a7ac2f14551cef02.mp4?link=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&index=1&play

tsynik commented

Which players doesn't support special chars in titles? Can you provide example title / URL? Proper way is to escape or filter such chars in URL, not randomize.

An example of such a player would be the media player in the NEOS VR platform.

Neos does some funky things before passing the link to libVLC / Unity Player and sometimes that breaks things (for example, in the link given above, the brackets in "[REL.GRP].mp4" will cause the video to fail to play.

I do agree, the correct way would be to sanitize the file names, however randomizing has the benefit of extra security (Although realistically the benefit would be very minimal).

this has caused me issues in the past it's nice to see it brought up again.

hazre commented

Yeah, it would be nice if the file names were randomly generated so they don't cause issues in any player.

YouROK commented

The file name is not required and can be any name. You can remove the name and use it without it, or put the name you want

The file name is not required and can be any name. You can remove the name and use it without it, or put the name you want

Just verified, this is indeed possible by just specifying the index argument and completely skipping the file name. Thank you!

I think it would be beneficial to everyone if it was made clearer that the filename is optional on the README.