Update .forgejo/workflows/generate-m3u.yml
All checks were successful
Generate M3U Playlist / build (push) Successful in 1m21s

This commit is contained in:
stoney420 2025-06-28 00:11:35 +02:00
parent 1a0cbed4f1
commit d7c113cb97

View file

@ -23,26 +23,76 @@ jobs:
git config --local user.email "actions@forgejo.plainrock127.xyz"
git config --local user.name "IPTV Playlist Bot"
- name: Debug File Structure
run: |
echo "=== Root Directory ==="
ls -la
echo ""
echo "=== Scripts Directory ==="
ls -la scripts/
echo ""
echo "=== Check for Import File ==="
if [ -f bulk_import.m3u ]; then
echo "✅ bulk_import.m3u found in root ($(wc -l < bulk_import.m3u) lines)"
echo "First 3 lines:"
head -3 bulk_import.m3u
else
echo "❌ bulk_import.m3u not found in root"
fi
if [ -f channels.txt ]; then
echo "✅ channels.txt found ($(du -h channels.txt | cut -f1))"
else
echo "❌ channels.txt not found"
fi
- name: Setup Directories
run: |
mkdir -p config
mkdir -p backups
mkdir -p reports
# Create scripts/__init__.py if missing
if [ ! -f scripts/__init__.py ]; then
echo '# Scripts package' > scripts/__init__.py
fi
- name: Run Playlist Generation
run: |
echo "Running playlist generation..."
cd scripts
python generate_playlist.py
if [ -f playlist.m3u ]; then
mv playlist.m3u ../
fi
if [ -f playlist_update.log ]; then
mv playlist_update.log ../
fi
cd ..
echo "=== Running playlist generation ==="
echo "Current directory: $(pwd)"
echo "Available files:"
ls -la
# Run from root directory, not scripts directory
python scripts/generate_playlist.py
- name: Check Results
run: |
echo "=== Final Results ==="
ls -la
if [ -f playlist.m3u ]; then
CHANNEL_COUNT=$(grep -c "^#EXTINF" playlist.m3u || echo "0")
echo "Generated playlist with $CHANNEL_COUNT channels"
echo "✅ playlist.m3u generated with $CHANNEL_COUNT channels"
echo "File size: $(du -h playlist.m3u | cut -f1)"
echo "First 5 lines:"
head -5 playlist.m3u
else
echo "No playlist generated"
echo "❌ playlist.m3u not generated"
fi
if [ -f playlist_update.log ]; then
echo "=== Log content (last 30 lines) ==="
tail -30 playlist_update.log
else
echo "❌ No log file found"
fi
if [ -f channels.txt ]; then
echo "=== channels.txt status ==="
echo "Size: $(du -h channels.txt | cut -f1)"
echo "Lines: $(wc -l < channels.txt)"
fi
- name: Commit Changes