Najeebsk

IPTV-CHECK-M3U-02.py

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