hide cookie after rescan and download process
This commit is contained in:
parent
83beb53860
commit
1613b71942
|
@ -41,6 +41,7 @@ class DownloadPostProcess:
|
|||
self.auto_delete_all()
|
||||
self.auto_delete_overwrites()
|
||||
self.validate_playlists()
|
||||
self.clear_cookie()
|
||||
|
||||
def auto_delete_all(self):
|
||||
"""handle auto delete"""
|
||||
|
@ -140,6 +141,11 @@ class DownloadPostProcess:
|
|||
else:
|
||||
RedisArchivist().set_message("message:download", mess_dict)
|
||||
|
||||
def clear_cookie(self):
|
||||
"""hide cookie file"""
|
||||
if self.download.config["downloads"]["cookie_import"]:
|
||||
CookieHandler().hide()
|
||||
|
||||
|
||||
class VideoDownloader:
|
||||
"""
|
||||
|
|
|
@ -12,6 +12,7 @@ import shutil
|
|||
import subprocess
|
||||
|
||||
from home.src.download.queue import PendingList
|
||||
from home.src.download.yt_cookie import CookieHandler
|
||||
from home.src.download.yt_dlp_handler import VideoDownloader
|
||||
from home.src.es.connect import ElasticWrap
|
||||
from home.src.index.reindex import Reindex
|
||||
|
@ -308,6 +309,12 @@ def scan_filesystem():
|
|||
def reindex_old_documents():
|
||||
"""daily refresh of old documents"""
|
||||
handler = Reindex()
|
||||
handler.check_outdated()
|
||||
handler.reindex()
|
||||
RedisArchivist().set_message("last_reindex", handler.now, expire=False)
|
||||
if handler.config["downloads"]["cookie_import"]:
|
||||
CookieHandler().use()
|
||||
try:
|
||||
handler.check_outdated()
|
||||
handler.reindex()
|
||||
RedisArchivist().set_message("last_reindex", handler.now, expire=False)
|
||||
finally:
|
||||
if handler.config["downloads"]["cookie_import"]:
|
||||
CookieHandler().hide()
|
||||
|
|
Loading…
Reference in New Issue