next
This commit is contained in:
9
check_metadata/checkMetadata/__main__.py → check_metadata/check_metadata.py
Normal file → Executable file
9
check_metadata/checkMetadata/__main__.py → check_metadata/check_metadata.py
Normal file → Executable file
@ -13,6 +13,8 @@ import subprocess
|
||||
import datetime
|
||||
from dataclasses import dataclass
|
||||
from tqdm import tqdm
|
||||
import operator
|
||||
|
||||
|
||||
@dataclass
|
||||
class MediaFile:
|
||||
@ -25,7 +27,7 @@ class MediaFile:
|
||||
duration: int #in sec
|
||||
|
||||
def supported_file_extension(filename):
|
||||
if filename.endswith('.mp4') or filename.endswith('.mkv'):
|
||||
if filename.endswith('.mp4') or filename.endswith('.mkv') or filename.endswith('.m4v'):
|
||||
return True
|
||||
return False
|
||||
|
||||
@ -97,8 +99,11 @@ def scan_files(path):
|
||||
return media_files
|
||||
|
||||
def print_all(media_files):
|
||||
media_files.sort(key=lambda x: x.size, reverse=True)
|
||||
for media_file in media_files:
|
||||
print ("{:<64} | {:<8} | {:<16} | {:<8} | {:<16}".format(cut_file_name(media_file.name, 64), str(datetime.timedelta(seconds=media_file.duration)).split(".")[0], human_readable_size(media_file.size), media_file.codec, str(media_file.resolution[0])+"x"+str(media_file.resolution[1])))
|
||||
# print ("{:<64} | {:<8} | {:<16} | {:<8} | {:<16}".format(cut_file_name(media_file.name, 64), str(datetime.timedelta(seconds=media_file.duration)).split(".")[0], human_readable_size(media_file.size), media_file.codec, str(media_file.resolution[0])+"x"+str(media_file.resolution[1])))
|
||||
if int(media_file.resolution[0]) >= 1800 and media_file.codec != "av1" and media_file.codec != "vp9" and media_file.codec != "h265":
|
||||
print ('"'+media_file.name+'" ', end='')
|
||||
|
||||
def print_codecs(media_files):
|
||||
codecs = list()
|
Reference in New Issue
Block a user