Convert Figma logo to code with AI

EvilCult logoiptv-m3u-maker

IPTV 国内+国外 电视台直播源m3u文件, 收集&汇总&本地源脚本

2,735
481
2,735
28

Top Related Projects

84,238

Collection of publicly available IPTV channels from all over the world

Quick Overview

The EvilCult/iptv-m3u-maker is a Python script that generates an M3U playlist file from a list of IPTV channels. It can be used to create a customized IPTV playlist for personal use or to share with others.

Pros

  • Automated Playlist Generation: The script can automatically generate an M3U playlist file from a list of IPTV channels, saving users time and effort.
  • Customizable: Users can easily modify the script to include or exclude specific channels, change the output file name, and adjust other settings.
  • Cross-platform Compatibility: The script can be run on various operating systems, including Windows, macOS, and Linux.
  • Open-source: The project is open-source, allowing users to contribute, report issues, and customize the script to their needs.

Cons

  • Limited Channel Sources: The script relies on a predefined list of IPTV channels, which may not include all the channels a user is interested in.
  • Requires Python: Users need to have Python installed on their system to run the script, which may be a barrier for some.
  • Potential Maintenance Issues: As the IPTV landscape changes, the script may require periodic updates to maintain compatibility with the available channels.
  • No Graphical User Interface (GUI): The script is command-line-based, which may not be the preferred interface for some users.

Code Examples

The EvilCult/iptv-m3u-maker is a Python script, and here are a few examples of how it can be used:

  1. Generating a Basic M3U Playlist:
from iptv_m3u_maker import IPTVPlaylistMaker

playlist_maker = IPTVPlaylistMaker()
playlist_maker.generate_playlist()
playlist_maker.save_playlist('output.m3u')

This code creates an instance of the IPTVPlaylistMaker class, generates the playlist, and saves it to a file named output.m3u.

  1. Filtering Channels by Country:
from iptv_m3u_maker import IPTVPlaylistMaker

playlist_maker = IPTVPlaylistMaker()
playlist_maker.filter_by_country('United States')
playlist_maker.generate_playlist()
playlist_maker.save_playlist('us_channels.m3u')

This code filters the channels to include only those from the United States and saves the resulting playlist to a file named us_channels.m3u.

  1. Customizing the Playlist Output:
from iptv_m3u_maker import IPTVPlaylistMaker

playlist_maker = IPTVPlaylistMaker()
playlist_maker.set_output_filename('custom_playlist.m3u')
playlist_maker.set_output_encoding('utf-8')
playlist_maker.generate_playlist()
playlist_maker.save_playlist()

This code sets the output file name to custom_playlist.m3u and the output encoding to utf-8 before generating and saving the playlist.

Getting Started

To use the EvilCult/iptv-m3u-maker, follow these steps:

  1. Ensure you have Python 3 installed on your system.

  2. Clone the repository or download the source code:

    git clone https://github.com/EvilCult/iptv-m3u-maker.git
    
  3. Navigate to the project directory:

    cd iptv-m3u-maker
    
  4. Install the required dependencies:

    pip install -r requirements.txt
    
  5. Run the script to generate the M3U playlist:

    python iptv_m3u_maker.py
    

    This will create a default output.m3u file in the project directory.

  6. (Optional) Customize the script by modifying the iptv_m3u_maker.py file to include or exclude specific channels, change the output file name, or adjust other settings.

  7. Run the script again to generate the updated playlist.

That's it! You now have a customized M3U playlist

Competitor Comparisons

84,238

Collection of publicly available IPTV channels from all over the world

Pros of iptv

  • Larger and more active community with frequent updates
  • Extensive collection of channels from various countries
  • Well-organized repository structure with clear documentation

Cons of iptv

  • May include some unstable or unreliable streams
  • Requires manual filtering for specific regions or languages

Code Comparison

iptv-m3u-maker:

def get_channel_info(channel):
    channel_info = {
        'name': channel.get('name', ''),
        'url': channel.get('url', ''),
        'group': channel.get('group', '')
    }
    return channel_info

iptv:

def parse_playlist(playlist_content):
    playlist = m3u8.loads(playlist_content)
    channels = []
    for segment in playlist.segments:
        channels.append({
            'name': segment.title,
            'url': segment.uri
        })
    return channels

The code snippets show different approaches to handling channel information. iptv-m3u-maker uses a dictionary-based approach, while iptv utilizes the m3u8 library for parsing playlist content.

iptv-m3u-maker focuses on extracting specific channel attributes, whereas iptv parses entire playlists and creates a list of channels with basic information.

Both projects serve the purpose of managing IPTV channels, but iptv offers a more comprehensive and community-driven approach, while iptv-m3u-maker provides a simpler, more focused solution for creating M3U playlists.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

IPTV m3u 直播源 收集 & 汇总

项目详细说明

项目更新记录

简介


主要功能

收集网络上现有的一些网友共享的直播源, 将其汇总后.

对每个连接进行测试, 同时记录当前网络对该连接的延迟, 同时对其标题进行一定的格式化.

最终, 针对当前网络生成一份可用的, 同类速度最优的 “播放列表”.

将其输出为 m3u 文件

程序内置服务器功能, 本地运行访问: http://{你的IP}:9527/m3u

目前进度

目前库存频道总数: 1024

已放出优质频道总是: 269

!!! 项目持续更新中 !!!

数据来源


数据源总是挂掉的比新增的快,欢迎推荐稳定数据源

项目使用方法


本项目基于 python3.7 进行开发

手动执行

git clone https://github.com/EvilCult/iptv-m3u-maker.git

cd iptv-m3u-maker/python

python iptv.py

人生苦短, 我用Docker

建议以Docker 的方式,直接在路由器上运行,本地检测地址访问,更为精准.

git clone https://github.com/EvilCult/iptv-m3u-maker.git

cd iptv-m3u-maker

docker build -t iptv-maker:latest .

docker run -it -d --name iptv -p 9527:9527 iptv-maker:latest

build的过程中会自动配置程序运行环境, 其中已包含flask服务器,可直接访问 ' http://{运行docker的机器的IP地址}:9527 ' 查看当前程序状态,以及相关操作

其他

待程序稍微稳定后回只做一个镜像丢到docker hub上去, 直接拉取就好.

其他


相关项目

「iptv-m3u-player」 - 基于本项目的衍生项目, 基于Electron+React编写的一个轻量级桌面客户端.频道数据会随本项目更新. Mac上不知道用什么客户端的,可以试试. (当前更新涉及文件路径修改, 该项目暂时不可直接使用.)

Android TV 请使用 Kodi + ‘PVR IPTV Simple Client’

iOS 请使用 Cloud Stream

PC 我就不太了解了....

已知问题

  • 访问速度慢,视频卡顿
    • 解决方案: 不要直接引用项目中的tv.m3u8文件,clone项目到本地,在本地网络环境下执行项目,生成新的文件
  • 电视,广播未分开
    • 暂时未处理,会v在后续版本进行分类
  • 程序运行报错
    • 可能是部分 分享源 网站服务当机... 可自行注释部分代码 or 提交 issues