26 lines
674 B
Bash
Executable File
26 lines
674 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
cd "$SCRIPT_DIR/.."
|
|
source "$SCRIPT_DIR/../.env"
|
|
"$SCRIPT_DIR/.venv/bin/python3" -c "
|
|
import asyncio, sys, logging
|
|
sys.path.insert(0, '$SCRIPT_DIR')
|
|
from db import init_db
|
|
from fetcher import fetch_subscriptions
|
|
from summarizer import summarize_all_pending
|
|
|
|
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s')
|
|
|
|
async def main():
|
|
await init_db()
|
|
count = await fetch_subscriptions()
|
|
print(f'Fetched {count} new videos')
|
|
if count > 0:
|
|
print(f'Summarizing {count} videos...')
|
|
await summarize_all_pending()
|
|
print('Done')
|
|
|
|
asyncio.run(main())
|
|
"
|