-
Notifications
You must be signed in to change notification settings - Fork 5
41 lines (34 loc) · 1.16 KB
/
scrape-live-stream.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Scrape Live Stream URL
on:
workflow_dispatch:
inputs:
url:
description: "The URL to scrape for m3u8 links"
required: true
default: "https://news.abplive.com/live-tv"
jobs:
scrape:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Puppeteer
run: npm install puppeteer
- name: Run Puppeteer script with dynamic URL
env:
TARGET_URL: ${{ github.event.inputs.url }}
run: |
echo -e "\033[1;36m🌀 Running Puppeteer Script... 🌀\033[0m"
node puppeteer-script.js | tee puppeteer_output.txt
- name: Display captured .m3u8 URLs
run: |
echo -e "\033[1;33m============================\033[0m"
echo -e "\033[1;35m Scrape Results: \033[0m"
echo -e "\033[1;33m============================\033[0m"
cat puppeteer_output.txt
echo -e "\033[1;33m============================\033[0m"
grep 'Found .m3u8 URL:' puppeteer_output.txt || echo -e "\033[1;31mNo .m3u8 URL found.\033[0m"