Scrape Live Stream URL #119
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: 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" |