Update .forgejo/workflows/generate-m3u.yml
This commit is contained in:
parent
4ff00de812
commit
fd332e99d6
1 changed files with 12 additions and 4 deletions
|
@ -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 "<EFBFBD>🇧 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/"
|
||||
<EFBFBD>
|
Loading…
Add table
Add a link
Reference in a new issue