crawl movies and shows #890
This file contains 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: Crawl movies and tvshows | |
on: | |
repository_dispatch: | |
types: | |
- crawl movies and shows | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Start crawling' | |
jobs: | |
job1: | |
name: crawling | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: prepare python environment(v3.11) | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
- name: pip install | |
run: pip install -r requirements.txt | |
- uses: FedericoCarboni/setup-ffmpeg@v2 | |
id: setup-ffmpeg | |
- name: use kodi-metadata-tmdb-cli | |
working-directory: kodi-tmdb | |
env: | |
KODI_TMDB_CONFIG: ${{ secrets.KODI_TMDB_CONFIG }} | |
run: | | |
python handle_config.py $KODI_TMDB_CONFIG | |
chmod +x kodi-tmdb-linux-amd64 | |
./kodi-tmdb-linux-amd64 & | |
echo 'kodi-tmdb is started!' | |
- name: pull | |
run: | | |
git checkout . | |
git pull --allow-unrelated-histories | |
- name: execute | |
id: execute | |
env: | |
ALIGO_TOKEN: ${{ secrets.ALIGO_TOKEN }} | |
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }} | |
GH_BOT_CHAT_ID: ${{ secrets.GH_BOT_CHAT_ID }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
python main.py $ALIGO_TOKEN | |
- name: 更新ALIGO_TOKEN | |
uses: jon-grey/github-actions-secrets-creator@v1 | |
if: | |
# 如果${{ steps.execute.outputs.aligo_token }}存在 | |
steps.execute.outputs.aligo_token | |
with: | |
location: nichuanfang/movie-tvshow-spider | |
name: ALIGO_TOKEN | |
value: ${{ steps.execute.outputs.aligo_token }} | |
pa_token: ${{ secrets.GH_TOKEN }} | |
- name: 更新ALIGO_TOKEN(trakt) | |
uses: jon-grey/github-actions-secrets-creator@v1 | |
if: | |
# 如果${{ steps.execute.outputs.aligo_token }}存在 | |
steps.execute.outputs.aligo_token | |
with: | |
location: nichuanfang/trakt | |
name: ALIGO_TOKEN | |
value: ${{ steps.execute.outputs.aligo_token }} | |
pa_token: ${{ secrets.GH_TOKEN }} | |
- name: keep alive | |
uses: Smart-Transportation/[email protected] | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
branch: 'main' | |
author_email: '[email protected]' | |
author_name: 'nichuanfang' | |
message: '🐳 chore: keep action alive' | |
# BARK通知 可选 | |
- name: Push notification | |
env: | |
key: ${{ secrets.BARK_KEY }} | |
host: ${{ vars.BARK_HOST }} | |
title: Crawling%20result | |
body: Crawling%20success | |
sound: calypso | |
run: | | |
curl -L "${{env.host}}/${{env.key}}/${{env.title}}/${{env.body}}?sound=${{env.sound}}" |