Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.
/ ctstream Public archive

Get MPEG-DASH streams from ČT

License

Notifications You must be signed in to change notification settings

HonbraDev/ctstream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

ČTStream

Get MPEG-DASH streams from ČT

CLI

Help output

usage: ctstream.py [-h] [-t] [-n] [-r] channel

Get MPEG-DASH stream URLs from ČT

positional arguments:
  channel          Channel ID

options:
  -h, --help       show this help message and exit
  -t, --timeshift  Get timeshift stream
  -n, --newline    Print newline after stream URL
  -r, --traceback  Print traceback on error

Examples

python ctstream.py 1
python ctstream.py 1 -t

Channel IDs

1: ČT1
2: ČT2
3: ČT24
4: ČT sport
6: ČT :D / art

Python API

Get stream URL

from ctstream import get_stream_url

get_stream_url("1")
get_stream_url("1", "main")
get_stream_url("1", "timeshift")

Get playlist url

from ctstream import get_playlist_url

get_playlist_url("1")

Request flow

  1. Get client playlist URL
    • https://www.ceskatelevize.cz/ivysilani/ajax/get-client-playlist/
  2. Get stream URL from playlist
    • https://www.ceskatelevize.cz/ivysilani/client-playlist/?key=<key>

Get channel IDs

Send GraphQL query to https://api.ceskatelevize.cz/graphql/:

query LiveBroadcastFind {
    liveBroadcastFind {
        id
        current {
            assignedToChannel {
                channelName
            }
        }
    }
}

License

See LICENSE for license information.