Skip to content

Commit

Permalink
Merge pull request Guovin#76 from Guovin/dev
Browse files Browse the repository at this point in the history
Release: v1.0.6
  • Loading branch information
Guovin authored Apr 12, 2024
2 parents cfd22e3 + 29eab4b commit 552352b
Show file tree
Hide file tree
Showing 15 changed files with 1,858 additions and 1,511 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 'update schedule'

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
branches:
- master
- dev
jobs:
push:
runs-on: ${{ matrix.operating-system }}
timeout-minutes: 120
strategy:
matrix:
operating-system: ['ubuntu-20.04']
steps:
- uses: actions/checkout@v3
- name: Run with setup-python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
update-environment: false
cache: 'pipenv'
- name: Install Selenium
run: |
sudo pip3 install selenium
- name: Set up Chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable
- name: Download chrome driver
uses: nanasess/setup-chromedriver@master
- name: Launch chrome driver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
- name: Install pipenv
run: pip3 install --user pipenv
- name: Install dependecies
run: pipenv --python python3 && pipenv install
- name: Build
run: pipenv run build
- name: Commit and push if changed
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff
final_file=$(python -c '
try:
import user_config as config
except ImportError:
import config
print(config.final_file)')
if [[ -f "$final_file" ]]; then
git add -f "$final_file"
fi
if [[ -f user_result.log ]]; then
git add -f user_result.log
elif [[ -f result.log ]]; then
git add -f result.log
fi
if ! git diff --staged --quiet; then
git commit -m "Github Action Auto Updated"
git push --force
fi
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# 更新日志(Changelog)

## v1.0.6

### 2024/4/12

- 恢复工作流更新,请谨慎合理使用,勿尝试更改默认运行参数,可能导致封禁的风险!首推使用本地更新(Workflow updates have been restored. Please use them carefully and do not attempt to change the default runtime parameters, as this may risk being banned! It is recommended to use local updates first.)
- 调整默认配置参数,降低单次更新运行时长(Adjusted the default configuration parameters to reduce the runtime of a single update.)
- 依赖版本锁定,解决可能出现的环境错误(#72)(Dependency versions have been locked to solve potential environmental errors (#72).)
- 优化逻辑与增加检测,避免网络异常占用工作流运行(Optimized logic and added checks to prevent network anomalies from occupying workflow operations.)

## v1.0.5

### 2024/4/10
Expand Down
18 changes: 9 additions & 9 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ build = "python main.py"
[dev-packages]

[packages]
requests = "*"
feedparser = "*"
pytz = "*"
selenium = "*"
selenium-stealth = "*"
aiohttp = "*"
bs4 = "*"
tqdm = "*"
requests = "2.31.0"
feedparser = "6.0.11"
pytz = "2024.1"
selenium = "4.19.0"
selenium-stealth = "1.0.6"
aiohttp = "3.9.3"
bs4 = "0.0.2"
tqdm = "4.66.2"

[requires]
python_version = "*"
python_version = ">=3.8"
4 changes: 2 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ Customize channel menus, automatically fetch and update the latest live source i
- Customize templates to generate the channel categories and order you want
- Interface validation to filter out invalid interfaces
- Comprehensive sorting based on response time and resolution
<s>
- Scheduled execution, updates every day at 8:00 am Beijing time
- The maximum number of update channels is 200
</s>
- Set up key focus channels and configure the number of pages fetched separately
- Pagination results retrieval (configurable number of pages and interfaces)
- Ensure update timeliness, configure to retrieve interfaces updated within a recent time range
Expand All @@ -26,9 +24,9 @@ Customize channel menus, automatically fetch and update the latest live source i
| source_file | "demo.txt" | Template file name |
| final_file | "result.txt" | Generated file name |
| favorite_list | ["CCTV1","CCTV13"] | List of favorite channel names (used only to distinguish from regular channels, custom page retrieval quantity) |
| favorite_page_num | 6 | Page retrieval quantity for favorite channels |
| default_page_num | 4 | Page retrieval quantity for regular channels |
| urls_limit | 15 | Number of interfaces per channel |
| favorite_page_num | 3 | Page retrieval quantity for favorite channels |
| default_page_num | 2 | Page retrieval quantity for regular channels |
| urls_limit | 10 | Number of interfaces per channel |
| response_time_weight | 0.5 | Response time weight value (the sum of all weight values should be 1) |
| resolution_weight | 0.5 | Resolution weight value (the sum of all weight values should be 1) |
| recent_days | 30 | Retrieve interfaces updated within a recent time range (in days), reducing appropriately can avoid matching issues |
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
- 自定义模板,生成您想要的频道分类与频道顺序
- 接口验效,过滤无效接口
- 按响应时间、分辨率综合权衡排序
<s>
- 定时执行,北京时间每日 8:00 执行更新一次
- 更新频道数量上限 200 个
</s>
- 可设置重点关注频道,单独配置获取分页的数量
- 分页结果获取(可配置页数、接口数量)
- 保证更新时效性,配置获取最近时间范围内更新的接口
Expand All @@ -26,9 +24,9 @@
| source_file | "demo.txt" | 模板文件名称 |
| final_file | "result.txt" | 生成文件名称 |
| favorite_list | ["CCTV1","CCTV13"] | 关注频道名称列表(仅用于与常规频道区分,自定义获取分页数量) |
| favorite_page_num | 6 | 关注频道获取分页数量 |
| default_page_num | 4 | 常规频道获取分页数量 |
| urls_limit | 15 | 单个频道接口数量 |
| favorite_page_num | 3 | 关注频道获取分页数量 |
| default_page_num | 1 | 常规频道获取分页数量 |
| urls_limit | 10 | 单个频道接口数量 |
| response_time_weight | 0.5 | 响应时间权重值(所有权重值总和应为 1) |
| resolution_weight | 0.5 | 分辨率权重值 (所有权重值总和应为 1) |
| recent_days | 30 | 获取最近时间范围内更新的接口(单位天),适当减小可避免出现匹配问题 |
Expand Down
6 changes: 3 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"湖南卫视",
"翡翠台",
]
favorite_page_num = 6
default_page_num = 4
urls_limit = 15
favorite_page_num = 3
default_page_num = 2
urls_limit = 10
response_time_weight = 0.5
resolution_weight = 0.5
recent_days = 30
Expand Down
Loading

0 comments on commit 552352b

Please sign in to comment.