Skip to content

Make EPG

Make EPG #17

Workflow file for this run

name: Make EPG
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
epg:
name: Make EPG
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download & Install WebGrab+Plus & its config
run: |
wget http://webgrabplus.com/sites/default/files/download/SW/V3.3.0/WebGrabPlus_V3.3_install.tar.gz
tar -zxvf WebGrabPlus_V3.3_install.tar.gz
cd .wg++
./install.sh
wget https://raw.githubusercontent.com/mraniki/tv/main/config/WebGrab++.config.xml
./run.sh
- name: Download manual EPG
run: |
mapfile -t urls < config/epg.txt
# Iterate over the URLs and download the XML files
for url in $urls; do
wget $url
done
- name: xmltv install
run: |
sudo apt -y install xmltv
- name: Merge EPG
run: |
# Get a list of downloaded XML files
xml_files=$(ls *.xml)
# Iterate over the remaining XML files and perform the tv_cat command
for xml_file in $xml_files; do
# Check if there are any XML files
if [ ! -f "guide.xml" ] || [ ! -s "guide.xml" ]; then
# Rename the first XML file to guide.xml
mv $xml_file guide.xml
else
tv_cat guide.xml $xml_file > guide.xml
fi
done
# # Save the merged XML file as compressed tarball
# tar czf guide.tar.gz guide.xml
# rm guide.xml
- name: 🪪 Identify
run: |
git config --global user.email "[email protected]"
git config --global user.name "${GITHUB_ACTOR}"
- name: Clean
run: |
git checkout --orphan latest_branch
git add -A
git commit -am "${{ steps.date.outputs.DATE }} - ${{ steps.quote.outputs.TITLE }}"
git branch -D main
git branch -m main
git push -f origin main