koztv-blog-tools 1.2.13 → 1.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,9 +44,8 @@ Options:
44
44
  --session-file ./path Session file location (default: ./.telegram-session)
45
45
  --log-file ./path Processed posts log (default: ./.processed-posts.json)
46
46
  --limit N Max posts to export
47
- --langs en,de Target languages (default: en, or TARGET_LANGS env)
48
- --keep-original Keep original language version
49
- --no-translate Skip translation
47
+ --langs en,de Target languages (required for translation)
48
+ --no-original Don't keep original language version
50
49
  --help, -h Show this help
51
50
 
52
51
  Environment variables:
@@ -69,8 +68,7 @@ const LOG_FILE = getArg('log-file') || './.processed-posts.json';
69
68
  const LIMIT = parseInt(getArg('limit') || '0', 10);
70
69
  const TARGET_LANGS_RAW = getArg('langs') || process.env.TARGET_LANGS || '';
71
70
  const TARGET_LANGS = TARGET_LANGS_RAW ? TARGET_LANGS_RAW.split(',').map(s => s.trim()) : [];
72
- const KEEP_ORIGINAL = hasFlag('keep-original') || process.env.KEEP_ORIGINAL === 'true';
73
- const NO_TRANSLATE = hasFlag('no-translate');
71
+ const KEEP_ORIGINAL = !hasFlag('no-original') && process.env.KEEP_ORIGINAL !== 'false';
74
72
 
75
73
  // Credentials
76
74
  const API_ID = parseInt(process.env.TELEGRAM_API_ID || '0', 10);
@@ -118,7 +116,7 @@ async function main() {
118
116
  console.log(`Output: ${OUTPUT_DIR}`);
119
117
  console.log(`Media: ${MEDIA_DIR}`);
120
118
  if (LIMIT) console.log(`Limit: ${LIMIT}`);
121
- if (!NO_TRANSLATE && LLM_API_KEY && TARGET_LANGS.length > 0) {
119
+ if (TARGET_LANGS.length > 0 && LLM_API_KEY) {
122
120
  console.log(`Translate to: ${TARGET_LANGS.join(', ')}`);
123
121
  console.log(`Keep original: ${KEEP_ORIGINAL}`);
124
122
  } else {
@@ -139,7 +137,7 @@ async function main() {
139
137
  limit: LIMIT || undefined,
140
138
  downloadMedia: true,
141
139
 
142
- translate: (!NO_TRANSLATE && LLM_API_KEY && TARGET_LANGS.length > 0) ? {
140
+ translate: (TARGET_LANGS.length > 0 && LLM_API_KEY) ? {
143
141
  apiKey: LLM_API_KEY,
144
142
  apiUrl: LLM_API_URL,
145
143
  model: LLM_MODEL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koztv-blog-tools",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "Shared utilities for Telegram-based blog sites",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",