added archive.manual.log
This commit is contained in:
parent
d0198ccd78
commit
f76e9b8f77
2 changed files with 14 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ class Config:
|
||||||
temp_path: str = '{download_path}'
|
temp_path: str = '{download_path}'
|
||||||
temp_keep: bool = False
|
temp_keep: bool = False
|
||||||
db_file: str = '{config_path}/ytptube.db'
|
db_file: str = '{config_path}/ytptube.db'
|
||||||
|
manual_archive: str = '{config_path}/archive.manual.log'
|
||||||
|
|
||||||
url_host: str = ''
|
url_host: str = ''
|
||||||
url_prefix: str = ''
|
url_prefix: str = ''
|
||||||
|
|
|
||||||
13
app/main.py
13
app/main.py
|
|
@ -664,6 +664,19 @@ class Main:
|
||||||
with open(file, 'a') as f:
|
with open(file, 'a') as f:
|
||||||
f.write(f"{idDict['archive_id']}\n")
|
f.write(f"{idDict['archive_id']}\n")
|
||||||
|
|
||||||
|
manual_archive = self.config.manual_archive
|
||||||
|
if manual_archive:
|
||||||
|
previouslyArchived = False
|
||||||
|
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"]=}')
|
LOG.info(f'Archiving item: {data["url"]=}')
|
||||||
|
|
||||||
@self.sio.event()
|
@self.sio.event()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue