constants.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import os
  2. config_path = "config"
  3. output_path = "output"
  4. whitelist_path = os.path.join(config_path, "whitelist.txt")
  5. blacklist_path = os.path.join(config_path, "blacklist.txt")
  6. subscribe_path = os.path.join(config_path, "subscribe.txt")
  7. result_path = os.path.join(output_path, "result_new.txt")
  8. cache_path = os.path.join(output_path, "cache.pkl")
  9. sort_log_path = os.path.join(output_path, "sort.log")
  10. log_path = os.path.join(output_path, "log.log")
  11. url_host_pattern = r"((https?|rtmp)://)?(\[[0-9a-fA-F:]+]|([\w-]+\.?)+[\w-]+)"
  12. url_pattern = url_host_pattern + r"(.*)?"
  13. rtmp_url_pattern = r"^rtmp://.*$"
  14. rtp_pattern = r"^([^,,]+)(?:[,,])?(rtp://.*)$"
  15. demo_txt_pattern = r"^([^,,]+)(?:[,,])?(?!#genre#)" + r"(" + url_pattern + r")?"
  16. txt_pattern = r"^([^,,]+)(?:[,,])(?!#genre#)" + r"(" + url_pattern + r")"
  17. m3u_pattern = r"^#EXTINF:-1.*?(?:,|,)(.*?)\n" + r"(" + url_pattern + r")"
  18. sub_pattern = r"-|_|\((.*?)\)|\((.*?)\)|\[(.*?)\]|\「(.*?)\」| |||频道|普清|标清|高清|HD|hd|超清|超高|超高清|中央|央视|电视台|台|电信|联通|移动"
  19. replace_dict = {
  20. "plus": "+",
  21. "PLUS": "+",
  22. "+": "+",
  23. "CCTV1综合": "CCTV1",
  24. "CCTV2财经": "CCTV2",
  25. "CCTV3综艺": "CCTV3",
  26. "CCTV4国际": "CCTV4",
  27. "CCTV4中文国际": "CCTV4",
  28. "CCTV4欧洲": "CCTV4",
  29. "CCTV5体育": "CCTV5",
  30. "CCTV5+体育赛视": "CCTV5+",
  31. "CCTV5+体育赛事": "CCTV5+",
  32. "CCTV5+体育": "CCTV5+",
  33. "CCTV6电影": "CCTV6",
  34. "CCTV7军事": "CCTV7",
  35. "CCTV7军农": "CCTV7",
  36. "CCTV7农业": "CCTV7",
  37. "CCTV7国防军事": "CCTV7",
  38. "CCTV8电视剧": "CCTV8",
  39. "CCTV9记录": "CCTV9",
  40. "CCTV9纪录": "CCTV9",
  41. "CCTV10科教": "CCTV10",
  42. "CCTV11戏曲": "CCTV11",
  43. "CCTV12社会与法": "CCTV12",
  44. "CCTV13新闻": "CCTV13",
  45. "CCTV新闻": "CCTV13",
  46. "CCTV14少儿": "CCTV14",
  47. "CCTV15音乐": "CCTV15",
  48. "CCTV16奥林匹克": "CCTV16",
  49. "CCTV17农业农村": "CCTV17",
  50. "CCTV17农业": "CCTV17",
  51. }
  52. region_list = [
  53. "广东",
  54. "北京",
  55. "湖南",
  56. "湖北",
  57. "浙江",
  58. "上海",
  59. "天津",
  60. "江苏",
  61. "山东",
  62. "河南",
  63. "河北",
  64. "山西",
  65. "陕西",
  66. "安徽",
  67. "重庆",
  68. "福建",
  69. "江西",
  70. "辽宁",
  71. "黑龙江",
  72. "吉林",
  73. "四川",
  74. "云南",
  75. "香港",
  76. "内蒙古",
  77. "甘肃",
  78. "海南",
  79. "云南",
  80. ]
  81. origin_map = {
  82. "hotel": "酒店源",
  83. "multicast": "组播源",
  84. "subscribe": "订阅源",
  85. "online_search": "关键字源",
  86. "whitelist": "白名单",
  87. "local": "本地源",
  88. }
  89. ipv6_proxy = "http://www.ipv6proxy.net/go.php?u="
  90. foodie_url = "http://www.foodieguide.com/iptvsearch/"
  91. foodie_hotel_url = "http://www.foodieguide.com/iptvsearch/hoteliptv.php"
  92. waiting_tip = "🔍️未找到结果文件,若已启动更新,请耐心等待更新完成..."