Skip to content

Commit

Permalink
feat:open_url_info (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guovin committed Oct 22, 2024
1 parent 4881cb2 commit d55d873
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ origin_type_prefer = hotel,multicast,subscribe,online_search
hotel_num = 10
multicast_num = 10
subscribe_num = 10
online_search_num = 10
online_search_num = 10
open_url_info = True
1 change: 1 addition & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@
| multicast_num | 10 | 结果中偏好的组播源接口数量 |
| subscribe_num | 10 | 结果中偏好的订阅源接口数量 |
| online_search_num | 10 | 结果中偏好的在线搜索接口数量 |
| open_url_info | True | 开启显示接口说明信息,用于控制是否显示分辨率、接口协议类型等信息,为$符号后的内容,播放软件使用该信息对接口进行描述 |
1 change: 1 addition & 0 deletions docs/config_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@
| multicast_num | 10 | The number of preferred multicast source interfaces in the results |
| subscribe_num | 10 | The number of preferred subscribe source interfaces in the results |
| online_search_num | 10 | The number of preferred online search interfaces in the results |
| open_url_info | True | Enable display of API description information, used to control whether to show resolution, API protocol type, etc., the content after the $ symbol, playback software uses this information to describe the API |
8 changes: 7 additions & 1 deletion utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ def get_total_urls_from_info_list(infoList):
if len(total_urls) >= urls_limit:
break

return list(dict.fromkeys(total_urls))[:urls_limit]
total_urls = list(dict.fromkeys(total_urls))[:urls_limit]

open_url_info = config.getboolean("Settings", "open_url_info", fallback=True)
if not open_url_info:
return [url.split("$", 1)[0] for url in total_urls]
else:
return total_urls


def get_total_urls_from_sorted_data(data):
Expand Down

0 comments on commit d55d873

Please sign in to comment.