Fetch Stream URL #14
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: Fetch Stream URL | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| url: | |
| description: "The URL to scrape for m3u8 links (override default)" | |
| required: true | |
| default: "https://news.abplive.com/live-tv" | |
| jobs: | |
| fetch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Install Google Chrome (stable) | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y wget gnupg2 ca-certificates unzip | |
| wget -q -O /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
| sudo apt-get install -y /tmp/google-chrome-stable_current_amd64.deb || sudo dpkg -i /tmp/google-chrome-stable_current_amd64.deb || true | |
| # show chrome version | |
| google-chrome --version || true | |
| - name: Run Selenium script | |
| env: | |
| TARGET_URL: ${{ github.event.inputs.url }} | |
| run: | | |
| echo -e "Running Selenium Script." | |
| python fetch_stream.py | 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" | |