Merge pull request #132 from arabcoders/dev

Log manually archived into separate log file
This commit is contained in:
Abdulmohsen 2024-10-31 23:57:39 +03:00 committed by GitHub
commit 40d2f83b65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1444 additions and 1909 deletions

1005
Pipfile.lock generated

File diff suppressed because it is too large Load diff

View file

@ -18,6 +18,7 @@ class Config:
temp_path: str = '{download_path}'
temp_keep: bool = False
db_file: str = '{config_path}/ytptube.db'
manual_archive: str = '{config_path}/archive.manual.log'
url_host: str = ''
url_prefix: str = ''

View file

@ -664,6 +664,20 @@ class Main:
with open(file, 'a') as f:
f.write(f"{idDict['archive_id']}\n")
manual_archive = self.config.manual_archive
if manual_archive:
previouslyArchived = False
if os.path.exists(manual_archive):
with open(manual_archive, 'r') as f:
for line in f.readlines():
if idDict['archive_id'] in line:
previouslyArchived = True
break
if not previouslyArchived:
with open(manual_archive, 'a') as f:
f.write(f"{idDict['archive_id']} - at: {datetime.now().isoformat()}\n")
LOG.info(f'Archiving item: {data["url"]=}')
@self.sio.event()

File diff suppressed because it is too large Load diff