Najeebsk

IPTV-CHECK-M3U2.py

Mar 12th, 2024 (edited)
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 20.25 KB | None | 0 0
  1. import tkinter as tk
  2. from tkinter import ttk
  3. import requests
  4. import subprocess
  5.  
  6. def search_channels():
  7.     search_term = url_entry.get().lower()
  8.     if search_term.startswith("http"):
  9.         search_by_url(search_term)
  10.     else:
  11.         search_by_category()
  12.  
  13. def search_by_url(url):
  14.     try:
  15.         # Send a GET request to the provided URL
  16.         response = requests.get(url)
  17.        
  18.         # Check if the request was successful (status code 200)
  19.         if response.status_code == 200:
  20.             # Parse M3U data
  21.             m3u_data = response.text.split('\n')
  22.            
  23.             # Clear any previous results
  24.             result_text.delete(0, tk.END)
  25.            
  26.             # Store channels' names and URLs
  27.             global channels_info
  28.             channels_info = {}
  29.            
  30.             # Extract channel names and URLs
  31.             channel_name = None
  32.             for line in m3u_data:
  33.                 if line.startswith('#EXTINF:'):
  34.                     channel_name = line.split(',')[-1]
  35.                 elif line.startswith('http') and channel_name:
  36.                     channels_info[channel_name] = line.strip()
  37.                     # Insert channel name into the listbox
  38.                     result_text.insert(tk.END, channel_name)
  39.                     channel_name = None
  40.         else:
  41.             result_text.insert(tk.END, f"Error: Failed to fetch channel data. Status Code: {response.status_code}")
  42.     except requests.RequestException as e:
  43.         result_text.insert(tk.END, f"Error: {str(e)}")
  44.  
  45. def search_by_category():
  46.     category = category_var.get()
  47.     url = category_urls.get(category)
  48.     mac_address = mac_entry.get()
  49.  
  50.     # Construct the request URL with the provided MAC address
  51.     request_url = f"{url}?mac={mac_address}"
  52.  
  53.     try:
  54.         # Send a GET request to the constructed URL
  55.         response = requests.get(request_url)
  56.        
  57.         # Check if the request was successful (status code 200)
  58.         if response.status_code == 200:
  59.             # Parse M3U data
  60.             m3u_data = response.text.split('\n')
  61.            
  62.             # Clear any previous results
  63.             result_text.delete(0, tk.END)
  64.            
  65.             # Store channels' names and URLs
  66.             global channels_info
  67.             channels_info = {}
  68.            
  69.             # Extract channel names and URLs
  70.             channel_name = None
  71.             for line in m3u_data:
  72.                 if line.startswith('#EXTINF:'):
  73.                     channel_name = line.split(',')[-1]
  74.                 elif line.startswith('http') and channel_name:
  75.                     channels_info[channel_name] = line.strip()
  76.                     # Insert channel name into the listbox
  77.                     result_text.insert(tk.END, channel_name)
  78.                     channel_name = None
  79.         else:
  80.             result_text.insert(tk.END, f"Error: Failed to fetch channel data. Status Code: {response.status_code}")
  81.     except requests.RequestException as e:
  82.         result_text.insert(tk.END, f"Error: {str(e)}")
  83.  
  84. def play_selected_channel(event):
  85.     try:
  86.         # Get the selected channel name
  87.         selected_channel = result_text.get(tk.ACTIVE)
  88.        
  89.         # Open the corresponding URL in VLC
  90.         subprocess.Popen([r"C:\Program Files\VideoLAN\VLC\vlc.exe", channels_info[selected_channel]])
  91.     except (tk.TclError, KeyError):
  92.         pass  # Ignore if no channel is selected or channel info is missing
  93.  
  94. def check_links():
  95.     global working_links
  96.     working_links = {}
  97.     for channel_name, url in channels_info.items():
  98.         try:
  99.             response = requests.get(url)
  100.             if response.status_code == 200:
  101.                 working_links[channel_name] = url
  102.         except requests.RequestException:
  103.             pass
  104.  
  105.     # Display working links in the result_text widget
  106.     result_text.delete(0, tk.END)
  107.     for channel_name, url in working_links.items():
  108.         result_text.insert(tk.END, f"{channel_name}: {url}\n")
  109.  
  110. def save_working_links():
  111.     with open("working_channels.m3u", "w", encoding="utf-8") as f:
  112.         for channel_name, url in working_links.items():
  113.             f.write(f"#EXTINF:-1,{channel_name}\n{url}\n")
  114.  
  115. # Create the main application window
  116. app = tk.Tk()
  117. app.title("Najeeb IPTV Channel Search M3u and Mac All Conutry")
  118. app.geometry("800x600")
  119. app.configure(bg="#336699")
  120.  
  121. # Add labels, entry fields, buttons, etc.
  122. url_frame = tk.Frame(app, bg="#336699")
  123. url_frame.pack(pady=10)
  124.  
  125. url_label = tk.Label(url_frame, text="Enter URL or select category:", bg="#336699", fg="white")
  126. url_label.pack(side=tk.LEFT, padx=5)
  127.  
  128. url_entry = tk.Entry(url_frame, width=50)  # Adjust width here
  129. url_entry.pack(side=tk.LEFT, padx=5)
  130.  
  131. mac_label = tk.Label(url_frame, text="Enter MAC Address:", bg="#336699", fg="white")
  132. mac_label.pack(side=tk.LEFT, padx=5)
  133.  
  134. mac_entry = tk.Entry(url_frame)
  135. mac_entry.pack(side=tk.LEFT, padx=5)
  136.  
  137. search_button = tk.Button(url_frame, text="Search", command=search_channels, bg="#FFA500", fg="white")
  138. search_button.pack(side=tk.LEFT, padx=5)
  139.  
  140. result_label = tk.Label(app, text="Channels:", bg="#336699", fg="white")
  141. result_label.pack()
  142.  
  143. # Add scrollbar to the listbox
  144. scrollbar = tk.Scrollbar(app, orient=tk.VERTICAL)
  145. scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
  146.  
  147. result_text = tk.Listbox(app, height=30, width=130, yscrollcommand=scrollbar.set)
  148. result_text.pack()
  149.  
  150. # Configure scrollbar
  151. scrollbar.config(command=result_text.yview)
  152.  
  153. # Bind double click event to play_selected_channel function
  154. result_text.bind("<Double-1>", play_selected_channel)
  155.  
  156. # Add button to check links
  157. check_button = tk.Button(app, text="Check Links", command=check_links, bg="#008000", fg="white")
  158. check_button.pack(side=tk.RIGHT, padx=5)
  159.  
  160. # Add button to save working links
  161. save_button = tk.Button(app, text="Save Working Links", command=save_working_links, bg="#FF0000", fg="white")
  162. save_button.pack(side=tk.LEFT, padx=5)
  163.  
  164. # Dropdown menu for channel categories
  165. category_urls = {
  166.     "ALL-CONUTRY": "",
  167.     "Afghanistan": "https://iptv-org.github.io/iptv/countries/af.m3u",
  168.     "Albania": "https://iptv-org.github.io/iptv/countries/al.m3u",
  169.     "Algeria": "https://iptv-org.github.io/iptv/countries/dz.m3u",
  170.     "Andorra": "https://iptv-org.github.io/iptv/countries/ad.m3u",
  171.     "Angola": "https://iptv-org.github.io/iptv/countries/ao.m3u",
  172.     "Anguilla": "https://iptv-org.github.io/iptv/countries/ai.m3u",
  173.     "Antigua and Barbuda": "https://iptv-org.github.io/iptv/countries/ag.m3u",
  174.     "Argentina": "https://iptv-org.github.io/iptv/countries/ar.m3u",
  175.     "Armenia": "https://iptv-org.github.io/iptv/countries/am.m3u",
  176.     "Aruba": "https://iptv-org.github.io/iptv/countries/aw.m3u",
  177.     "Australia": "https://iptv-org.github.io/iptv/countries/au.m3u",
  178.     "Austria": "https://iptv-org.github.io/iptv/countries/at.m3u",
  179.     "Azerbaijan": "https://iptv-org.github.io/iptv/countries/az.m3u",
  180.     "Bahamas": "https://iptv-org.github.io/iptv/countries/bs.m3u",
  181.     "Bahrain": "https://iptv-org.github.io/iptv/countries/bh.m3u",
  182.     "Bangladesh": "https://iptv-org.github.io/iptv/countries/bd.m3u",
  183.     "Barbados": "https://iptv-org.github.io/iptv/countries/bb.m3u",
  184.     "Belarus": "https://iptv-org.github.io/iptv/countries/by.m3u",
  185.     "Belgium": "https://iptv-org.github.io/iptv/countries/be.m3u",
  186.     "Belize": "https://iptv-org.github.io/iptv/countries/bz.m3u",
  187.     "Benin": "https://iptv-org.github.io/iptv/countries/bj.m3u",
  188.     "Bermuda": "https://iptv-org.github.io/iptv/countries/bm.m3u",
  189.     "Bhutan": "https://iptv-org.github.io/iptv/countries/bt.m3u",
  190.     "Bolivia": "https://iptv-org.github.io/iptv/countries/bo.m3u",
  191.     "Bosnia and Herzegovina": "https://iptv-org.github.io/iptv/countries/ba.m3u",
  192.     "Botswana": "https://iptv-org.github.io/iptv/countries/bw.m3u",
  193.     "Bouvet Island": "https://iptv-org.github.io/iptv/countries/bv.m3u",
  194.     "Brazil": "https://iptv-org.github.io/iptv/countries/br.m3u",
  195.     "British Virgin Islands": "https://iptv-org.github.io/iptv/countries/vg.m3u",
  196.     "Brunei": "https://iptv-org.github.io/iptv/countries/bn.m3u",
  197.     "Bulgaria": "https://iptv-org.github.io/iptv/countries/bg.m3u",
  198.     "Burkina Faso": "https://iptv-org.github.io/iptv/countries/bf.m3u",
  199.     "Burundi": "https://iptv-org.github.io/iptv/countries/bi.m3u",
  200.     "Cambodia": "https://iptv-org.github.io/iptv/countries/kh.m3u",
  201.     "Cameroon": "https://iptv-org.github.io/iptv/countries/cm.m3u",
  202.     "Canada": "https://iptv-org.github.io/iptv/countries/ca.m3u",
  203.     "Central African Republic": "https://iptv-org.github.io/iptv/countries/cf.m3u",
  204.     "Chad": "https://iptv-org.github.io/iptv/countries/td.m3u",
  205.     "Chile": "https://iptv-org.github.io/iptv/countries/cl.m3u",
  206.     "China": "https://iptv-org.github.io/iptv/countries/cn.m3u",
  207.     "Colombia": "https://iptv-org.github.io/iptv/countries/co.m3u",
  208.     "Comoros": "https://iptv-org.github.io/iptv/countries/km.m3u",
  209.     "Cook Islands": "https://iptv-org.github.io/iptv/countries/ck.m3u",
  210.     "Costa Rica": "https://iptv-org.github.io/iptv/countries/cr.m3u",
  211.     "Croatia": "https://iptv-org.github.io/iptv/countries/hr.m3u",
  212.     "Cuba": "https://iptv-org.github.io/iptv/countries/cu.m3u",
  213.     "Curacao": "https://iptv-org.github.io/iptv/countries/cw.m3u",
  214.     "Cyprus": "https://iptv-org.github.io/iptv/countries/cy.m3u",
  215.     "Czech Republic": "https://iptv-org.github.io/iptv/countries/cz.m3u",
  216.     "Democratic Republic of the Congo": "https://iptv-org.github.io/iptv/countries/cd.m3u",
  217.     "Denmark": "https://iptv-org.github.io/iptv/countries/dk.m3u",
  218.     "Djibouti": "https://iptv-org.github.io/iptv/countries/dj.m3u",
  219.     "Dominica": "https://iptv-org.github.io/iptv/countries/dm.m3u",
  220.     "Dominican Republic": "https://iptv-org.github.io/iptv/countries/do.m3u",
  221.     "El Salvador": "https://iptv-org.github.io/iptv/countries/sv.m3u",
  222.     "Equatorial Guinea": "https://iptv-org.github.io/iptv/countries/gq.m3u",
  223.     "Eritrea": "https://iptv-org.github.io/iptv/countries/er.m3u",
  224.     "Estonia": "https://iptv-org.github.io/iptv/countries/ee.m3u",
  225.     "Ethiopia": "https://iptv-org.github.io/iptv/countries/et.m3u",
  226.     "Finland": "https://iptv-org.github.io/iptv/countries/fi.m3u",
  227.     "France": "https://iptv-org.github.io/iptv/countries/fr.m3u",
  228.     "French Guiana": "https://iptv-org.github.io/iptv/countries/gf.m3u",
  229.     "French Polynesia": "https://iptv-org.github.io/iptv/countries/pf.m3u",
  230.     "French Southern Territories": "https://iptv-org.github.io/iptv/countries/tf.m3u",
  231.     "Gabon": "https://iptv-org.github.io/iptv/countries/ga.m3u",
  232.     "Gambia": "https://iptv-org.github.io/iptv/countries/gm.m3u",
  233.     "Georgia": "https://iptv-org.github.io/iptv/countries/ge.m3u",
  234.     "Germany": "https://iptv-org.github.io/iptv/countries/de.m3u",
  235.     "Ghana": "https://iptv-org.github.io/iptv/countries/gh.m3u",
  236.     "Greece": "https://iptv-org.github.io/iptv/countries/gr.m3u",
  237.     "Greenland": "https://iptv-org.github.io/iptv/countries/gl.m3u",
  238.     "Grenada": "https://iptv-org.github.io/iptv/countries/gd.m3u",
  239.     "Guadeloupe": "https://iptv-org.github.io/iptv/countries/gp.m3u",
  240.     "Guam": "https://iptv-org.github.io/iptv/countries/gu.m3u",
  241.     "Guatemala": "https://iptv-org.github.io/iptv/countries/gt.m3u",
  242.     "Guinea": "https://iptv-org.github.io/iptv/countries/gn.m3u",
  243.     "Guinea-Bissau": "https://iptv-org.github.io/iptv/countries/gw.m3u",
  244.     "Haiti": "https://iptv-org.github.io/iptv/countries/ht.m3u",
  245.     "Honduras": "https://iptv-org.github.io/iptv/countries/hn.m3u",
  246.     "Hong Kong": "https://iptv-org.github.io/iptv/countries/hk.m3u",
  247.     "Hungary": "https://iptv-org.github.io/iptv/countries/hu.m3u",
  248.     "Iceland": "https://iptv-org.github.io/iptv/countries/is.m3u",
  249.     "India": "https://iptv-org.github.io/iptv/countries/in.m3u",
  250.     "Indonesia": "https://iptv-org.github.io/iptv/countries/id.m3u",
  251.     "Iran": "https://iptv-org.github.io/iptv/countries/ir.m3u",
  252.     "Iraq": "https://iptv-org.github.io/iptv/countries/iq.m3u",
  253.     "Ireland": "https://iptv-org.github.io/iptv/countries/ie.m3u",
  254.     "Israel": "https://iptv-org.github.io/iptv/countries/il.m3u",
  255.     "Italy": "https://iptv-org.github.io/iptv/countries/it.m3u",
  256.     "Ivory Coast": "https://iptv-org.github.io/iptv/countries/ci.m3u",
  257.     "Jamaica": "https://iptv-org.github.io/iptv/countries/jm.m3u",
  258.     "Japan": "https://iptv-org.github.io/iptv/countries/jp.m3u",
  259.     "Jordan": "https://iptv-org.github.io/iptv/countries/jo.m3u",
  260.     "Kazakhstan": "https://iptv-org.github.io/iptv/countries/kz.m3u",
  261.     "Kenya": "https://iptv-org.github.io/iptv/countries/ke.m3u",
  262.     "Kosovo": "https://iptv-org.github.io/iptv/countries/xk.m3u",
  263.     "Kuwait": "https://iptv-org.github.io/iptv/countries/kw.m3u",
  264.     "Kyrgyzstan": "https://iptv-org.github.io/iptv/countries/kg.m3u",
  265.     "Laos": "https://iptv-org.github.io/iptv/countries/la.m3u",
  266.     "Latvia": "https://iptv-org.github.io/iptv/countries/lv.m3u",
  267.     "Lebanon": "https://iptv-org.github.io/iptv/countries/lb.m3u",
  268.     "Lesotho": "https://iptv-org.github.io/iptv/countries/ls.m3u",
  269.     "Liberia": "https://iptv-org.github.io/iptv/countries/lr.m3u",
  270.     "Libya": "https://iptv-org.github.io/iptv/countries/ly.m3u",
  271.     "Liechtenstein": "https://iptv-org.github.io/iptv/countries/li.m3u",
  272.     "Lithuania": "https://iptv-org.github.io/iptv/countries/lt.m3u",
  273.     "Luxembourg": "https://iptv-org.github.io/iptv/countries/lu.m3u",
  274.     "Macao": "https://iptv-org.github.io/iptv/countries/mo.m3u",
  275.     "Madagascar": "https://iptv-org.github.io/iptv/countries/mg.m3u",
  276.     "Malawi": "https://iptv-org.github.io/iptv/countries/mw.m3u",
  277.     "Malaysia": "https://iptv-org.github.io/iptv/countries/my.m3u",
  278.     "Maldives": "https://iptv-org.github.io/iptv/countries/mv.m3u",
  279.     "Mali": "https://iptv-org.github.io/iptv/countries/ml.m3u",
  280.     "Malta": "https://iptv-org.github.io/iptv/countries/mt.m3u",
  281.     "Martinique": "https://iptv-org.github.io/iptv/countries/mq.m3u",
  282.     "Mauritania": "https://iptv-org.github.io/iptv/countries/mr.m3u",
  283.     "Mexico": "https://iptv-org.github.io/iptv/countries/mx.m3u",
  284.     "Morocco": "https://iptv-org.github.io/iptv/countries/ma.m3u",
  285.     "Myanmar (Burma)": "https://iptv-org.github.io/iptv/countries/mm.m3u",
  286.     "Namibia": "https://iptv-org.github.io/iptv/countries/na.m3u",
  287.     "Nepal": "https://iptv-org.github.io/iptv/countries/np.m3u",
  288.     "Netherlands": "https://iptv-org.github.io/iptv/countries/nl.m3u",
  289.     "New Zealand": "https://iptv-org.github.io/iptv/countries/nz.m3u",
  290.     "Nicaragua": "https://iptv-org.github.io/iptv/countries/ni.m3u",
  291.     "Niger": "https://iptv-org.github.io/iptv/countries/ne.m3u",
  292.     "Nigeria": "https://iptv-org.github.io/iptv/countries/ng.m3u",
  293.     "North Macedonia": "https://iptv-org.github.io/iptv/countries/mk.m3u",
  294.     "Norway": "https://iptv-org.github.io/iptv/countries/no.m3u",
  295.     "Oman": "https://iptv-org.github.io/iptv/countries/om.m3u",
  296.     "Pakistan": "https://iptv-org.github.io/iptv/countries/pk.m3u",
  297.     "Palestine": "https://iptv-org.github.io/iptv/countries/ps.m3u",
  298.     "Panama": "https://iptv-org.github.io/iptv/countries/pa.m3u",
  299.     "Paraguay": "https://iptv-org.github.io/iptv/countries/py.m3u",
  300.     "Peru": "https://iptv-org.github.io/iptv/countries/pe.m3u",
  301.     "Philippines": "https://iptv-org.github.io/iptv/countries/ph.m3u",
  302.     "Pitcairn Islands": "https://iptv-org.github.io/iptv/countries/pn.m3u",
  303.     "Poland": "https://iptv-org.github.io/iptv/countries/pl.m3u",
  304.     "Portugal": "https://iptv-org.github.io/iptv/countries/pt.m3u",
  305.     "Puerto Rico": "https://iptv-org.github.io/iptv/countries/pr.m3u",
  306.     "Qatar": "https://iptv-org.github.io/iptv/countries/qa.m3u",
  307.     "Republic of the Congo": "https://iptv-org.github.io/iptv/countries/cg.m3u",
  308.     "Réunion": "https://iptv-org.github.io/iptv/countries/re.m3u",
  309.     "Romania": "https://iptv-org.github.io/iptv/countries/ro.m3u",
  310.     "Russia": "https://iptv-org.github.io/iptv/countries/ru.m3u",
  311.     "Rwanda": "https://iptv-org.github.io/iptv/countries/rw.m3u",
  312.     "Saint Barthélemy": "https://iptv-org.github.io/iptv/countries/bl.m3u",
  313.     "Saint Helena": "https://iptv-org.github.io/iptv/countries/sh.m3u",
  314.     "Saint Kitts and Nevis": "https://iptv-org.github.io/iptv/countries/kn.m3u",
  315.     "Saint Lucia": "https://iptv-org.github.io/iptv/countries/lc.m3u",
  316.     "Saint Martin": "https://iptv-org.github.io/iptv/countries/mf.m3u",
  317.     "Saint Pierre and Miquelon": "https://iptv-org.github.io/iptv/countries/pm.m3u",
  318.     "Saint Vincent and the Grenadines": "https://iptv-org.github.io/iptv/countries/vc.m3u",
  319.     "Samoa": "https://iptv-org.github.io/iptv/countries/ws.m3u",
  320.     "San Marino": "https://iptv-org.github.io/iptv/countries/sm.m3u",
  321.     "São Tomé and Príncipe": "https://iptv-org.github.io/iptv/countries/st.m3u",
  322.     "Saudi Arabia": "https://iptv-org.github.io/iptv/countries/sa.m3u",
  323.     "Senegal": "https://iptv-org.github.io/iptv/countries/sn.m3u",
  324.     "Serbia": "https://iptv-org.github.io/iptv/countries/rs.m3u",
  325.     "Seychelles": "https://iptv-org.github.io/iptv/countries/sc.m3u",
  326.     "Sierra Leone": "https://iptv-org.github.io/iptv/countries/sl.m3u",
  327.     "Singapore": "https://iptv-org.github.io/iptv/countries/sg.m3u",
  328.     "Sint Maarten": "https://iptv-org.github.io/iptv/countries/sx.m3u",
  329.     "Slovakia": "https://iptv-org.github.io/iptv/countries/sk.m3u",
  330.     "Slovenia": "https://iptv-org.github.io/iptv/countries/si.m3u",
  331.     "Solomon Islands": "https://iptv-org.github.io/iptv/countries/sb.m3u",
  332.     "Somalia": "https://iptv-org.github.io/iptv/countries/so.m3u",
  333.     "South Africa": "https://iptv-org.github.io/iptv/countries/za.m3u",
  334.     "South Korea": "https://iptv-org.github.io/iptv/countries/kr.m3u",
  335.     "Spain": "https://iptv-org.github.io/iptv/countries/es.m3u",
  336.     "Sri Lanka": "https://iptv-org.github.io/iptv/countries/lk.m3u",
  337.     "Sudan": "https://iptv-org.github.io/iptv/countries/sd.m3u",
  338.     "Suriname": "https://iptv-org.github.io/iptv/countries/sr.m3u",
  339.     "Swaziland": "https://iptv-org.github.io/iptv/countries/sz.m3u",
  340.     "Sweden": "https://iptv-org.github.io/iptv/countries/se.m3u",
  341.     "Switzerland": "https://iptv-org.github.io/iptv/countries/ch.m3u",
  342.     "Syria": "https://iptv-org.github.io/iptv/countries/sy.m3u",
  343.     "Taiwan": "https://iptv-org.github.io/iptv/countries/tw.m3u",
  344.     "Tajikistan": "https://iptv-org.github.io/iptv/countries/tj.m3u",
  345.     "Tanzania": "https://iptv-org.github.io/iptv/countries/tz.m3u",
  346.     "Thailand": "https://iptv-org.github.io/iptv/countries/th.m3u",
  347.     "Togo": "https://iptv-org.github.io/iptv/countries/tg.m3u",
  348.     "Trinidad and Tobago": "https://iptv-org.github.io/iptv/countries/tt.m3u",
  349.     "Tunisia": "https://iptv-org.github.io/iptv/countries/tn.m3u",
  350.     "Turkey": "https://iptv-org.github.io/iptv/countries/tr.m3u",
  351.     "Turkmenistan": "https://iptv-org.github.io/iptv/countries/tm.m3u",
  352.     "Turks and Caicos Islands": "https://iptv-org.github.io/iptv/countries/tc.m3u",
  353.     "U.S. Virgin Islands": "https://iptv-org.github.io/iptv/countries/vi.m3u",
  354.     "Uganda": "https://iptv-org.github.io/iptv/countries/ug.m3u",
  355.     "Ukraine": "https://iptv-org.github.io/iptv/countries/ua.m3u",
  356.     "United Arab Emirates": "https://iptv-org.github.io/iptv/countries/ae.m3u",
  357.     "United Kingdom": "https://iptv-org.github.io/iptv/countries/uk.m3u",
  358.     "United States": "https://iptv-org.github.io/iptv/countries/us.m3u",
  359.     "Uruguay": "https://iptv-org.github.io/iptv/countries/uy.m3u",
  360.     "Uzbekistan": "https://iptv-org.github.io/iptv/countries/uz.m3u",
  361.     "Vanuatu": "https://iptv-org.github.io/iptv/countries/vu.m3u",
  362.     "Vatican City": "https://iptv-org.github.io/iptv/countries/va.m3u",
  363.     "Venezuela": "https://iptv-org.github.io/iptv/countries/ve.m3u",
  364.     "Vietnam": "https://iptv-org.github.io/iptv/countries/vn.m3u",
  365.     "Western Sahara": "https://iptv-org.github.io/iptv/countries/eh.m3u",
  366.     "Yemen": "https://iptv-org.github.io/iptv/countries/ye.m3u",
  367.     "Zambia": "https://iptv-org.github.io/iptv/countries/zm.m3u",
  368.     "Zimbabwe": "https://iptv-org.github.io/iptv/countries/zw.m3u",
  369.     "International": "https://iptv-org.github.io/iptv/countries/int.m3u",
  370.     # Add more categories here
  371. }
  372.  
  373. category_var = tk.StringVar(app)
  374. category_var.set("Afghanistan")  # default value
  375. category_dropdown = ttk.OptionMenu(app, category_var, *category_urls.keys())
  376. category_dropdown.pack(pady=10)
  377.  
  378. # Global variable to store channels' info
  379. channels_info = {}
  380. working_links = {}
  381.  
  382. # Run the application loop
  383. app.mainloop()
  384.  
Add Comment
Please, Sign In to add comment