Update .forgejo/workflows/generate-m3u.yml
Some checks are pending
Enhanced IPTV Playlist with Discovery / enhance-and-discover (push) Waiting to run
Some checks are pending
Enhanced IPTV Playlist with Discovery / enhance-and-discover (push) Waiting to run
This commit is contained in:
parent
a159864ffe
commit
167e490de5
1 changed files with 5 additions and 50 deletions
|
@ -13,17 +13,6 @@ jobs:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
|
|
||||||
- name: Install Discovery Dependencies
|
|
||||||
run: |
|
|
||||||
echo "Installing discovery dependencies..."
|
|
||||||
pip install requests
|
|
||||||
echo "Dependencies installed"
|
|
||||||
|
|
||||||
- name: Configure Git
|
- name: Configure Git
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "actions@forgejo.plainrock127.xyz"
|
git config --local user.email "actions@forgejo.plainrock127.xyz"
|
||||||
|
@ -35,33 +24,20 @@ jobs:
|
||||||
mkdir -p reports/daily config
|
mkdir -p reports/daily config
|
||||||
echo "Setup completed"
|
echo "Setup completed"
|
||||||
|
|
||||||
- name: Run Channel Discovery
|
|
||||||
run: |
|
|
||||||
echo "Running automated channel discovery..."
|
|
||||||
if [ -f scripts/source_scraper.py ]; then
|
|
||||||
python3 scripts/source_scraper.py
|
|
||||||
echo "Channel discovery completed"
|
|
||||||
else
|
|
||||||
echo "Discovery script not found, skipping discovery"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check Import File
|
- name: Check Import File
|
||||||
run: |
|
run: |
|
||||||
echo "Checking import file..."
|
echo "Checking import file..."
|
||||||
if [ -f bulk_import.m3u ]; then
|
if [ -f bulk_import.m3u ]; then
|
||||||
LINES=$(wc -l < bulk_import.m3u)
|
LINES=$(wc -l < bulk_import.m3u)
|
||||||
echo "Found bulk_import.m3u with $LINES lines"
|
echo "Found bulk_import.m3u with $LINES lines"
|
||||||
if [ "$LINES" -gt 2 ]; then
|
|
||||||
echo "Contains channels to process"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "Creating empty bulk_import.m3u"
|
echo "Creating empty bulk_import.m3u"
|
||||||
echo '#EXTM3U' > bulk_import.m3u
|
echo '#EXTM3U' > bulk_import.m3u
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Run Enhanced Playlist Generation
|
- name: Run Playlist Generation
|
||||||
run: |
|
run: |
|
||||||
echo "Running enhanced playlist generation..."
|
echo "Running playlist generation..."
|
||||||
if [ -f scripts/generate_playlist.py ]; then
|
if [ -f scripts/generate_playlist.py ]; then
|
||||||
python3 scripts/generate_playlist.py
|
python3 scripts/generate_playlist.py
|
||||||
echo "Playlist generation completed"
|
echo "Playlist generation completed"
|
||||||
|
@ -84,13 +60,6 @@ jobs:
|
||||||
echo "Generated: $(date)" >> "$REPORT"
|
echo "Generated: $(date)" >> "$REPORT"
|
||||||
echo "Channels: $CHANNELS" >> "$REPORT"
|
echo "Channels: $CHANNELS" >> "$REPORT"
|
||||||
|
|
||||||
# Check if discovery ran
|
|
||||||
if ls reports/daily/discovery_report_*.md 1> /dev/null 2>&1; then
|
|
||||||
LATEST_DISCOVERY=$(ls -t reports/daily/discovery_report_*.md | head -1)
|
|
||||||
DISCOVERED_COUNT=$(grep "Total Channels Discovered:" "$LATEST_DISCOVERY" | grep -o '[0-9]*' || echo "0")
|
|
||||||
echo "Discovered this session: $DISCOVERED_COUNT" >> "$REPORT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Report created: $REPORT"
|
echo "Report created: $REPORT"
|
||||||
else
|
else
|
||||||
echo "No playlist found"
|
echo "No playlist found"
|
||||||
|
@ -108,8 +77,6 @@ jobs:
|
||||||
ls -t *.md | tail -n +4 | xargs rm -f
|
ls -t *.md | tail -n +4 | xargs rm -f
|
||||||
echo "Cleanup done"
|
echo "Cleanup done"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo "No reports to clean"
|
|
||||||
fi
|
fi
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
@ -130,28 +97,16 @@ jobs:
|
||||||
if [ -f playlist.m3u ]; then
|
if [ -f playlist.m3u ]; then
|
||||||
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
|
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
|
||||||
fi
|
fi
|
||||||
|
git commit -m "📺 Enhanced IPTV with $CHANNELS channels - $(date '+%Y-%m-%d %H:%M')"
|
||||||
# Check for discovery
|
|
||||||
DISCOVERY_NOTE=""
|
|
||||||
if ls reports/daily/discovery_report_*.md 1> /dev/null 2>&1; then
|
|
||||||
LATEST_DISCOVERY=$(ls -t reports/daily/discovery_report_*.md | head -1)
|
|
||||||
DISCOVERED_COUNT=$(grep "Total Channels Discovered:" "$LATEST_DISCOVERY" | grep -o '[0-9]*' || echo "0")
|
|
||||||
if [ "$DISCOVERED_COUNT" -gt "0" ]; then
|
|
||||||
DISCOVERY_NOTE=" +$DISCOVERED_COUNT discovered"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
git commit -m "🚀 Enhanced IPTV with $CHANNELS channels$DISCOVERY_NOTE - $(date '+%Y-%m-%d %H:%M')"
|
|
||||||
git push
|
git push
|
||||||
echo "Changes committed"
|
echo "Changes committed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Summary
|
- name: Summary
|
||||||
run: |
|
run: |
|
||||||
echo "=== ENHANCED WORKFLOW COMPLETE ==="
|
echo "=== WORKFLOW COMPLETE ==="
|
||||||
if [ -f playlist.m3u ]; then
|
if [ -f playlist.m3u ]; then
|
||||||
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
|
CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
|
||||||
echo "✅ Playlist has $CHANNELS channels"
|
echo "✅ Playlist has $CHANNELS channels"
|
||||||
fi
|
fi
|
||||||
echo "✅ Discovery system ready"
|
echo "✅ Ready for discovery enhancement"
|
||||||
echo "✅ Enhanced reporting active"
|
|
Loading…
Add table
Add a link
Reference in a new issue