This commit is contained in:
lalifeier
2025-03-15 17:28:34 +08:00
commit f9d687c39d
298 changed files with 161474 additions and 0 deletions

45
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,45 @@
FROM mcr.microsoft.com/devcontainers/base:jammy
# FROM mcr.microsoft.com/devcontainers/base:jammy
ARG DEBIAN_FRONTEND=noninteractive
ARG USER=vscode
RUN DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y build-essential --no-install-recommends make \
ca-certificates \
git \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
curl \
llvm \
libncurses5-dev \
xz-utils \
tk-dev \
libxml2-dev \
libxmlsec1-dev \
libffi-dev \
liblzma-dev
# Python and poetry installation
USER $USER
ARG HOME="/home/$USER"
ARG PYTHON_VERSION=3.11
# ARG PYTHON_VERSION=3.10
ENV PYENV_ROOT="${HOME}/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:$PATH"
RUN echo "done 0" \
&& curl https://pyenv.run | bash \
&& echo "done 1" \
&& pyenv install ${PYTHON_VERSION} \
&& echo "done 2" \
&& pyenv global ${PYTHON_VERSION} \
&& echo "done 3" \
&& curl -sSL https://install.python-poetry.org | python3 - \
&& poetry config virtualenvs.in-project true

View File

@@ -0,0 +1,29 @@
{
"name": "poetry3-poetry-pyenv",
"build": {
"dockerfile": "Dockerfile"
},
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
// "features": {},
// 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// 👇 Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "",
// 👇 Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions":["ms-python.python", "njpwerner.autodocstring"]
}
},
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/balazs23/devcontainers-features/bazel:1": {}
}
// 👇 Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

6
.flake8 Normal file
View File

@@ -0,0 +1,6 @@
[flake8]
max-line-length = 120
extend-ignore = E203
exclude =
v_parse
tests

39
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: 🐛 Bug Report
description: Create a new ticket for a bug
title: "🐛 [BUG] - <title>"
labels: ['bug']
body:
- type: markdown
attributes:
value: >
#### Before submitting a bug, please make sure the issue hasn't been already addressed by searching through [the existing and past issues](https://github.com/lalifeier/IPTV/issues?q=is%3Aissue+sort%3Acreated-desc+).
- type: textarea
attributes:
label: 🐛 Describe the bug
description: |
Please provide a clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: 🌐 Network Environment
description: |
Please provide details about your network environment (e.g., ISP, connection type, VPN, etc.).
validations:
required: true
- type: textarea
attributes:
label: 📺 Player
description: |
Please provide details about the player you are using (e.g., VLC, MPV, web player, etc.).
validations:
required: true
- type: markdown
attributes:
value: >
Thanks for contributing 🎉!

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

View File

@@ -0,0 +1,20 @@
name: 🚀 Feature request
description: Create a new ticket for a new feature request
title: "🚀 [FEATURE] - <title>"
labels: ['question']
body:
- type: textarea
attributes:
label: 🚀 Feature Description
description: >
A clear and concise description of the feature proposal. Please outline the motivation for the proposal.
Is your feature request related to a specific problem? For example, *"I'm working on X and would like Y to be possible"*.
If this is related to another GitHub issue, please link it here.
validations:
required: true
- type: markdown
attributes:
value: >
Thanks for contributing 🎉!

62
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.11"
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root && poetry install --no-interaction --no-root --with test
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
run: poetry install --no-interaction && poetry install --no-interaction --with test
#----------------------------------------------
# run test suite
#----------------------------------------------
# - name: Run tests
# run: |
# source .venv/bin/activate
# pytest tests/
# coverage report

38
.github/workflows/cleanup.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Monthly Cleanup
on:
schedule:
- cron: '30 0 1 * *'
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Download BFG
run: curl -Lo bfg.jar https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar
- name: Delete all files with BFG
run: java -jar bfg.jar --delete-all-files .
# 或者,如果要删除特定文件:
# - name: Delete specific files with BFG
# run: java -jar bfg.jar --delete-files '要删除的文件名' .
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Monthly cleanup with BFG"
branch: main
push_options: --force

