constants.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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_pattern = r"((https?):\/\/)?(\[[0-9a-fA-F:]+\]|([\w-]+\.)+[\w-]+)(:[0-9]{1,5})?(\/[^\s]*)?(\$[^\s]+)?"
  12. rtp_pattern = r"^([^,,]+)(?:[,,])?(rtp://.*)$"
  13. demo_txt_pattern = r"^([^,,]+)(?:[,,])?(?!#genre#)" + r"(" + url_pattern + r")?"
  14. txt_pattern = r"^([^,,]+)(?:[,,])(?!#genre#)" + r"(" + url_pattern + r")"
  15. m3u_pattern = r"^#EXTINF:-1.*?(?:,|,)(.*?)\n" + r"(" + url_pattern + r")"
  16. sub_pattern = r"-|_|\((.*?)\)|\((.*?)\)|\[(.*?)\]|\「(.*?)\」| |||频道|普清|标清|高清|HD|hd|超清|超高|超高清|中央|央视|电视台|台|电信|联通|移动"
  17. replace_dict = {
  18. "plus": "+",
  19. "PLUS": "+",
  20. "+": "+",
  21. "CCTV1综合": "CCTV1",
  22. "CCTV2财经": "CCTV2",
  23. "CCTV3综艺": "CCTV3",
  24. "CCTV4国际": "CCTV4",
  25. "CCTV4中文国际": "CCTV4",
  26. "CCTV4欧洲": "CCTV4",
  27. "CCTV5体育": "CCTV5",
  28. "CCTV5+体育赛视": "CCTV5+",
  29. "CCTV5+体育赛事": "CCTV5+",
  30. "CCTV5+体育": "CCTV5+",
  31. "CCTV6电影": "CCTV6",
  32. "CCTV7军事": "CCTV7",
  33. "CCTV7军农": "CCTV7",
  34. "CCTV7农业": "CCTV7",
  35. "CCTV7国防军事": "CCTV7",
  36. "CCTV8电视剧": "CCTV8",
  37. "CCTV9记录": "CCTV9",
  38. "CCTV9纪录": "CCTV9",
  39. "CCTV10科教": "CCTV10",
  40. "CCTV11戏曲": "CCTV11",
  41. "CCTV12社会与法": "CCTV12",
  42. "CCTV13新闻": "CCTV13",
  43. "CCTV新闻": "CCTV13",
  44. "CCTV14少儿": "CCTV14",
  45. "CCTV15音乐": "CCTV15",
  46. "CCTV16奥林匹克": "CCTV16",
  47. "CCTV17农业农村": "CCTV17",
  48. "CCTV17农业": "CCTV17",
  49. }
  50. region_list = [
  51. "广东",
  52. "北京",
  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. origin_map = {
  80. "hotel": "酒店源",
  81. "multicast": "组播源",
  82. "subscribe": "订阅源",
  83. "online_search": "关键字源",
  84. }
  85. ipv6_proxy = "http://www.ipv6proxy.net/go.php?u="
  86. foodie_url = "http://www.foodieguide.com/iptvsearch/"
  87. foodie_hotel_url = "http://www.foodieguide.com/iptvsearch/hoteliptv.php"
  88. waiting_tip = "🔍️未找到结果文件,若已启动更新,请耐心等待更新完成..."