Skip to content

climages

climages #227

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: climages
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
inputs:
url:
description: 'url'
required: true
default: 'https://cl.6939x.xyz/htm_mob/2302/7/5542122.html'
env:
TZ: Asia/Shanghai
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
if: github.repository_owner == github.actor
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Show the timezone
run: |
echo "The timezone is $TZ"
date
- uses: actions/checkout@v3
- name: run
shell: bash
env:
URL: ${{ github.event.inputs.url }}
run: |
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
mkdir -p /opt/catvod/data
cd /opt/catvod/
mkdir output
wget https://github.com/10bits/github-actions-test/releases/download/catvod-JSRE/catvod-linux-x64
chmod +x ./catvod-linux-x64
cp $GITHUB_WORKSPACE/js/climages.js /opt/catvod/data/
./catvod-linux-x64 <<EOF
loadScript("climages.js")
EOF
- name: download
shell: bash
run: |
for url in /opt/urls/*.txt; do
filename=$(basename "$url" .txt)
output_dir=/opt/output/$filename
mkdir -p "$output_dir"
echo >>"$url"
cat "$url"|xargs -n 1 -P 4 wget -q --timeout=8 --tries=3 -U "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" -P "${output_dir}"
zip -rj -0 /opt/output/"${filename}".zip "${output_dir}"
done
- name: upload artifact
uses: actions/upload-artifact@v4
if: success()
with:
name: ${{env.UPLOAD_NAME}}
path: /opt/output/*.zip
retention-days: 1