Repository navigation
定时抓取清洗节点 #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 每日抓取免费节点 | |
| on: | |
| schedule: | |
| - cron: '00 23 * * *' | |
| workflow_dispatch: # 手动触发 | |
| jobs: | |
| scrape: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pip install requests beautifulsoup4 pyyaml | |
| - name: Run scraper | |
| run: python scraper.py | |
| - name: Download and process node files | |
| run: python process_nodes.py | |
| - name: Commit and push | |
| run: | | |
| git config user.name "yoyapai-bot" | |
| git config user.email "bot@yoyapai.com" | |
| git stash | |
| git pull --rebase | |
| git stash pop | |
| git add newest.yaml newest.txt | |
| git diff --cached --quiet || git commit -m "update: $(TZ=Asia/Shanghai date +%Y-%m-%d) 节点订阅" | |
| git push |