From fd332e99d6e854b731275b018d908fabef03dddd Mon Sep 17 00:00:00 2001 From: stoney420 Date: Sun, 29 Jun 2025 05:26:15 +0200 Subject: [PATCH] Update .forgejo/workflows/generate-m3u.yml --- .forgejo/workflows/generate-m3u.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/generate-m3u.yml b/.forgejo/workflows/generate-m3u.yml index 2f7436a..b5396cd 100644 --- a/.forgejo/workflows/generate-m3u.yml +++ b/.forgejo/workflows/generate-m3u.yml @@ -183,7 +183,7 @@ def detect_country_enhanced(channel_name, epg_id="", logo_url="", stream_url="") elif ".us" in epg_id.lower(): return "πŸ‡ΊπŸ‡Έ United States" elif ".uk" in epg_id.lower(): - return "πŸ‡¬πŸ‡§ United Kingdom" + return "οΏ½πŸ‡§ United Kingdom" elif ".ph" in epg_id.lower(): return "πŸ‡΅πŸ‡­ Philippines" elif ".au" in epg_id.lower(): @@ -310,7 +310,11 @@ EOF - name: Generate Enhanced M3U Playlist run: | echo "πŸ“Ί Generating enhanced M3U playlist..." - python3 -c "import sys + # Create a temporary Python script for playlist generation + cat > generate_enhanced_playlist.py << 'EOF' +#!/usr/bin/env python3 +import sys + print('πŸš€ Generating M3U from fixed channels...') # Read channels.txt with open('channels.txt', 'r', encoding='utf-8') as f: @@ -343,7 +347,11 @@ with open('playlist.m3u', 'w', encoding='utf-8') as f: f.write(f',{stream_name}\n') f.write(f'{url}\n') valid_channels += 1 -print(f'βœ… Generated playlist.m3u with {valid_channels} channels')" +print(f'βœ… Generated playlist.m3u with {valid_channels} channels') +EOF + # Make the temporary script executable and run it + chmod +x generate_enhanced_playlist.py + python3 generate_enhanced_playlist.py - name: Validate Results and Generate Report run: | @@ -406,7 +414,6 @@ print(f'βœ… Generated playlist.m3u with {valid_channels} channels')" - name: Final Summary run: | echo "πŸŽ‰ ENHANCED COUNTRY DETECTION COMPLETE!" - # Fixed the echo syntax for repeating characters echo "==================================================" if [ -f playlist.m3u ]; then CHANNELS=$(grep -c "^#EXTINF" playlist.m3u || echo "0") @@ -417,3 +424,4 @@ print(f'βœ… Generated playlist.m3u with {valid_channels} channels')" fi echo "πŸ“‹ Backup files created for safety" echo "πŸ“Š Detailed reports available in reports/daily/" +οΏ½ \ No newline at end of file