video files must be regular files, links will be ignored

This commit is contained in:
lededev
2021-06-05 21:00:35 +08:00
parent d46cd291c0
commit 9f1e6d5206
2 changed files with 13 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import requests
import hashlib
import pathlib
import random
import os.path
import uuid
import json
import time
@@ -567,3 +568,11 @@ def file_modification_days(filename) -> int:
if days < 0:
return 9999
return days
# 检查文件是否是链接
def is_link(filename: str):
if os.path.islink(filename):
return True # symlink
elif os.stat(filename).st_nlink > 1:
return True # hard link Linux MAC OSX Windows NTFS
return False