39
.github/workflows/epg.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: Auto Update EPG
on:
workflow_dispatch:
schedule:
- cron: "5 1 * * *"
jobs:
epg:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Update EPG Files
run: |
rm -f e.xml
wget https://epg.112114.xyz/pp.xml -O e.xml
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto Update EPG
branch: main
push_options: '--force'
- name: Delete workflow runs
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
with:
repository: ${{ github.repository }}
workflow: ".github/workflows/epg.yml"
older-than-seconds: 3600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

64
.github/workflows/iptv.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
name: Auto Update IPTV
on:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: "0 * * * *"
jobs:
iptv:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Get Currrent Date
run: echo "DATE=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV
- name: Run Update IPTV
run: |
python iptv.py
env:
SALT: ${{ secrets.SALT }}
PROXY_URL: ${{ secrets.PROXY_URL }}
- name: Update Deployment Time
run: |
if grep -q "Last deployment time:" README.md; then
sed -i "/Last deployment time:/c\Last deployment time: $DATE" README.md
else
echo "Last deployment time: $DATE" >> README.md
fi
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto Update IPTV
branch: main
push_options: '--force'
- name: Delete workflow runs
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
with:
repository: ${{ github.repository }}
workflow: ".github/workflows/iptv.yml"
older-than-seconds: 3600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

50
.github/workflows/iptv_hotel_ip.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Auto Update Hotel IPTV IP
on:
workflow_dispatch:
schedule:
- cron: "5 2 * * *"
jobs:
iptv:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install -r requirements.txt && playwright install && playwright install-deps
- name: Get Currrent Date
run: echo "DATE=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV
- name: Run Update Hotel IPTV
run: |
python main.py --type hotel --ip
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto Update IPTV
branch: main
push_options: '--force'
- name: Delete workflow runs
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
with:
repository: ${{ github.repository }}
workflow: ".github/workflows/iptv_hotel_ip.yml"
older-than-seconds: 3600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,50 @@
name: Auto Update Hotel IPTV
on:
workflow_dispatch:
schedule:
- cron: "15 6,12,18,22 * * *"
jobs:
iptv:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install -r requirements.txt && playwright install && playwright install-deps
- name: Get Currrent Date
run: echo "DATE=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV
- name: Run Update Hotel IPTV
run: |
python main.py --type hotel --playlist
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto Update IPTV
branch: main
push_options: '--force'
- name: Delete workflow runs
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
with:
repository: ${{ github.repository }}
workflow: ".github/workflows/iptv_hotel_playlist.yml"
older-than-seconds: 3600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

50
.github/workflows/iptv_udpxy_ip.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Auto Update udpxy IPTV IP
on:
workflow_dispatch:
schedule:
- cron: "5 8,16 * * *"
jobs:
iptv:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install -r requirements.txt && playwright install && playwright install-deps
- name: Get Currrent Date
run: echo "DATE=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV
- name: Run Update udpxy IPTV
run: |
python main.py --type udpxy --ip
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto Update IPTV
branch: main
push_options: '--force'
- name: Delete workflow runs
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
with:
repository: ${{ github.repository }}
workflow: ".github/workflows/iptv_udpxy_ip.yml"
older-than-seconds: 3600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,50 @@
name: Auto Update udpxy IPTV
on:
workflow_dispatch:
schedule:
- cron: "45 6,12,18,22 * * *"
jobs:
iptv:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install -r requirements.txt && playwright install && playwright install-deps
- name: Get Currrent Date
run: echo "DATE=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV
- name: Run Update udpxy IPTV
run: |
python main.py --type udpxy --playlist
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto Update IPTV
branch: main
push_options: '--force'
- name: Delete workflow runs
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
with:
repository: ${{ github.repository }}
workflow: ".github/workflows/iptv_udpxy_playlist.yml"
older-than-seconds: 3600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

50
.github/workflows/iptv_udpxy_rtp.yml vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Auto Update udpxy RTP IPTV
on:
workflow_dispatch:
schedule:
- cron: "5 4 * * *"
jobs:
iptv:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install -r requirements.txt && playwright install && playwright install-deps
- name: Get Currrent Date
run: echo "DATE=$(date +'%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV
- name: Run Update udpxy IPTV
run: |
python main.py --type udpxy --rtp
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto Update IPTV
branch: main
push_options: '--force'
- name: Delete workflow runs
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
with:
repository: ${{ github.repository }}
workflow: ".github/workflows/iptv_udpxy_rtp.yml"
older-than-seconds: 3600
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

