Make EPG #7
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: 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 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: Download & Install WebGrab+Plus | |
# 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 | |
# download WebGrab++.config.xml | |
# wget -N https://raw.githubusercontent.com/LiuYi0526/IPTV/master/WebGrab++.config.xml | |
# ./run.sh | |
- name: Install xmltv | |
run: | | |
sudo apt -y install xmltv | |
- name: Merge EPG | |
run: | | |
# Get a list of downloaded XML files | |
xml_files=$(ls *.xml) | |
# Check if there are any XML files | |
if [ -n "$xml_files" ]; then | |
# Rename the first XML file to guide.xml | |
mv $xml_files[0] guide.xml | |
# Iterate over the remaining XML files and perform the tv_cat command | |
for xml_file in ${xml_files[@]:1}; do | |
tv_cat guide.xml $xml_file > guide.xml | |
done | |
fi | |
- 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 |