Skip to content

sxtu1/telegram-ott

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📺 Telegram Channel to OTT Navigator

Convert your Telegram channel videos into M3U8 playlist for OTT Navigator!

🎯 Simple Workflow

Forward Videos → Channel @malaysiaott → Run Script → Generate Playlist → OTT Navigator

No bot needed! Just manual forward videos to your channel.


⚡ Quick Setup

Step 1: Get Telegram API (5 minit)

  1. Go to: https://my.telegram.org/apps
  2. Login dengan phone number
  3. Create application:
    • Title: OTT Playlist
    • Short name: ottplaylist
  4. Copy:
    • api_id (example: 12345678)
    • api_hash (example: abcd1234...)

Step 2: Edit Script

Open generate_playlist.py, find these lines (top of file):

API_ID = 0  # Replace with your api_id
API_HASH = ""  # Replace with your api_hash

Replace dengan your credentials:

API_ID = 12345678  # Your actual api_id
API_HASH = "abcd1234..."  # Your actual api_hash

Step 3: Upload ke GitHub

  1. Create repo: telegram-ott-playlist
  2. Upload files:
    • generate_playlist.py
    • requirements.txt
    • README.md

Step 4: Run via GitHub Actions

Create .github/workflows/generate.yml:

name: Generate Playlist

on:
  schedule:
    - cron: '0 */3 * * *'  # Every 3 hours
  workflow_dispatch:

jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    
    - name: Setup Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.11'
    
    - name: Install dependencies
      run: pip install -r requirements.txt
    
    - name: Generate playlist
      env:
        API_ID: ${{ secrets.API_ID }}
        API_HASH: ${{ secrets.API_HASH }}
      run: |
        sed -i "s/API_ID = 0/API_ID = $API_ID/" generate_playlist.py
        sed -i "s/API_HASH = \"\"/API_HASH = \"$API_HASH\"/" generate_playlist.py
        python generate_playlist.py
    
    - name: Commit playlist
      run: |
        git config user.name "github-actions[bot]"
        git config user.email "github-actions[bot]@users.noreply.github.com"
        git add playlist.m3u8 ott_playlist.session*
        git commit -m "Update playlist $(date)" || exit 0
        git push

Step 5: Add Secrets

Settings → Secrets → Actions → New secret:

  • Name: API_ID, Value: (your api_id)
  • Name: API_HASH, Value: (your api_hash)

Step 6: Enable GitHub Pages

Settings → Pages → Source: main branch → Save


📱 How to Use

Add Videos to Channel:

  1. Get video dari mana-mana (download, from other bot, etc)
  2. Forward ke @malaysiaott (your channel)
  3. Done!

Generate Playlist:

GitHub Actions (Auto):

  • Runs every 3 hours automatically
  • Or manual: Actions tab → "Generate Playlist" → Run workflow

Local (Manual):

pip install telethon
python generate_playlist.py

View in OTT Navigator:

Playlist URL:

https://proksibizmy.github.io/telegram-ott-playlist/playlist.m3u8

Add dalam OTT Navigator → Stream! 🎬


⚠️ Important Notes

Telegram Video Streaming Limitations:

Telegram doesn't provide direct streaming URLs by default. The playlist generates message links (https://t.me/channel/123).

Solutions:

Option A: Use Telegram Bot API (Current)

  • Playlist contains Telegram message links
  • OTT Navigator opens Telegram app
  • Manual click to play

Option B: Telegram Web Player (Better)

  • Need custom proxy/web interface
  • Stream video directly
  • Complex setup

Option C: Download & Re-host (Best for OTT)

  • Auto-download videos from channel
  • Upload to hosting (Cloudflare R2, Backblaze B2 - free tier)
  • Direct stream URLs in playlist
  • Need storage management

🎯 Recommended Approach

For true OTT Navigator streaming, consider:

  1. Manual forward videos to channel ✅
  2. GitHub Action auto-download from channel
  3. Upload to free storage (Cloudflare R2 = 10GB free)
  4. Generate M3U8 with direct URLs
  5. Stream dalam OTT Navigator

Want me to create the auto-download + re-host version? 🤔


📊 Current Features

✅ Scan Telegram channel
✅ Find all videos
✅ Generate M3U8 metadata
✅ Auto-update via GitHub Actions
✅ Free hosting (GitHub Pages)

⚠️ Links are Telegram messages (not direct streams)


🛠️ Files

  • generate_playlist.py - Main script
  • requirements.txt - Dependencies
  • README.md - This file

Channel: @malaysiaott
Playlist: Auto-updated setiap 3 jam!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published