People put the posters in their own libraries (one in an automated F1 library in Emby), and the only help was the Kometa example page, written for developers. The guides are for people who are not: numbered steps of one action each, the exact menus and buttons of Plex, Kometa and Emby as their own documentation names them, boxes to copy, the pictures from the live API, what to see after a step and what to do when it does not work. The technical details (routes, options, the address version, a script and Emby's API) sit at the end of each. guides/ holds the index, plex.html (a Plex TV library on the Personal Media Shows agent, Kometa pointed at /kometa/formula-1-metadata.yml, its daily run) and emby.html (Kometa needs Plex, so: Set Image from URL by hand, or picture files named as Emby's TV naming page reads them, and a script that saves a whole season from the Kometa file). They use the example site's style sheet; every example page's nav links them, and README.md lists them. cdn-api.py serves guides/ at /guides/ beside /examples/, and the image copies it. A mount of a directory the image lacks stops the service at its start, so tests/test_image.py holds that every directory the app serves is copied by service/Dockerfile.
178 lines
8.1 KiB
HTML
178 lines
8.1 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Licences · F1 Circuits API examples</title>
|
||
<meta name="description" content="Every source the F1 Circuits posters are made from, its licence and the credit drawn on every picture; the licences of the posters, the track files and the GPS traces.">
|
||
<link rel="icon" href="data:,">
|
||
<link rel="stylesheet" href="site.css">
|
||
</head>
|
||
<body>
|
||
<header class="site">
|
||
<a class="brand" href="index.html">F1 <span>Circuits</span> API</a>
|
||
<nav aria-label="Examples">
|
||
<a href="index.html">Overview</a>
|
||
<a href="circuits.html">Circuit browser</a>
|
||
<a href="tracks.html">Track images</a>
|
||
<a href="map.html">GPS traces</a>
|
||
<a href="grand-prix.html">Grand prix lookup</a>
|
||
<a href="posters.html">Posters</a>
|
||
<a href="builder.html">Poster builder</a>
|
||
<a href="kometa.html">Kometa</a>
|
||
<a href="library.html">Library</a>
|
||
<a href="picker.html">Photo picker</a>
|
||
<a href="licences.html" aria-current="page">Licences</a>
|
||
<a href="../guides/index.html">Guides</a>
|
||
</nav>
|
||
<div id="api-base"></div>
|
||
</header>
|
||
|
||
<main>
|
||
<h1>Licences</h1>
|
||
<p class="lead">
|
||
Every picture the API makes is drawn from sources whose licences allow keeping a copy, and each says where it comes
|
||
from: the credit of every source it was made from is drawn at its foot, sent in its <code>X-Credits</code> header,
|
||
and listed here. A picture’s licence follows its sources, and is sent in its <code>X-License</code> header. Its
|
||
<code>Link: </licences>; rel="license"</code> header points to this list.
|
||
</p>
|
||
|
||
<section class="card" id="call">
|
||
<h2>The sources</h2>
|
||
<p>What <code>/licences</code> answers, as a table. A credit with <code><author></code> and
|
||
<code><licence></code> is filled in with the photo’s own; one with <code><year></code> with the mosaic’s
|
||
year. The last column is the licence a picture made from that source gets.</p>
|
||
<div class="request"></div>
|
||
<div class="status"></div>
|
||
<div id="sources"></div>
|
||
<details class="result-raw"><summary>The answer as it came</summary><div class="result"></div></details>
|
||
</section>
|
||
|
||
<section class="card">
|
||
<h2>What the API offers, and under which licence</h2>
|
||
<div id="outputs"></div>
|
||
<p class="hint">A race name and its date on a picture are single facts: they do not set its licence. The Kometa
|
||
file says in its first lines that its race schedules come from Jolpica, under CC BY-NC-SA 4.0.</p>
|
||
</section>
|
||
|
||
<section class="card">
|
||
<h2>Formula 1</h2>
|
||
<p>This website is unofficial and is not associated in any way with the Formula 1 companies. F1, FORMULA ONE,
|
||
FORMULA 1, FIA FORMULA ONE WORLD CHAMPIONSHIP, GRAND PRIX and related marks are trade marks of Formula One
|
||
Licensing B.V.</p>
|
||
</section>
|
||
</main>
|
||
|
||
<footer class="pager">
|
||
<a rel="prev" href="picker.html">← Photo picker</a>
|
||
<a class="home" href="index.html">All examples</a>
|
||
<span></span>
|
||
</footer>
|
||
<footer class="disclaimer">
|
||
<p>This website is unofficial and is not associated in any way with the Formula 1 companies. F1, FORMULA ONE,
|
||
FORMULA 1, FIA FORMULA ONE WORLD CHAMPIONSHIP, GRAND PRIX and related marks are trade marks of Formula One
|
||
Licensing B.V.</p>
|
||
<p><a href="licences.html">Licences and credits</a>: every source the pictures are made from, the licence each
|
||
picture takes from its sources, and the licence of the track files and the GPS traces (MIT).</p>
|
||
</footer>
|
||
|
||
<script src="site.js"></script>
|
||
<script>
|
||
(function () {
|
||
const { h, api, callJSON, notice } = F1;
|
||
const $ = (id) => document.getElementById(id);
|
||
|
||
const CC = (code) => `https://creativecommons.org/licenses/${code}/4.0/`;
|
||
// The rule as the lead settled it (2026-11-27): shown only where /licences does not say it, and marked so.
|
||
const STATED = {
|
||
pictures: {
|
||
rule: 'A picture’s licence follows the sources it is made from.',
|
||
licences: [
|
||
{ licence: 'CC BY-SA 4.0', licence_url: CC('by-sa'), when: 'made from a CC BY-SA photo' },
|
||
{ licence: 'CC BY-NC-SA 4.0', licence_url: CC('by-nc-sa'), when: 'made from EOxCloudless 2025' },
|
||
{ licence: 'CC BY 4.0', licence_url: CC('by'), when: 'otherwise' },
|
||
],
|
||
},
|
||
tracks: { licence: 'MIT', licence_url: null },
|
||
};
|
||
/** The licence a picture from a source gets, by the rule, for a source whose entry does not say it. */
|
||
const BY_RULE = {
|
||
commons: 'CC BY-SA 4.0 from a CC BY-SA photo, else CC BY 4.0',
|
||
eox: 'CC BY-NC-SA 4.0',
|
||
jolpica: 'does not set a picture’s licence',
|
||
traces: 'does not set a picture’s licence',
|
||
};
|
||
|
||
const link = (href, text) => (href ? h('a', { href, target: '_blank', rel: 'noopener' }, text || href) : text || '–');
|
||
|
||
/** What a source is used for, its options (bg=photo, bg=satellite, …) set as code so they read as the options they are. */
|
||
function usedFor(text) {
|
||
const out = h('span');
|
||
for (const part of String(text).split(/(\b(?:bg|photo|locator|track)=[a-z0-9#]+(?:\|[a-z0-9]+)*)/)) {
|
||
if (part) out.append(/^(bg|photo|locator|track)=/.test(part) ? h('code', {}, part) : part);
|
||
}
|
||
return out;
|
||
}
|
||
|
||
/** A credit form, its placeholders marked. */
|
||
function credit(text) {
|
||
const code = h('code');
|
||
for (const part of String(text || '').split(/(<[a-z]+>)/)) {
|
||
if (!part) continue;
|
||
code.append(/^<[a-z]+>$/.test(part) ? h('em', { title: 'Filled in per picture' }, part) : part);
|
||
}
|
||
return code;
|
||
}
|
||
|
||
function sourcesTable(sources) {
|
||
return h('table', { class: 'sources' },
|
||
h('thead', {}, h('tr', {}, ...['Source', 'Used for', 'Licence', 'Credit', 'Terms', 'A picture from it'].map((t) => h('th', {}, t)))),
|
||
h('tbody', {}, ...sources.map((s) => h('tr', { id: `source-${s.id}` },
|
||
h('td', {}, h('b', {}, s.name || s.id), h('br'), h('small', {}, h('code', {}, s.id))),
|
||
h('td', {}, s.used_for ? usedFor(s.used_for) : '–'),
|
||
h('td', {}, link(s.licence_url, s.licence)),
|
||
h('td', {}, credit(s.credit)),
|
||
h('td', {}, s.terms ? link(s.terms, new URL(s.terms, location.href).host || s.terms) : '–'),
|
||
h('td', {}, s.picture_licence || h('span', { title: 'The answer does not say it; derived from the rule' },
|
||
BY_RULE[s.id] || 'CC BY 4.0', h('br'), h('small', {}, h('em', {}, 'by the rule'))))))));
|
||
}
|
||
|
||
function outputs(answer) {
|
||
const pictures = (answer && answer.pictures) || STATED.pictures;
|
||
const tracks = (answer && answer.tracks) || STATED.tracks;
|
||
const missing = [!(answer && answer.pictures) && 'the pictures’ licence', !(answer && answer.tracks) && 'the track files’ licence'].filter(Boolean);
|
||
const rows = [
|
||
...(pictures.licences || []).map((l, i) => h('tr', {},
|
||
i === 0 ? h('td', { rowspan: pictures.licences.length }, 'Race posters, season posters and session thumbnails') : null,
|
||
h('td', {}, link(l.licence_url, l.licence)),
|
||
h('td', {}, l.when || '–'))),
|
||
h('tr', {}, h('td', {}, 'Track files (SVG, PNG, GeoJSON) and the GPS traces'), h('td', {}, link(tracks.licence_url, tracks.licence)),
|
||
h('td', {}, 'LICENSE.md in the repository')),
|
||
];
|
||
$('outputs').replaceChildren(
|
||
missing.length ? notice('error', `/licences did not say ${missing.join(' or ')}, so this shows the rule as it was decided, not what the service says.`) : '',
|
||
h('p', {}, pictures.rule || ''),
|
||
h('table', {},
|
||
h('thead', {}, h('tr', {}, h('th', {}, 'What'), h('th', {}, 'Licence'), h('th', {}, 'When'))),
|
||
h('tbody', {}, ...rows)));
|
||
}
|
||
|
||
(async () => {
|
||
const answer = await callJSON($('call'), api('/licences'));
|
||
if (!answer) {
|
||
$('sources').replaceChildren(notice('error', 'The sources cannot be listed: /licences did not answer (see above). The service may not serve it yet.'));
|
||
outputs(null);
|
||
return;
|
||
}
|
||
if (!Array.isArray(answer.sources)) {
|
||
$('sources').replaceChildren(notice('error', 'The answer has no list of sources (no "sources" array).'));
|
||
} else {
|
||
$('sources').replaceChildren(sourcesTable(answer.sources));
|
||
}
|
||
outputs(answer);
|
||
})();
|
||
})();
|
||
</script>
|
||
</body>
|
||
</html>
|