tgcf icon indicating copy to clipboard operation
tgcf copied to clipboard

ERROR stat: path should be string, bytes, os.PathLike or integer, not NoneType in marking

Open cyberkiller7 opened this issue 2 years ago • 7 comments

In mark pluging stat: path should be string, bytes, os.PathLike or integer, not NoneType this error is coming

image

cyberkiller7 avatar Aug 02 '21 15:08 cyberkiller7

You should update to the latest version of the script. You have 2 errors there. The first is probably caused by forbidden characters in file names. 21:22:59 should be replaced by 21-22-59 or by 21.22.59. By the way, what are you trying to do?

The second error is caused by an incorrect path in your config file. You have to replace path/watermark.jpg with the actual path of the file on your device. For example, D:\photos\image1.jpg or you can upload that image to Imgur and use the address like this https://imgur.com/yiH6ini

Check https://github.com/aahnik/tgcf/wiki/How-to-use--watermarking-%3F

tissole avatar Aug 06 '21 12:08 tissole

Hi @tissole - Can u give an example of path for image without using https (imgur or others) where tgcf is hosted on cloud platform where we do not have any folder access.

mujahidazamcsm avatar Aug 23 '21 18:08 mujahidazamcsm

Hi, I have the same problem I am using the latest version of this program In herouk, with the same command and entering the address, I could make a watermark replacement, but I can't in the window. 123

mahdish45 avatar Sep 03 '21 10:09 mahdish45

I found the source of this error, It occurs only on Windows and is because the script stamps the names of the files with forbidden characters, like :

The solution is to add : to the list of characters to be replaced if occurs in file names. To do that the file utils.py from the tgcf folder has to be modified.

The line 58 looks like this return re.sub(pattern=r"[-!@#$%^&*()\s]", repl="_", string=string) These are the forbidden characters that when occur in file names are replaced by the _ character. Be sure to add : to the list after the \s. It should look like this after modification return re.sub(pattern=r"[-!@#$%^&*()\s:]", repl="_", string=string)

After this modification, the error does not occur anymore and the photos are watermarked correctly.

tissole avatar Sep 04 '21 06:09 tissole

@mujahidazamcsm If you deploy on the cloud you have to use the link of the photo, you cannot use the local path. The link should be put in your config file, see wiki

tissole avatar Sep 04 '21 06:09 tissole

hi im fix this problem but There is another problem tgcf is download my watermark but cant replace 23

mahdish45 avatar Sep 04 '21 11:09 mahdish45

@mahdish45 Make sure you have FFmpeg installed on Windows and added to the path. Check this guide

tissole avatar Sep 04 '21 15:09 tissole