Getting started
Use the logos
One address per logo, made from our channel ID, and which file to show on a light or dark background.
Address of a logo
https://cdn.worldwide-tv.dev/database/logos/<id>[.white].png
<id> is our channel ID: ch_ and 10 characters, shown on every
channel page with a button to copy it.
| Logo | Address (after https://cdn.worldwide-tv.dev/database/) |
|---|---|
TF1 (ch_rxxkmndvjh) | logos/ch_rxxkmndvjh.png |
France 3 Alsace, an edition of France 3 (ch_dhk02zjhwa) | logos/ch_dhk02zjhwa.png |
| its version for dark backgrounds | logos/ch_dhk02zjhwa.white.png |
Don't know the ID? Find it from an iptv-org ID, a TV guide ID or a name with the search
(⌘CtrlK), or in
channels.json.Which file to show
On a light background
The logo itself: <id>.png.
On a dark background
<id>.white.png when it exists, else the logo itself. The white version exists only for logos that would be hard to
read on a dark screen (black, grey or navy drawings).
For an edition
The edition's logo when it exists, else its channel's (parent). channels.json
gives the right address directly in logo and logo_white.
Examples
The browser picks the white version when the screen is dark:
<picture>
<source
srcset="https://cdn.worldwide-tv.dev/database/logos/ch_dhk02zjhwa.white.png"
media="(prefers-color-scheme: dark)">
<img
src="https://cdn.worldwide-tv.dev/database/logos/ch_dhk02zjhwa.png"
alt="France 3 Alsace" height="48">
</picture>
Only use the <source> line when the white version exists (logo_white in channels.json).
From channels.json, which already falls back to the channel's logo
for an edition:
const base = 'https://cdn.worldwide-tv.dev/database/'
const { channels } = await (await fetch(`${base}channels.json`)).json()
const byId = new Map(channels.map(c => [c.id, c]))
function logoOf (id, dark = false) {
const c = byId.get(id)
return c && ((dark && c.logo_white) || c.logo) // null when there is no logo yet
}
logoOf('ch_dhk02zjhwa', true)
import json, urllib.request
base = 'https://cdn.worldwide-tv.dev/database/'
channels = {c['id']: c for c in json.load(urllib.request.urlopen(base + 'channels.json'))['channels']}
def logo_of(cid, dark=False):
c = channels.get(cid) or {}
return (dark and c.get('logo_white')) or c.get('logo')
print(logo_of('ch_dhk02zjhwa', dark=True))
Serving and caching
- Images are served by GitHub Pages, behind a CDN. The same paths also work under
https://raw.githubusercontent.com/worldwide-tv-logos/database/main/, which is not meant for heavy use. - An address never changes; a new image of the logo replaces the old one at the same address. Use the
updateddate oflogos.jsonto know when to refresh a cache. - For many logos at once (a player, a playlist), download
channels.jsononce a day rather than probing addresses: a missing logo answers 404.