notsatan / kodi-strm

A python script to batch generate strm files to be able to stream videos in Kodi directly from Google Drive.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with folders with \ or ending with a space character in windows

jaum20 opened this issue · comments

Describe the bug

Scripts breaks if there are some folder name with \ or ending with a space character

To Reproduce
Steps to reproduce the behaviour:

  1. Create a folder in your Google Drive with a space in the end of the name and puth some files there. e.g. "series a ": series/series a /season1
  2. try to create strm files for that folder
  3. Error: `The system cannot find the specified path: 'C:\kodi-strm\users\user\series\series a \season1'

Expected behaviour
script handles the spaces and backslashs and do no break

Screenshots
image

Please fill the following information:

  • OS: Windows
  • Browser brave

Packages Installed:
packages.txt

Additional context

Hm, to side-step the error occurring when a directory contains an extra space I guess I'll just have the script trim the name of each file/directory before using it — there's not much that can be done, most OSes do not allow creating directories with spaces in the end (many of them will silently trim the spaces without informing the user)

As for the error with the blackslash — I do remember* that being deliberate, different OS prohibit different characters from being included in file/directory name. Attempting to keep a track of them, and figure out a work-around would be taxing and pointless

Plus, what should be done with these characters? If a file is name "Episode 1: The First Episode" — should the script remove the colon, replace it with other character, and if so, replace it with what? At the end, I simply left it to the end-users of kodi-strm — you are free to make changes to the original file directly on Drive! All kodi-strm will do is act as a simple script and generate a local STRM file for that file! It won't attempt to guess what a file should have been named


* My memory is horrible; I do remember at some point I tried to work-around illegal characters as well — don't remember if that was in v1 or a feature branch that didn't make it to master — but, I ran into the same problems that I mentioned above