Skip to content

Torrent Scraper

Torrent Scraper #68

name: Torrent Scraper
on:
schedule:
- cron: "0 */6 * * *" # Запуск кожні 6 годин
workflow_dispatch: # Дозволяє ручний запуск workflow
jobs:
run_script:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests beautifulsoup4 bencodepy tqdm # Встановлює залежності, якщо вони не включені
- name: Run the script
run: |
python main.py
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: scraped-data
path: |
igruha-hydra-links.json
parser.log
stats_output.txt
cache/
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git stash # Stash any uncommitted changes
git pull --rebase # Pull the latest changes from the remote repository
git stash pop # Apply stashed changes bac
git add .
COMMIT_MESSAGE=$(cat stats_output.txt)
git commit -m "$COMMIT_MESSAGE" || echo "No changes to commit"
git push