Git Product home page Git Product logo

alex-ahl / iptv-handler Goto Github PK

View Code? Open in Web Editor NEW
44.0 4.0 10.0 538 KB

Exclude unwanted channels based on group and generate a new M3U file with proxied streams and attributes. Streams get proxied through a webserver running on the app. Xtream support.

License: MIT License

Rust 100.00%
m3u rust-lang docker m3u-playlist iptv m3u-generator m3u-parser m3u-playlist-generator m3u-editor m3u-proxy

iptv-handler's Introduction

Overview

Exclude unwanted channels based on group and generate a new M3U file with proxied streams and attributes. Updates the playlist on specified hourly frequency. Streams get proxied through a webserver running on the app. Support for XtreamCodes.

Setup

General

Get the generated .m3u file at /m3u

Settable environment variables

Variable Default Required Type Description
DATABASE_URL - Yes string Connection string to DB
M3U - Yes string URL to the M3U playlist (.m3u)
INIT_APP true No boolean Initialize app with M3U playlist from environment variable.
HOURLY_UPDATE_FREQUENCY 12 No number Frequency of provider playlist update in hours
GROUP_EXCLUDES - No string A comma separated list of groups to exclude from the final playlist. Case-insensitive.
PROXY_DOMAIN - Yes string Domain on which the app is running - to proxy m3u requests. (Example: localhost:3000)
ENV Development No string Set environment Development or Production.
PORT 3001 No number Port to run on (Default 3001)
RUST_LOG info Yes string Log level (warn,server=warn,iptv=info,api=warn rest-client=warn)
XTREAM_ENABLED false No boolean Enable Xtream
XTREAM_BASE_DOMAIN - No string Xtream provider base domain
XTREAM_USERNAME - No string Xtream provider username
XTREAM_PASSWORD - No string Xtream provider username
XTREAM_PROXIED_USERNAME - No string Proxied Xtream username
XTREAM_PROXIED_PASSWORD - No string Proxied Xtream password

Development

Set required environment variables in and .env file and then run docker-compose up.

This will fire up a MariaDB container instance and create a new DB. Which in turn will create tables and basic data using sql files in the server -> db -> migrations folder.

Production

To build and run a production docker image.

In src/server folder: docker build -t image:tag .

Create an external docker network with the name db and run your mariadb/mysql database there.

Example of production docker-compose.yml

version: '3.7'

services:
  iptvhandler:
    image: iptv-handler
    tty: true # color terminal output
    ports:
      - "3001:3001"
    restart: always
    environment:
      DATABASE_URL: mysql://username:password@db:3306/iptvhandler
      M3U: http://iptvprovider.tv:1234/get.php?username=username&password=password&type=m3u_plus&output=ts
      RUST_LOG: warn,server=info,iptv=debug
      HOURLY_UPDATE_FREQUENCY: 4
      GROUP_EXCLUDES: Music,Country,Cou
      PROXY_DOMAIN: myproxydomain.lan
      ENV: production
      XTREAM_ENABLE: "true"
      XTREAM_BASE_DOMAIN: iptvprovider.tv
      XTREAM_USERNAME: username
      XTREAM_PASSWORD: password
      XTREAM_PROXIED_USERNAME: my_new_username
      XTREAM_PROXIED_PASSWORD: my_new_password
    networks:
      - db
networks:
  db:
    external: true

DB

SQLX requirements for static type checking:

  • Needs to be named DATABASE_URL
  • Unfortunately have to have a common connection string for both docker container and host. Since IDE is running from host it needs access to db...
  • DATABASE_URL needs to be in .env file to work. Env variable in docker-compose does not work.
  • Add 127.0.0.1 host.docker.internal to your hosts file if docker hasn't done that for you

Example: DATABASE_URL="mysql://db:[email protected]:3306/iptvhandler"

iptv-handler's People

Contributors

alex-ahl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

iptv-handler's Issues

Multiple xtream inputs

Does it support only one stream to rebroadcast or can I add multiple and have them merged and fallback?

Filter: Regex or include possible?

Hi, this seems like a promising project for my needs. I have massive playlist and would like to filter based on tags and strings, regex would be most helpful here. Instead of filtering out, the other way around would be helpful.

Removing groups would require redoing when new groups are added or changed in their titles.

Could such a feature be added?

Feature request "GROUP_INCLUDES"

Hello ,

Is it possible to have a feature "GROUP_EXCLUDES" with the reverse functionality like "GROUP_INCLUDES" ?
Basic discard everything except the wanted groups !

Example if we have now groups 1,2,3,4,5,6,7,8,9,10 and i want to get in the final list only the group 5 then i must type all the others groups (1,2,3,4,6,7,8,9,10) in the "GROUP_EXCLUDES" and that is hard in cases that you have 50+ groups or new groups included in the original list .

So the Required settings be something like either "GROUP_EXCLUDES" or "GROUP_INCLUDES" to be the app executable .

Thank you

Can it work without an .m3u?

My provider only provides me with xtream api codes, and those appear to be speedier than m3u. This project supports xtream, but requires an m3u file / URL.
Can it also work without?

Default .env file that works for you

Hello @alex43268, I really enjoy this project, but am having trouble testing it out. Can you please supply your .env that works for you. I've tryed about everything I can think of and can't seem to get it working.

Current .env file:

DATABASE_URL="mysql://db:[email protected]:3306/iptvhandler"
M3U="https://iptv-org.github.io/iptv/categories/auto.m3u"
PROXY_DOMAIN="localhost:3000"

EPG

Hi @alex-ahl - thank you for your efforts on this project. I have a question with regards to the EPG data that is pulled via xtream. Does this also get proxied? I am planning to route the network of this container via a separate VPN container and I am wondering if truly everything would get proxied.

Thanks for your help!

Work behind a reverse proxy

In my setup, I have caddy v2 as HTTPS terminator in front of iptv-handler running inside a docker container.
iptv-handler should be aware, that is's receiving http traffic but advertise a different port than it's listening to. So it listens on 3001 for HTTP traffic, but advertises as HTTPS on 443.

Right now I cannot forward normal HTTP 2 or HTTP 1.1 traffic to the container, I need to switch to h2c, which produces quite a lot of errors.

PS: Sorry for all the spam :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.