@@ -7,6 +7,7 @@ def getChannelItems():
7
7
Get the channel items from the source URLs
8
8
"""
9
9
channels = {}
10
+ current_channel = None
10
11
11
12
for url in Config .source_urls :
12
13
# Check if the URL ends with ".m3u"
@@ -23,7 +24,6 @@ def getChannelItems():
23
24
if response .status_code == 200 :
24
25
# Extract channel items from the response text
25
26
lines = response .text .split ("\n " )
26
- current_channel = ""
27
27
pattern = r"^(.*?),(?!#genre#)(.*?)$"
28
28
29
29
for line in lines :
@@ -54,7 +54,7 @@ def updateChannelUrlsM3U(channels, template_channels):
54
54
f .write ("#EXTM3U\n " )
55
55
for channel in template_channels :
56
56
if channel in channels :
57
- for key , urls in sorted ( channels [channel ].items () ):
57
+ for key , urls in channels [channel ].items ():
58
58
for url in urls :
59
59
if url is not None :
60
60
f .write (f"#EXTINF:-1 tvg-id=\" \" tvg-name=\" { key } \" tvg-logo=\" https://gitee.com/yuanzl77/TVBox-logo/raw/main/png/{ key } .png\" group-title=\" { channel } \" ,{ key } \n " )
@@ -84,6 +84,6 @@ def filter_source_urls(template_file):
84
84
return channels , template_channels
85
85
86
86
if __name__ == "__main__" :
87
- template_file = "demo.txt"
87
+ template_file = "demo.txt" # Replace "demo.txt" with your actual template file
88
88
channels , template_channels = filter_source_urls (template_file )
89
89
updateChannelUrlsM3U (channels , template_channels )
0 commit comments