Skip to content

Commit

Permalink
feat: add epg!
Browse files Browse the repository at this point in the history
  • Loading branch information
abc1763613206 committed Feb 17, 2021
1 parent 02d1ca8 commit a68690f
Show file tree
Hide file tree
Showing 11 changed files with 6,912 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ TLDR: 太闲了。





-----

**现已提供从 [ EPG 频道列表](http://epg.51zmt.top:8000/) 匹配的 `m3u8` 文件!详见[epg/README.md](epg/README.md)**


- 由于目前主要还是自用,故打算每次手动生成。
- `merged` 为全部直播源,`groups` 文件夹里为各个直播源的分类。
-`simple` 的为纯净格式**(不带来源与分辨率)**
- 目前只输出了 `txt` 格式,急着用的可以自行用 [Telelist](https://guihet.com/tvlive-telelist.html) 进行转换,其他格式慢慢写。
- 目前~~只输出了 `txt` 格式~~,急着用的可以自行用 [Telelist](https://guihet.com/tvlive-telelist.html) 进行转换,其他格式慢慢写。
- 关于**分类**`difang` 分类为地方频道与 IPTV 特色频道(含部分海外频道),`cctv` 为 CCTV 下属频道(含部分特色频道与 CGTN),`weishi` 为地方卫视(含凤凰卫视)
- 关于来源与命名:频道命名尽量遵循[ EPG 频道列表](http://epg.51zmt.top:8000/) 中的格式进行命名统一以确保正确匹配;来源命名多使用 IPIP 进行 IP 段标注,`difang` 分类为目测(小地方台基本上只有官方供源,要是挨个查 IP 的话会出事)
- 现阶段可以下载直播源上传至 [ EPG 频道列表](http://epg.51zmt.top:8000/)自动匹配节目表。
- ~~现阶段可以下载直播源上传至 [ EPG 频道列表](http://epg.51zmt.top:8000/)自动匹配节目表。~~
- 脚本所做的工作:通过 `requests``ffprobe` 检测直播源,后进行分类,最后用有效信息输出新的 `csv`
- 比较重要的一点:我主要使用家机(当前是北方移动)进行检测,直播源可用性对地区依赖较大,有必要时请自行跑脚本检测。
- 脚本会去除仅音频/视频的直播源,所以该源显然不含音频广播/无声直播。
Expand Down
21 changes: 21 additions & 0 deletions epg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### 这些是什么?
该文件夹存储了由 `generate.py` 爬取生成的匹配[ EPG 频道列表](http://epg.51zmt.top:8000/)`m3u8` 文件,您可以直接取用,命名方式参考 [主 README ](../README.md)
导入该款 `m3u8` 后,您可以通过将电子节目单(EPG)地址设为 `http://epg.51zmt.top:8000/e.xml` 来获取自助匹配电子节目单的体验,具体方法可以谷歌。

感谢该站站长提供的优质节目单。

----

- 总合并直播源:
- 带来源:[`https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/merged.txt`](https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/merged.txt)
- 不带来源: [`https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/merged-simple.txt`](https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/merged-simple.txt)
- 分类
- `cctv`
- 带来源:[`https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/cctv.txt`](https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/cctv.txt)
- 不带来源:[`https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/cctv-simple.txt`](https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/cctv-simple.txt)
- `difang`
- 带来源:[`https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/weishi.txt`](https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/weishi.txt)
- 不带来源:[`https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/weishi-simple.txt`](https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/weishi-simple.txt)
- `difang`
- 带来源:[`https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/difang.txt`](https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/difang.txt)
- 不带来源:[`https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/difang-simple.txt`](https://cdn.jsdelivr.net/gh/abc1763613206/myiptv@latest/epg/difang-simple.txt)
299 changes: 299 additions & 0 deletions epg/cctv-simple.m3u

Large diffs are not rendered by default.

299 changes: 299 additions & 0 deletions epg/cctv.m3u

Large diffs are not rendered by default.

935 changes: 935 additions & 0 deletions epg/difang-simple.m3u

Large diffs are not rendered by default.

935 changes: 935 additions & 0 deletions epg/difang.m3u

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions epg/generate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import os
import requests
import gzip
import io
import time
from bs4 import BeautifulSoup

url = 'http://epg.51zmt.top:8000/upload/'

def get_epg(a, b):
f = os.path.join(a, b)
files = {'myfile': open(f,'rb')}
print('Converting {}'.format(f))
r = requests.post(url,files=files)
print(r.text)
soup = BeautifulSoup(r.text, 'html.parser')
links = soup.find_all('a')
for item in links:
m3u8url = item.get('href')
print(m3u8url)
r1 = requests.get(m3u8url)
name = str(b)[:-4] + '.m3u'
with open(name, 'wb') as f1:
f1.write(r1.content)
return




if __name__ == '__main__':
for root, dirs, files in os.walk("..", topdown=False):
for name in files:
if '.txt' in name:
# print(os.path.join(root, name))
get_epg(root, name)

Loading

0 comments on commit a68690f

Please sign in to comment.