43
.github/workflows/pull_request_lint.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Pull Request Linting
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: write
issues: write
pull-requests: write
jobs:
lint_pull_requests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Lint pull request
run: |
echo "Performing lint checks on the pull request"
# Add your linting commands or scripts here
# For example, running a linting tool or script
# ./run-lint.sh
- name: Check for stale pull requests
uses: actions/stale@v9
with:
days-before-stale: 30
days-before-close: 7
stale-message: "This pull request has been marked as stale due to inactivity."
closed-message: "This pull request has been closed due to inactivity."
- name: Comment on pull request
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }}
uses: actions-ecosystem/action-create-comment@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
body: |
Hi @${{ github.event.pull_request.user.login }}, thank you for your pull request. We will review it soon.

176
.gitignore vendored Normal file
View File

@@ -0,0 +1,176 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
logs
node_modules/
data/
constraints.txt
# Bazel directories
/bazel-*
/bazel-bin
/bazel-genfiles
/bazel-out
/bazel-testlogs
user.bazelrc
.vercel

101
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,101 @@
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
ci:
autoupdate_schedule: weekly
skip: []
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/pycqa/isort
rev: 5.11.4
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
# - repo: https://github.com/myint/autoflake
# rev: v2.0.0
# hooks:
# - id: autoflake
# args:
# [
# --in-place,
# --remove-all-unused-imports,
# --remove-unused-variable,
# --ignore-init-module-imports,
# ]
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.991
# hooks:
# - id: mypy
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.12.1
# hooks:
# - id: blacken-docs
# - repo: local
# hooks:
# - id: isort
# name: isort
# stages: [commit]
# language: system
# entry: poetry run isort
# types: [python]
# - id: black
# name: black
# stages: [commit]
# language: system
# entry: poetry run black
# types: [python]
# - id: flake8
# name: flake8
# stages: [commit]
# language: system
# entry: poetry run flake8
# types: [python]
# - id: mypy
# name: mypy
# stages: [commit]
# language: system
# entry: poetry run mypy .
# types: [python]
# pass_filenames: false
# - id: pytest
# name: pytest
# stages: [commit]
# language: system
# entry: poetry run pytest -v
# types: [python]
# pass_filenames: false
# always_run: true
# - id: pytest-cov
# name: pytest-cov
# stages: [push]
# language: system
# entry: poetry run pytest -v --cov --cov-fail-under=0
# types: [python]
# pass_filenames: false
# always_run: true

1
.python-version Normal file
View File

@@ -0,0 +1 @@
3.11.1

8
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,8 @@
{
"recommendations": [
"ms-vscode.cpptools",
"ms-python.python",
"ms-python.vscode-pylance",
"bungcip.better-toml"
]
}

26
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Python: FastAPI",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/main.py",
// "module": "uvicorn"
// "args": ["v_parse.server:app", "--reload", "--port", "8080"]
"jinja": true,
"justMyCode": true
}
]
}

17
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,17 @@
{
// Python & Pylance Setup
"python.languageServer": "Pylance",
// "python.envFile": "${workspaceFolder}/.env",
// "python.venvFolders": ["~/.cache/pypoetry/virtualenvs"],
// "python.defaultInterpreterPath": "/usr/bin/python",
// We use "black" as a formatter:
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--line-length", "120"],
// Use flake8 for linting
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--max-line-length=120"]
}

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 lalifeier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

104
README.md Normal file
View File

