from paramiko import SSHClient # type: ignore
from scp import SCPClient # type: ignore
from ytplom.db import DbConn, Hash, PATH_DB
-from ytplom.misc import (
- PATH_TEMP, Config, QuotaLog, VideoFile, YoutubeQuery, YoutubeVideo)
+from ytplom.misc import (PATH_TEMP, Config, FlagName, QuotaLog, VideoFile,
+ YoutubeQuery, YoutubeVideo)
from ytplom.http import PAGE_NAMES
for digest in (d for d in missings[i]
if d not in missings[int(not bool(i))]):
vf = VideoFile.get_one(conn, Hash.from_b64(digest))
- print(f'SYNC: sending {direction} file {vf.full_path}')
+ if vf.is_flag_set(FlagName('do not sync')):
+ print(f'SYNC: not sending ("do not sync" set): {vf.full_path}')
+ return
+ print(f'SYNC: sending {direction}: {vf.full_path}')
mover(vf.full_path, vf.full_path)
TIMESTAMP_FMT = '%Y-%m-%d %H:%M:%S.%f'
LEGAL_EXTENSIONS = {'webm', 'mp4', 'mkv'}
FILE_FLAGS: dict[FlagName, FlagsInt] = {
+ FlagName('do not sync'): FlagsInt(1 << 62),
FlagName('delete'): FlagsInt(-(1 << 63))
}