Skip to content

Commit

Permalink
t5
Browse files Browse the repository at this point in the history
  • Loading branch information
carlospolop committed Jan 9, 2025
1 parent 47483a8 commit 86fd3a2
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 146 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# Build the mdBook
- name: Build mdBook
run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
run: MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)

# Cat hacktricks-preprocessor.log
#- name: Cat hacktricks-preprocessor.log
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_af.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_hi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_sr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_sw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_uk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/translate_zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,9 @@ jobs:
done
python scripts/translator.py --language "$LANGUAGE" --branch "$BRANCH" --api-key "$OPENAI_API_KEY" -f "$(cat /tmp/file_paths.txt)" -t 3
- name: Commit and push changes
run: |
git checkout $BRANCH
git add -A
git commit -m "Translated $LANGUAGE files" || true
git push --set-upstream origin $BRANCH
- name: Build mdBook
run: |
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (cat hacktricks-preprocessor-error.log && exit 1)
MDBOOK_BOOK__LANGUAGE=$BRANCH mdbook build || (echo "Error logs" && cat hacktricks-preprocessor-error.log && exit 1)
# Login in AWs
- name: Configure AWS credentials using OIDC
Expand Down
8 changes: 4 additions & 4 deletions hacktricks-preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def ref(matchobj):
match = re.search('<title>(.*?)</title>', raw_html)
title = match.group(1) if match else href
except Exception as e:
logger.debug(f'Error opening URL {href}: {e}')
pass #nDont stop on broken link
logger.error(f'Error opening URL {href}: {e}')
pass #Dont stop on broken link
else:
try:
if href.endswith("/"):
Expand All @@ -73,7 +73,7 @@ def ref(matchobj):
title = chapter["name"]
logger.debug(f'Recursive title search result: {chapter["name"]}')
except Exception as e:
logger.debug(e)
logger.error(f"Error: {e}")
logger.error(f'Error getting chapter title: {path.normpath(path.join(dir,href))}')
sys.exit(1)

Expand Down Expand Up @@ -101,7 +101,7 @@ def files(matchobj):
logger.debug(f'File search result: {os.path.join(root, href)}')

except Exception as e:
logger.debug(e)
logger.error(f"Error: {e}")
logger.error(f'Error searching file: {href}')
sys.exit(1)

Expand Down
Loading

0 comments on commit 86fd3a2

Please sign in to comment.