@@ -0,0 +1,104 @@
![IPTV](https://socialify.git.ci/lalifeier/IPTV/image?description=1&descriptionEditable=IPTV%20%E7%9B%B4%E6%92%AD%E6%BA%90&forks=1&language=1&name=1&owner=1&pattern=Circuit%20Board&stargazers=1&theme=Auto)
## ⚠️ 警告
- **本项目出于个人兴趣,仅供学习使用,禁止用于商业化活动。**
- **直播源均来自网络,仅供学习交流使用,未经版权方同意不得商用。因私自商用引发的问题,本人概不负责,感谢理解!**
- **请批判性看待部分电视节目内容,节目观点仅代表主持人与嘉宾,不代表作者立场。**
- **如本仓库中部分内容存在侵权行为,请留言联系我删除。**
---
## 🔗 订阅链接
- **TXT 订阅链接**
- `https://proxy.lalifeier.eu.org/https://raw.githubusercontent.com/lalifeier/IPTV/main/txt/IPTV.txt`
- **M3U 订阅链接**
- `https://proxy.lalifeier.eu.org/https://raw.githubusercontent.com/lalifeier/IPTV/main/m3u/IPTV.m3u`
- **酒店源 TXT 订阅链接**
- `https://proxy.lalifeier.eu.org/https://raw.githubusercontent.com/lalifeier/IPTV/main/txt/hotel/全国.txt`
- **组播源 TXT 订阅链接**
- `https://proxy.lalifeier.eu.org/https://raw.githubusercontent.com/lalifeier/IPTV/main/txt/udpxy/全国.txt`
- **聚合直播源 订阅链接**
- `https://proxy.lalifeier.eu.org/https://raw.githubusercontent.com/lalifeier/IPTV/main/m3u/Live.m3u`
- **虎牙直播源 订阅链接**
- `https://proxy.lalifeier.eu.org/https://raw.githubusercontent.com/lalifeier/IPTV/main/m3u/huya.m3u`
- **斗鱼直播源 订阅链接**
- `https://proxy.lalifeier.eu.org/https://raw.githubusercontent.com/lalifeier/IPTV/main/m3u/douyu.m3u`
- **YY直播源 订阅链接**
- `https://proxy.lalifeier.eu.org/https://raw.githubusercontent.com/lalifeier/IPTV/main/m3u/yy.m3u`
---
## 📚 使用教程
### 1⃣ 基于安卓系统的智能电视/电视盒子
1. 在智能电视/电视盒子上安装 DIPY 直播 APP[点我下载](http://x-x-xxx.github.io/diyp/DIYP%E5%BD%B1%E9%9F%B3%E7%BB%8F%E5%85%B8%E7%89%88.apk)
2. 添加 `TXT` 订阅链接(若不方便输入可以考虑使用外接键盘或者一些手机遥控软件)
- **使用订阅链接实现自动更新**
- 遥控器按:【设置】键 — 选择【接口设置】—【节目地址】
- 填入上面提供的 TXT 订阅链接
- 重启后生效
- **手动添加直播源**
- 遥控器按:【设置】键 — 选择【显示设置】—【自定义源】
- 使用电脑等设备访问 WEB 控制台
- 添加分类(如央视、卫视、港澳台)并在对应分类填入相应的直播源
- 添加后 DIPY APP 会立刻刷新,即可观看
3. 最后设置开机自启动即可(可选)
### 2⃣ Apple TV 和 APTV
1. 在 App Store 下载 [**Apple TV**](https://apps.apple.com/us/app/apple-tv/id1174078549) 或 [**APTV**](https://apps.apple.com/us/app/aptv/id1630403500) 软件
2. 添加 `M3U` 订阅链接
### 3⃣ Jellyfin、Emby、Plex 等流媒体管理软件
1. 添加 `M3U` 订阅链接
2. 添加指南数据源:选择 `XmlTV`,添加此网址:`https://raw.githubusercontent.com/lalifeier/IPTV/main/e.xml`
### 4⃣ Windows
1. 使用 Potplayer 播放器播放 `M3U` 文件即可
2. M3U 文件:[点击下载](https://proxy.lalifeier.eu.org/https://raw.githubusercontent.com/lalifeier/IPTV/main/m3u/IPTV.m3u)
3. Potplayer 播放器:[点击下载](http://potplayer.tv/)
---
## ❇️ 参考资料
- 直播源
- <https://epg.pw/test_channel_page.html>
- [iptv.org](https://github.com/iptv-org/iptv)
- [YueChan/Live](https://github.com/YueChan/Live)
- [YanG-1989/m3u](https://github.com/YanG-1989/m3u)
- [fanmingming/live](https://github.com/fanmingming/live)
- [ChiSheng9/iptv](https://github.com/ChiSheng9/iptv)
- [joevess/IPTV](https://github.com/joevess/IPTV)
- EPG
- [112114.xyz](https://diyp1.112114.xyz)
- [epg.51zmt.top:8000](http://epg.51zmt.top:8000/)
---
## 🌟 欢迎星标
[![Star History Chart](https://api.star-history.com/svg?repos=lalifeier/IPTV&type=Date)](https://star-history.com/#lalifeier/IPTV)
---
## 💹 访问量统计
![Visitor Count](https://profile-counter.glitch.me/lalifeier_IPTV/count.svg)
---
Last deployment time: 2025-03-11 08:29:02 UTC

81399
e.xml Normal file

File diff suppressed because it is too large Load Diff

107
epg.py Normal file
View File

@@ -0,0 +1,107 @@
import re, time
import json
import requests
# 原始数据来源地址
m3u_url = "https://raw.githubusercontent.com/lalifeier/IPTV/main/m3u/IPTV.m3u"
epg1_api = "https://epg.112114.xyz/?ch="
epg2_api = "https://diyp.112114.xyz/?ch="
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0"
}
# 定义频道原始数据获取函数
def fetch_m3u_data(m3u_url):
response = requests.get(m3u_url, headers=header)
if response.status_code == 200:
return response.text
else:
raise Exception(f"Failed to fetch M3U data. Status code: {response.status_code}")
# 定义道ID和频道名提取字典建立函数
def extract_tvg_info_from_m3u(m3u_data):
pattern = re.compile(r'#EXTINF:-1 tvg-id="(.*?)" tvg-name="(.*?)"', re.DOTALL)
matches = pattern.findall(m3u_data)
tvg_dict = {}
for match in matches:
tvg_id, title = match[0], match[1]
tvg_dict[tvg_id] = title
print("节目列表提取成功,共计", len(tvg_dict), "个频道")
# print(tvg_dict)
tvg_list = []
for key in tvg_dict:
tvg_list.append('<channel id="' + key + '">\n')
tvg_list.append('<display-name lang="zh">' + tvg_dict[key] + "</display-name>\n")
tvg_list.append("</channel>\n")
tvg_string = "".join(tvg_list)
# print(my_string)
return tvg_string, tvg_dict
# 定义频道TVXML数据API数据获取函数
def epg_api_data(tvg_id, tvg_name):
epg_date = requests.get(epg1_api + tvg_name, headers=header)
if "精彩节目-暂未提供节目预告信息" in epg_date.text or tvg_name in "卡酷少儿 纪实科教":
print(tvg_name, "的EPG节目信息在API1中不存在或不准确 已更换为API2")
epg_date = requests.get(epg2_api + tvg_name, headers=header)
json_data = epg_date.json()
# 创建空字符串用于存放 epg 内容
xml_list = []
# 遍历该频道当天所有节目信息
for epg in json_data["epg_data"]:
if epg["start"] == "00:00" and epg["end"] == "23:59": # 剔除错误数据此处为00:00开始23:59结束的节目-明显错误内容
print(tvg_name, "包含重复错误节目信息,已剔除") # 输出包含错误信息的频道名
continue
start_time = f"{json_data['date'].replace('-', '')}{epg['start'].replace(':', '')}00 +0800"
end_time = f"{json_data['date'].replace('-', '')}{epg['end'].replace(':', '')}00 +0800"
title = epg["title"].replace("<", "").replace(">", "").replace("&", "&amp;") # 替换xml文件中的一些禁用字符
xml_list.append('<programme start="' + start_time + '" stop="' + end_time + '" channel="' + tvg_id + '">\n')
xml_list.append('<title lang="zh">' + title + '</title><desc lang="zh"></desc>\n')
xml_list.append("</programme>\n")
xml_string = "".join(xml_list)
return xml_string
m3u_data = fetch_m3u_data(m3u_url)
tvg_info, tvg_info_dict = extract_tvg_info_from_m3u(m3u_data)
# 创建一个空列表存储所有EPG数据
tvxml_list = []
tvxml_list.append('<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE tv SYSTEM "http://api.torrent-tv.ru/xmltv.dtd">\n')
tvxml_list.append('<tv generator-info-name="https://epg.shellykoral.com" generator-info-url="koral@shellykoral.com">\n')
# 输出频道ID和频道名到TVXML
tvxml_list.append(tvg_info)
# 输出输出节目EPG到TVXML
for key in tvg_info_dict:
xml_string = epg_api_data(key, tvg_info_dict[key])
# time.sleep(0.1)
print(tvg_info_dict[key], "已完成")
tvxml_list.append(xml_string)
tvxml_list.append("</tv>")
tvxml_string = "".join(tvxml_list)
with open("e.xml", "w", encoding="utf-8") as xml_file:
xml_file.write(tvxml_string)
# 测试
# xml_string = epg_api_data('A03','CNA')
# time.sleep(0.3)
# print(xml_string)
# # with open("TVXML.xml", "a", encoding="utf-8") as xml_file:
# # xml_file.write(xml_string)

View File

View File

@@ -0,0 +1,6 @@
112.116.15.103:9901
116.55.141.103:9901
116.55.180.251:9901
182.241.193.238:9901
182.241.193.59:9901
220.164.192.48:50085

View File

View File

View File

@@ -0,0 +1,2 @@
222.169.41.11:9901
222.169.85.8:9901

View File

@@ -0,0 +1,5 @@
110.189.102.15:9901
118.122.189.74:9901
125.71.73.49:9901
182.150.25.138:9901
61.157.139.15:9901

View File

View File

View File

@@ -0,0 +1,8 @@
220.179.68.222:9901
220.180.112.196:9901
223.241.247.214:9901
223.243.2.179:9008
60.167.15.43:9901
60.169.254.231:9901
60.172.59.214:9901
60.174.86.121:9901

View File

@@ -0,0 +1,5 @@
113.124.234.110:9901
113.124.72.15:9901
144.52.160.225:9901
58.57.21.166:9901
58.57.40.22:9901

View File

@@ -0,0 +1,15 @@
1.69.2.100:9902
1.69.64.25:9902
1.69.67.148:9902
1.69.68.153:9902
1.69.74.111:9902
113.25.252.226:9901
124.114.103.154:9901
124.116.118.28:9901
124.116.183.146:9901
219.145.43.21:9901
219.145.43.33:9901
219.145.43.75:9901
223.13.1.150:9901
223.13.1.62:9901
59.48.75.130:3052

View File

@@ -0,0 +1,35 @@
106.124.91.222:9901
113.109.117.237:9901
113.64.94.175:9901
113.64.94.191:9901
113.65.162.95:9999
113.81.21.11:9901
119.120.196.103:9999
119.125.104.130:9901
119.125.104.210:9901
119.125.104.73:9901
119.125.104.88:9901
119.129.172.119:9999
119.129.172.164:9999
119.129.173.219:9999
119.129.173.35:9999
119.129.173.99:9999
119.142.76.36:9901
125.93.74.27:9002
14.29.76.30:9901
183.0.186.29:8888
183.10.180.204:9901
183.24.48.6:9901
219.137.202.105:9999
219.137.203.224:9999
219.137.203.243:9999
219.137.230.245:9901
219.137.230.87:9901
219.137.231.105:9901
219.137.231.141:9999
219.137.231.215:9901
219.137.231.23:9901
219.137.231.40:9901
219.137.231.76:9901
59.32.97.44:9901
61.141.202.118:9901

View File

@@ -0,0 +1 @@
171.108.239.79:8181

View File

View File

@@ -0,0 +1,9 @@
180.124.146.142:60000
218.3.138.25:1111
221.224.4.170:1111
221.225.236.123:9901
58.209.101.210:9901
58.216.229.130:9901
58.218.184.182:9901
58.220.219.14:9901
58.221.158.155:9901

View File

@@ -0,0 +1,4 @@
115.149.139.141:10001
218.87.237.105:9901
218.87.237.106:9901
59.62.8.250:9901

View File

@@ -0,0 +1,9 @@
106.115.121.96:9901
106.118.112.163:9901
106.118.70.182:9901
123.182.212.105:9901
123.182.212.130:9901
123.182.213.119:9901
222.223.84.82:9901
27.188.213.166:9901
27.188.9.21:9901

View File

@@ -0,0 +1,29 @@
1.192.12.41:9901
1.192.16.233:9901
1.192.241.46:9901
1.192.248.15:9901
1.193.63.148:85
1.193.63.75:85
1.194.52.10:10086
1.197.253.220:9901
1.197.82.222:9901
1.198.30.143:9901
1.198.66.139:9901
1.199.235.189:9901
123.160.172.124:85
123.160.172.168:85
123.160.172.73:85
123.160.173.165:85
123.160.175.25:85
123.160.233.188:85
123.160.234.242:85
123.160.235.240:85
123.163.114.123:85
123.163.114.191:85
123.163.55.234:9901
123.52.12.48:9901
171.12.164.66:9901
171.13.174.159:20443
171.14.89.49:9901
171.8.138.195:85
171.8.75.217:8011

View File

@@ -0,0 +1,12 @@
115.215.143.46:9901
115.225.49.227:9901
115.236.171.2:9901
122.230.62.250:9901
122.246.75.194:9901
125.107.115.72:9901
125.107.96.138:9901
125.114.241.240:9901
125.119.48.56:9901
183.136.148.214:9901
60.187.74.119:9901
61.175.237.198:1111

View File

@@ -0,0 +1 @@
59.49.191.79:9901

View File

@@ -0,0 +1,8 @@
58.48.37.158:1111
58.48.5.186:1111
58.51.111.46:1111
58.53.153.222:9901
58.53.153.236:9901
59.173.183.242:9901
59.173.243.210:9901
61.136.172.236:9901

View File

@@ -0,0 +1,44 @@
113.218.189.23:8081
113.218.230.180:8081
113.218.231.17:8081
113.220.232.154:9999
113.220.232.195:9999
113.220.232.38:9999
113.220.233.12:9999
113.220.233.185:9999
113.220.233.241:9999
113.220.234.100:9999
113.220.235.120:9999
118.248.167.152:8088
118.248.168.52:8088
118.248.170.67:8088
118.248.170.72:8088
118.248.172.234:8088
124.231.212.241:9999
124.231.212.36:9999
124.231.212.59:9999
124.231.212.94:9999
124.231.213.150:9999
124.231.213.210:9999
124.231.214.193:9999
124.231.214.252:9999
124.231.215.108:9999
124.231.215.159:9999
175.0.32.62:8081
175.0.34.214:8081
175.10.19.64:9901
175.8.212.107:8081
175.8.85.82:9998
218.76.30.240:9901
218.76.32.193:9901
218.77.81.186:9901
220.170.242.246:9901
222.240.60.154:9901
222.240.82.92:9901
222.243.221.54:9901
223.151.51.74:9901
223.159.11.241:8099
223.159.8.218:8099
223.159.8.53:8099
223.159.9.237:8099
223.159.9.41:8099

View File

View File

@@ -0,0 +1,2 @@
117.27.190.42:9998
220.161.206.166:9901

View File

View File

View File

@@ -0,0 +1,2 @@
59.44.10.113:9901
59.44.203.42:9901

View File

@@ -0,0 +1 @@
14.106.236.87:9901

View File

View File

View File

@@ -0,0 +1 @@
112.99.193.34:9901

View File

View File

@@ -0,0 +1,9 @@
119.62.10.222:9901
119.62.28.139:9901
119.62.28.223:9901
119.62.36.174:9901
119.62.80.200:9901
14.204.29.101:9901
14.204.46.220:9901
14.204.97.240:9901
221.213.69.82:9901

View File

View File

@@ -0,0 +1,8 @@
112.123.243.37:50085
116.128.224.11:9901
116.128.242.83:9901
116.149.224.120:9901
116.149.224.54:9901
116.167.104.94:9901
116.167.76.60:9901
14.204.12.178:9901

View File

@@ -0,0 +1,17 @@
119.51.52.185:9901
122.139.47.206:9901
125.32.120.209:9901
175.16.149.189:9901
175.16.151.135:9901
175.16.151.183:9901
175.16.153.143:9901
175.16.155.51:9901
175.16.184.213:9901
175.16.198.17:9901
175.16.250.155:9901
175.18.189.238:9902
221.9.97.31:9901
222.162.195.165:9901
58.245.97.28:9901
58.245.99.42:9901
61.138.128.226:19901

View File

@@ -0,0 +1,3 @@
112.193.42.157:9901
112.194.206.58:9901
175.155.98.11:9901

View File

@@ -0,0 +1 @@
111.160.17.2:59901

View File

View File

@@ -0,0 +1,3 @@
112.123.155.153:9901
112.132.160.130:9901
58.243.93.102:9901

View File

@@ -0,0 +1,18 @@
112.234.23.81:9901
119.163.199.98:9901
119.163.228.205:9901
119.163.231.148:9901
119.163.237.125:9901
119.163.57.184:9901
119.163.60.10:9901
119.163.63.188:9901
119.164.81.193:9901
119.164.83.6:9901
119.164.84.95:9901
119.164.85.150:9901
119.164.94.8:9901
123.129.70.178:9901
123.131.200.60:9901
124.128.73.58:9901
222.134.245.16:9901
58.19.252.68:1111

View File

@@ -0,0 +1,46 @@
116.135.38.14:9901
116.135.38.57:9901
116.135.39.141:9901
116.135.39.181:9901
118.77.113.140:9901
118.77.153.19:9901
118.77.184.77:9901
118.81.53.140:9999
118.81.98.130:9999
124.165.251.82:9999
171.116.247.116:9999
171.116.255.210:9901
171.117.12.76:9999
171.117.13.206:9999
171.117.14.236:9999
171.117.19.240:9901
171.117.43.18:9999
171.117.46.35:9999
171.118.221.179:9999
171.118.221.40:9999
171.118.79.240:9901
171.120.64.204:9999
171.120.7.114:9999
171.120.7.130:9999
171.120.7.32:9999
171.121.65.104:9901
171.124.80.184:9901
171.124.80.210:9901
171.124.80.244:9901
171.124.81.14:9901
183.185.218.10:9999
183.185.218.119:9999
183.185.219.170:9999
183.185.219.227:9999
183.185.246.78:9999
183.185.247.158:9999
183.185.252.91:9999
183.185.80.40:9901
183.191.212.247:9999
221.205.129.229:9999
221.205.130.91:9999
221.205.131.146:9999
221.205.131.31:9999
221.205.65.181:9999
221.205.65.81:9999
60.223.94.80:9901

View File

View File

View File

View File

View File

@@ -0,0 +1,4 @@
113.195.162.70:9901
113.195.4.227:9901
113.195.45.181:9901
113.195.8.69:9901

View File

@@ -0,0 +1,11 @@
101.19.62.22:9901
101.74.29.225:9901
101.74.30.77:9901
101.74.31.156:9901
101.74.31.158:9901
121.19.134.125:808
121.19.134.132:808
121.19.134.82:808
121.24.98.214:9901
221.193.168.216:9901
221.193.168.234:9901

View File

@@ -0,0 +1,16 @@
115.48.22.43:9901
115.48.61.13:9901
115.48.62.124:9901
123.10.70.138:9901
123.13.24.224:9992
125.43.244.216:9901
182.113.206.54:9901
182.113.207.55:9901
182.117.136.206:9901
182.117.136.42:9901
182.122.73.43:10086
219.154.240.173:9901
222.142.199.205:9901
222.142.73.216:9901
222.142.93.57:9901
61.136.67.238:50085

View File

@@ -0,0 +1,17 @@
101.65.34.239:9901
101.66.195.109:9901
101.66.198.147:9901
101.66.198.174:9901
101.66.198.28:9901
101.71.212.242:9901
101.71.213.33:9901
123.154.116.193:9901
123.154.154.110:9901
123.154.155.53:9901
123.154.155.56:9901
123.154.157.143:9901
123.154.252.59:9901
123.154.253.138:9901
123.159.135.124:9901
124.90.211.122:9901
60.12.183.46:9901

View File

@@ -0,0 +1,4 @@
150.255.145.179:9901
150.255.149.33:9901
150.255.150.12:9901
153.0.204.85:9901

View File

@@ -0,0 +1,9 @@
113.57.109.48:1111
113.57.20.158:9901
113.57.93.165:9900
183.94.1.118:8801
183.94.212.30:9901
220.249.114.102:9901
58.19.133.144:9901
58.19.244.92:1111
58.19.38.162:9901

View File

@@ -0,0 +1,12 @@
110.52.99.109:9901
110.53.21.30:9901
110.53.218.182:9902
119.39.226.20:1111
119.39.9.8:9901
119.39.97.2:9002
220.202.98.51:14901
220.248.173.158:9901
42.48.17.188:9901
42.49.148.250:9901
42.49.148.254:9901
58.20.77.78:9901

View File

View File

@@ -0,0 +1,4 @@
36.249.150.192:9901
36.249.151.244:9901
58.23.27.171:9901
58.23.27.47:9901

View File

View File

View File

@@ -0,0 +1 @@
fxgm.fxjf.work:19901

View File

@@ -0,0 +1,3 @@
113.206.102.179:9901
27.14.84.4:9901
27.8.233.175:9901

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

Some files were not shown because too many files have changed in this diff Show More