Skip to content

frank-vpl/TV-Workers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📺 TV Workers

Cloudflare Worker–based IPTV proxy for streaming HLS channels with automatic playlist rewriting and CORS support.

Farsi Version

🚀 Features

  • Proxy IPTV HLS streams (.m3u8)
  • Automatic playlist URL rewriting
  • Segment streaming support (.ts, .m4s, etc.)
  • Dynamic headers (User-Agent, Referer, Origin)
  • CORS enabled (Access-Control-Allow-Origin: *)
  • Lightweight and fast (Cloudflare Workers)

📂 Project Structure

worker.js
README.md

🛠 How It Works

The Worker:

  1. Reads the channel ID from the URL path
  2. Matches it against the CHANNELS object
  3. Proxies the request to the real IPTV source
  4. Rewrites .m3u8 playlists to pass back through your Worker
  5. Streams video segments directly

➕ Adding an IPTV Channel

Open worker.js and locate:

// IPTV Channels
const CHANNELS = {
  "2342": "https://live.livetvstream.co.uk/LS-63503-4",
  // "1001": "https://example.com/live/stream1"
}

To add a new IPTV stream:

  1. Find the base stream URL Example:
https://live.livetvstream.co.uk/LS-63503-4/index.m3u8
  1. Remove /index.m3u8 Keep only the base path:
https://live.livetvstream.co.uk/LS-63503-4
  1. Add it to CHANNELS:
const CHANNELS = {
  "2342": "https://live.livetvstream.co.uk/LS-63503-4",
  "1001": "https://example.com/live/channel"
}

🔗 Accessing a Channel

After deploying your Worker, access streams like this:

https://workername.username.workers.dev/{id}/index.m3u8

Example

If your Worker URL is:

https://tv-proxy.frank.workers.dev

And your channel ID is:

2342

Stream URL:

https://tv-proxy.frank.workers.dev/2342/index.m3u8

☁️ Deploy to Cloudflare Workers

1️⃣ Install Wrangler

npm install -g wrangler

2️⃣ Login

wrangler login

3️⃣ Deploy

wrangler deploy

After deployment, Cloudflare will provide:

https://your-worker-name.your-username.workers.dev

📡 Example Channel Configuration

Source:

https://live.livetvstream.co.uk/LS-63503-4/index.m3u8

Worker config:

"2342": "https://live.livetvstream.co.uk/LS-63503-4",

Worker stream URL:

https://workername.username.workers.dev/2342/index.m3u8

⚠️ Notes

  • Only use streams you have permission to proxy.
  • Some IPTV providers may block proxy usage.
  • Adjust cache settings if needed.
  • Ensure the base URL does NOT include index.m3u8.

📜 License

MIT License

About

Cloudflare Worker–based IPTV proxy for streaming HLS channels with automatic playlist rewriting and CORS support.

Resources

License

Stars

96 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors