Skip to content

Commit

Permalink
Merge pull request #213 from Guovin/dev
Browse files Browse the repository at this point in the history
Release:v1.3.3
  • Loading branch information
Guovin authored Jul 19, 2024
2 parents 4bd7b9c + 3dc1dad commit 515b9fb
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 86 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: 'update schedule'
on:
schedule:
- cron: '0 22 * * *'
- cron: '0 10 * * *'
workflow_dispatch:
branches:
- master
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# 更新日志(Changelog)

## v1.3.3

### 2024/7/19

- 支持 Docker 卷挂载目录映射(Support for Docker volume mount directory mapping)
- 新增 requests 随机 User-Agent(Added random User-Agent for requests)
- 修复读取用户配置问题(#208)(Fixed issue with reading user configuration (#208))
- 支持单日更新两次:6 点与 18 点(Supports updating twice a day: at 6 AM and 6 PM)

## v1.3.2

### 2024/7/10
Expand Down
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
FROM python:3.8-slim

WORKDIR /app
ARG APP_WORKDIR=/tv

COPY . /app
ENV APP_WORKDIR=$APP_WORKDIR

COPY . $APP_WORKDIR

WORKDIR $APP_WORKDIR

RUN pip install -i https://mirrors.aliyun.com/pypi/simple pipenv

RUN pipenv install

RUN sed -i '[email protected]@mirrors.aliyun.com@g' /etc/apt/sources.list \
&& sed -i '[email protected]@mirrors.aliyun.com@g' /etc/apt/sources.list
RUN sed -i "[email protected]@mirrors.aliyun.com@g" /etc/apt/sources.list \
&& sed -i "[email protected]@mirrors.aliyun.com@g" /etc/apt/sources.list

RUN apt-get update && apt-get install -y cron

ARG INSTALL_CHROMIUM=false

RUN if [ "$INSTALL_CHROMIUM" = "true" ]; then apt-get install -y chromium chromium-driver cron; fi

RUN (crontab -l 2>/dev/null; echo "0 22 * * * cd /app && pipenv run python main.py scheduled_task") | crontab -
RUN (crontab -l ; echo "0 22 * * * cd $APP_WORKDIR && /usr/local/bin/pipenv run python main.py scheduled_task 2>&1 | tee -a /var/log/tv.log"; echo "0 10 * * * cd $APP_WORKDIR && /usr/local/bin/pipenv run python main.py scheduled_task 2>&1 | tee -a /var/log/tv.log") | crontab -

EXPOSE 8000

COPY entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /tv_entrypoint.sh

RUN chmod +x /entrypoint.sh
RUN chmod +x /tv_entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT /tv_entrypoint.sh
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- 自定义模板,生成您想要的频道分类与频道顺序
- 支持多种获取源方式:线上检索、组播源、酒店源、订阅源
- 接口测速验效,响应时间、分辨率优先级,过滤无效接口
- 定时执行,北京时间每日 6:00 执行更新
- 定时执行,北京时间每日 6:00 与 18:00 执行更新
- 支持多种运行方式:工作流、命令行、界面软件、Docker
- 更多功能请见[配置参数](./docs/config.md)

Expand Down Expand Up @@ -66,24 +66,22 @@ pipenv run ui

```bash
1. 拉取镜像:

requests版本:
requests:
docker pull guovern/tv-requests:latest

driver版本
driver
docker pull guovern/tv-driver:latest

2. 运行容器:docker run --name tv-requests或driver -d -p 8000:8000 guovern/tv-requests或driver

3. 查看更新结果:访问(域名:8000)
2. 运行容器:
docker run -d -p 8000:8000 guovern/tv-requests 或 tv-driver

4. 自定义(可选):
卷挂载参数(可选):
-v 宿主机路径/TV:/tv-requests 或 tv-driver

- 修改模板
docker cp 系统路径/user-demo.txt tv-requests或driver:/app/user-demo.txt
实现宿主机文件与容器文件同步,修改模板、配置、获取更新结果文件可直接在宿主机文件夹下操作
注:使用此命令运行容器,请务必先clone本项目至宿主机

- 修改配置:
docker cp 系统路径/user-config.py tv-requests或driver:/app/user-config.py
3. 查看更新结果:访问(域名:8000)
```

#### 注:方式一至三更新完成后的结果文件链接:http://本地 ip:8000
Expand Down
18 changes: 8 additions & 10 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Customize channel menus and automatically obtain and update the latest live sour
- Custom templates for creating desired channel categories and order
- Supports multiple source acquisition methods: online search, multicast source, hotel source, subscription source
- Interface speed testing and verification, with priority on response time and resolution, filtering out ineffective interfaces
- Scheduled execution at 6:00 AM Beijing time daily
- Scheduled execution at 6:00 AM and 18:00 PM Beijing time daily
- Supports various execution methods: workflows, command line, GUI software, Docker
- For more features, see [Config parameter](./docs/config_en.md)

Expand Down Expand Up @@ -66,24 +66,22 @@ It's recommended to try each one and choose the version that suits you. If you c

```bash
1. Pull the image:

For requests version:
docker pull guovern/tv-requests:latest

For driver version:
docker pull guovern/tv-driver:latest

2. Run the container: docker run --name tv-requests or driver -d -p 8000:8000 guovern/tv-requests or driver

3. Check the update results: Visit (domain:8000)
2. Run the container:
docker run -d -p 8000:8000 guovern/tv-requests or driver

4. Customization (optional):
Volume Mount Parameter (Optional):
-v host path/TV:/tv-requests or tv-driver

- Modify the template:
docker cp your_system_path/user-demo.txt tv-requests or driver:/app/user-demo.txt
This allows synchronization of files between the host machine and the container. Modifying templates, configurations, and retrieving updated result files can be directly operated in the host machine's folder.
Note: Before running the container with this command, be sure to first clone this project to the host machine.
- Modify the configuration:
docker cp your_system_path/user-config.py tv-requests or driver:/app/user-config.py
3. Check the update results: Visit (domain:8000)
```
#### Note: Link to the result file after updates of methods one to three: http://local ip:8000
Expand Down
9 changes: 4 additions & 5 deletions demo.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
广东频道,#genre#
广东珠江,http://113.86.204.95:9999/udp/239.77.0.1:5146
开平综合,http://php.jdshipin.com:8880/chudian.php?id=kpzh
开平生活,http://php.jdshipin.com:8880/chudian.php?id=kpsh
江门综合,http://www.namewee.xyz/gudou.php?id=jiangmenzongheHD
江门侨乡生活,http://www.namewee.xyz/gudou.php?id=jiangmenyitao_1500
广东体育,http://113.100.72.95:8899/udp/239.77.0.112:5146
广东体育,http://218.13.170.98:9901/tsfile/live/0019_1.m3u8
广东新闻,http://113.101.119.52:808/hls/106/index.m3u8
广东卫视,http://219.147.3.106:4455/newlive/live/hls/26/live.m3u8
大湾区卫视,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226218/index.m3u8
开平综合,http://php.jdshipin.com:8880/chudian.php?id=kpzh
开平生活,http://php.jdshipin.com:8880/chudian.php?id=kpsh
江门综合,http://www.namewee.xyz/gudou.php?id=jiangmenzongheHD
江门侨乡生活,http://www.namewee.xyz/gudou.php?id=jiangmenyitao_1500
新会综合,http://php.jdshipin.com:8880/chudian.php?id=xhzh
鹤山综合,http://php.jdshipin.com:8880/chudian.php?id=hszh
广州综合,http://www.namewee.xyz/gudou.php?id=gzhounewsHD
Expand Down
46 changes: 23 additions & 23 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
| 配置项 | 默认值 | 描述 |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| open_update | True | 开启更新,若关闭则只运行结果页面服务 |
| open_driver | False | 开启浏览器运行,较消耗性能 |
| open_proxy | True | 开启代理,自动获取免费可用代理 |
| source_file | "demo.txt" | 模板文件名称 |
| final_file | "result.txt" | 生成文件名称 |
| favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | 关注频道名称列表(仅用于与常规频道区分,自定义获取分页数量) |
| open_online_search | False | 开启线上检索源功能 |
| favorite_page_num | 5 | 关注频道获取分页数量 |
| default_page_num | 3 | 常规频道获取分页数量 |
| urls_limit | 10 | 单个频道接口数量 |
| open_sort | True | 开启排序功能(响应速度、日期、分辨率),若更执行时间较长可关闭此功能 |
| response_time_weight | 0.5 | 响应时间权重值(所有权重值总和应为 1) |
| resolution_weight | 0.5 | 分辨率权重值 (所有权重值总和应为 1) |
| recent_days | 30 | 获取最近时间范围内更新的接口(单位天),适当减小可避免出现匹配问题 |
| ipv_type | "ipv4" | 生成结果中接口的类型,可选值:"ipv4"、"ipv6"、"all" |
| domain_blacklist | ["epg.pw"] | 接口域名黑名单,用于过滤低质量含广告类域名的接口 |
| url_keywords_blacklist | [] | 接口关键字黑名单,用于过滤含特定字符的接口 |
| open_subscribe | True | 开启订阅源功能 |
| subscribe_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",<br>"https://m3u.ibert.me/txt/o_cn.txt",<br>"https://m3u.ibert.me/txt/j_iptv.txt"] | 订阅源列表 |
| open_multicast | True | 开启组播源功能 |
| region_list | ["all"] | 组播源地区列表,[更多地区](./fofa_map.py),"all"表示所有地区 |
| 配置项 | 默认值 | 描述 |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| open_update | True | 开启更新,若关闭则只运行结果页面服务 |
| open_driver | False | 开启浏览器运行,若更新无数据可开启此模式,较消耗性能 |
| open_proxy | True | 开启代理,自动获取免费可用代理,若更新无数据可开启此模式 |
| source_file | "demo.txt" | 模板文件名称 |
| final_file | "result.txt" | 生成文件名称 |
| favorite_list | ["广东珠江","CCTV-1","CCTV-5","CCTV-5+","CCTV-13","广东体育","广东卫视","大湾区卫视","浙江卫视","湖南卫视","翡翠台"] | 关注频道名称列表(仅用于与常规频道区分,自定义获取分页数量) |
| open_online_search | False | 开启线上检索源功能 |
| favorite_page_num | 5 | 关注频道获取分页数量 |
| default_page_num | 3 | 常规频道获取分页数量 |
| urls_limit | 10 | 单个频道接口数量 |
| open_sort | True | 开启排序功能(响应速度、日期、分辨率) |
| response_time_weight | 0.5 | 响应时间权重值(所有权重值总和应为 1) |
| resolution_weight | 0.5 | 分辨率权重值 (所有权重值总和应为 1) |
| recent_days | 30 | 获取最近时间范围内更新的接口(单位天),适当减小可避免出现匹配问题 |
| ipv_type | "ipv4" | 生成结果中接口的类型,可选值:"ipv4"、"ipv6"、"all" |
| domain_blacklist | ["epg.pw"] | 接口域名黑名单,用于过滤低质量含广告类域名的接口 |
| url_keywords_blacklist | [] | 接口关键字黑名单,用于过滤含特定字符的接口 |
| open_subscribe | True | 开启订阅源功能 |
| subscribe_urls | ["https://m3u.ibert.me/txt/fmml_dv6.txt",<br>"https://m3u.ibert.me/txt/o_cn.txt",<br>"https://m3u.ibert.me/txt/j_iptv.txt"] | 订阅源列表 |
| open_multicast | True | 开启组播源功能 |
| region_list | ["all"] | 组播源地区列表,[更多地区](./fofa_map.py),"all"表示所有地区 |
Loading

0 comments on commit 515b9fb

Please sign in to comment.