Первичная проверка стабильности плейлистов/каналов
This commit is contained in:
@@ -126,16 +126,63 @@ class IniFile
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data['hasCatchup'] = str_contains($data['content'] ?? '', 'catchup');
|
$data['hasCatchup'] = str_contains($data['content'] ?? '', 'catchup');
|
||||||
$data['hasTvg'] = !empty($data['attributes']['url-tvg'])
|
$data['hasTvg'] = !empty($data['attributes']['url-tvg']) || !empty($data['attributes']['x-tvg-url']);
|
||||||
|| !empty($data['attributes']['x-tvg-url']);
|
$data['hasTokens'] = $this->hasTokens($data);
|
||||||
|
|
||||||
$data['tags'] = [];
|
$data['tags'] = [];
|
||||||
foreach ($data['channels'] as $channel) {
|
foreach ($data['channels'] as &$channel) {
|
||||||
$data['tags'] = array_merge($data['tags'], $channel['tags']);
|
$data['tags'] = array_merge($data['tags'], $channel['tags']);
|
||||||
|
$channel['hasToken'] = $this->hasTokens($channel);
|
||||||
}
|
}
|
||||||
$data['tags'] = array_values(array_unique($data['tags']));
|
$data['tags'] = array_values(array_unique($data['tags']));
|
||||||
sort($data['tags']);
|
sort($data['tags']);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Проверяет наличие токенов в плейлисте
|
||||||
|
*
|
||||||
|
* Сделано именно так, а не через тег unstable, чтобы разделить логику: есть заведомо нестабильные каналы,
|
||||||
|
* которые могут не транслироваться круглосуточно, а есть платные круглосуточные, которые могут оборваться
|
||||||
|
* в любой момент.
|
||||||
|
*
|
||||||
|
* @param array $data
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
protected function hasTokens(array $data): bool
|
||||||
|
{
|
||||||
|
$string = ($data['url'] ?? '') . ($data['content'] ?? '');
|
||||||
|
if (empty($string)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$badAttributes = [
|
||||||
|
// токены и ключи
|
||||||
|
'[?&]token=',
|
||||||
|
'[?&]drmreq=',
|
||||||
|
// логины
|
||||||
|
'[?&]u=',
|
||||||
|
'[?&]user=',
|
||||||
|
'[?&]username=',
|
||||||
|
// пароли
|
||||||
|
'[?&]p=',
|
||||||
|
'[?&]pwd=',
|
||||||
|
'[?&]password=',
|
||||||
|
// неизвестные
|
||||||
|
// 'free=true',
|
||||||
|
// 'uid=',
|
||||||
|
// 'c_uniq_tag=',
|
||||||
|
// 'rlkey=',
|
||||||
|
// '?s=',
|
||||||
|
// '&s=',
|
||||||
|
// '?q=',
|
||||||
|
// '&q=',
|
||||||
|
];
|
||||||
|
|
||||||
|
return array_any(
|
||||||
|
$badAttributes,
|
||||||
|
static fn (string $badAttribute) => preg_match_all("/$badAttribute/", $string) >= 1,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,17 +81,20 @@
|
|||||||
<th class="w-25" scope="row">Код</th>
|
<th class="w-25" scope="row">Код</th>
|
||||||
<th class="text-break">
|
<th class="text-break">
|
||||||
{% if playlist.isOnline is same as(true) %}
|
{% if playlist.isOnline is same as(true) %}
|
||||||
<span class="font-monospace text-success">{{ playlist.code }}</span>
|
<span class="pe-3 font-monospace text-success">{{ playlist.code }}</span>
|
||||||
<span class="badge small text-dark bg-success">online</span>
|
<span class="badge small text-dark bg-success">online</span>
|
||||||
{% elseif playlist.isOnline is same as(false) %}
|
{% elseif playlist.isOnline is same as(false) %}
|
||||||
<span class="font-monospace text-danger">{{ playlist.code }}</span>
|
<span class="pe-3 font-monospace text-danger">{{ playlist.code }}</span>
|
||||||
<span class="badge small text-dark bg-danger">offline</span>
|
<span class="badge small text-dark bg-danger">offline</span>
|
||||||
{% elseif playlist.isOnline is same as(null) %}
|
{% elseif playlist.isOnline is same as(null) %}
|
||||||
<span class="font-monospace">{{ playlist.code }}</span>
|
<span class="pe-3 font-monospace">{{ playlist.code }}</span>
|
||||||
<span class="badge small text-dark bg-secondary" title="Не проверялся">unknown</span>
|
<span class="badge small text-dark bg-secondary" title="Не проверялся">unknown</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if "adult" in playlist.tags %}
|
{% if "adult" in playlist.tags %}
|
||||||
<span class="badge small bg-warning text-dark" title="Есть каналы для взрослых!">18+</span>
|
<span class="cursor-help badge small bg-warning text-dark"
|
||||||
|
title="Есть каналы для взрослых!"
|
||||||
|
>18+</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -116,11 +119,20 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Наполнение</th>
|
<th scope="row">Наполнение</th>
|
||||||
<td class="text-break">
|
<td class="text-break">
|
||||||
<ion-icon name="folder-open-outline"></ion-icon> группы: {{ playlist.groups|length }}<br>
|
<ion-icon name="folder-open-outline"></ion-icon> группы: {{ playlist.groups|length }}<br>
|
||||||
<ion-icon name="videocam-outline"></ion-icon> каналы: {{ playlist.channels|length }}:
|
<ion-icon name="videocam-outline"></ion-icon> каналы:
|
||||||
<span class="text-success"
|
<span class="cursor-help text-success" title="Возможно, рабочие каналы">
|
||||||
>{{ playlist.onlineCount }} ({{ playlist.onlinePercent }}%)</span> + <span class="text-danger"
|
{{ playlist.onlineCount }} ({{ playlist.onlinePercent }}%)
|
||||||
>{{ playlist.offlineCount }} ({{ playlist.offlinePercent }}%)</span>
|
</span>
|
||||||
|
+
|
||||||
|
<span class="cursor-help text-danger" title="Возможно, НЕрабочие каналы">
|
||||||
|
{{ playlist.offlineCount }} ({{ playlist.offlinePercent }}%)
|
||||||
|
</span>
|
||||||
|
= {{ playlist.channels|length }}
|
||||||
|
|
||||||
|
{% if playlist.hasTokens is same as (true) %}
|
||||||
|
<br><ion-icon name="paw" class="text-info"></ion-icon> могут быть нестабильные каналы
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -286,7 +298,7 @@
|
|||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text"
|
<input type="text"
|
||||||
id="search-field"
|
id="search-field"
|
||||||
class="form-control form-control-sm border-secondary bg-dark text-light fuzzy-search"
|
class="cursor-help form-control form-control-sm border-secondary bg-dark text-light fuzzy-search"
|
||||||
placeholder="Поиск каналов..."
|
placeholder="Поиск каналов..."
|
||||||
title="Начни вводить название"
|
title="Начни вводить название"
|
||||||
/>
|
/>
|
||||||
@@ -345,17 +357,17 @@
|
|||||||
|
|
||||||
<div class="my-3">
|
<div class="my-3">
|
||||||
{% for tag in playlist.tags %}
|
{% for tag in playlist.tags %}
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
class="btn-check"
|
class="btn-check"
|
||||||
id="btn-tag-{{ tag }}"
|
id="btn-tag-{{ tag }}"
|
||||||
data-tag="{{ tag }}"
|
data-tag="{{ tag }}"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
onclick="updateFilter()"
|
onclick="updateFilter()"
|
||||||
>
|
>
|
||||||
<label class="badge btn btn-sm btn-outline-secondary rounded-pill"
|
<label class="badge btn btn-sm btn-outline-secondary rounded-pill"
|
||||||
for="btn-tag-{{ tag }}"
|
for="btn-tag-{{ tag }}"
|
||||||
title="Нажми для фильтрации каналов по тегу, нажми ещё раз чтобы снять фильтр"
|
title="Нажми для фильтрации каналов по тегу, нажми ещё раз чтобы снять фильтр"
|
||||||
>#{{ tag }}</label>
|
>#{{ tag }}</label>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -365,65 +377,86 @@
|
|||||||
<table id="chlist" class="table table-dark table-hover small">
|
<table id="chlist" class="table table-dark table-hover small">
|
||||||
<tbody class="list">
|
<tbody class="list">
|
||||||
{% for channel in playlist.channels %}
|
{% for channel in playlist.channels %}
|
||||||
<tr class="chrow"
|
<tr class="chrow"
|
||||||
data-id="{{ channel.id }}"
|
data-id="{{ channel.id }}"
|
||||||
data-group="{{ channel.groupId ?? 'all' }}"
|
data-group="{{ channel.groupId ?? 'all' }}"
|
||||||
data-online="{{ channel.isOnline ? 1 : 0 }}"
|
data-online="{{ channel.isOnline ? 1 : 0 }}"
|
||||||
data-chtags="{{ channel.tags|join('|') }}"
|
data-chtags="{{ channel.tags|join('|') }}"
|
||||||
title="
HTTP: {{ channel.status ?: '(неизвестно)' }}
Error: {{ channel.error ?: '(нет)' }}"
|
title="
HTTP: {{ channel.status ?: '(неизвестно)' }}
Error: {{ channel.error ?: '(нет)' }}"
|
||||||
>
|
>
|
||||||
<td class="chindex">{{ loop.index }}</td>
|
<td class="chindex">{{ loop.index }}</td>
|
||||||
|
|
||||||
<td class="chlogo text-center">
|
<td class="chlogo text-center">
|
||||||
{% if (channel.attributes['tvg-logo']) %}
|
{% if (channel.attributes['tvg-logo']) %}
|
||||||
<img class="tvg-logo"
|
<img class="tvg-logo"
|
||||||
alt="Логотип канала '{{ channel.title }}'"
|
alt="Логотип канала '{{ channel.title }}'"
|
||||||
title="Логотип канала '{{ channel.title }}'"
|
title="Логотип канала '{{ channel.title }}'"
|
||||||
src="{{ channel.attributes['tvg-logo'] }}"
|
src="{{ channel.attributes['tvg-logo'] }}"
|
||||||
onerror="setDefaultLogo(this)"
|
onerror="setDefaultLogo(this)"
|
||||||
/>
|
/>
|
||||||
{% else %}
|
{% else %}
|
||||||
<img class="tvg-logo"
|
<img class="tvg-logo"
|
||||||
alt="Нет логотипа для канала '{{ channel.title }}'"
|
alt="Нет логотипа для канала '{{ channel.title }}'"
|
||||||
title="Нет логотипа для канала '{{ channel.title }}'"
|
title="Нет логотипа для канала '{{ channel.title }}'"
|
||||||
src="/no-tvg-logo.png"
|
src="/no-tvg-logo.png"
|
||||||
/>
|
/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-break">
|
<td class="text-break">
|
||||||
<ion-icon name="radio-button-on-outline"
|
{% if channel.isOnline is same as (true) %}
|
||||||
{% if (channel.isOnline) %}
|
<ion-icon name="radio-button-on-outline"
|
||||||
class="me-1 text-success"
|
class="cursor-help me-1 text-success"
|
||||||
title="Состояние: онлайн"
|
title="Состояние: онлайн (возможно, работает прямо сейчас)"
|
||||||
{% else %}
|
></ion-icon>
|
||||||
class="me-1 text-danger"
|
{% else %}
|
||||||
title="Состояние: оффлайн"
|
<ion-icon name="radio-button-on-outline"
|
||||||
{% endif %}
|
class="cursor-help me-1 text-danger"
|
||||||
|
title="Состояние: оффлайн (не работал в момент проверки или не удалось проверить)"
|
||||||
|
></ion-icon>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
></ion-icon>{% if "adult" in channel.tags %}
|
{% if "adult" in channel.tags %}
|
||||||
<span class="badge small bg-warning text-dark" title="Канал для взрослых!">18+</span>
|
<span class="badge small bg-warning text-dark"
|
||||||
{% endif %}<span class="chname">{{ channel.title }}</span>
|
title="Канал для взрослых!"
|
||||||
<div class="text-secondary small">
|
>18+</span>
|
||||||
{% if (channel.attributes['tvg-id']) %}
|
{% endif %}
|
||||||
<div title="tvg-id">
|
|
||||||
<ion-icon name="star-outline" class="me-1"></ion-icon> {{ channel.attributes['tvg-id'] }}
|
{% if channel.hasToken is same as (true) %}
|
||||||
</div>
|
<span class="cursor-help badge small bg-info text-dark"
|
||||||
{% endif %}
|
title="Может быть нестабилен"
|
||||||
{% if (channel.contentType != null) %}
|
>
|
||||||
<div title="MIME type">
|
<ion-icon name="paw"></ion-icon>
|
||||||
<ion-icon name="eye-outline" class="me-1"></ion-icon> {{ channel.contentType }}
|
</span>
|
||||||
</div>
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
{% if channel.tags|length > 0 %}
|
<span class="chname">{{ channel.title }}</span>
|
||||||
<ion-icon name="pricetag-outline" class="me-1"></ion-icon>
|
|
||||||
{% for tag in channel.tags %}
|
<div class="text-secondary small">
|
||||||
<span class="chtag">#{{ tag }}</span>
|
{% if (channel.attributes['tvg-id']) %}
|
||||||
{% endfor %}
|
<div title="Идентификатор канала для телепрограммы (tvg-id)" class="cursor-help">
|
||||||
{% endif %}
|
<ion-icon name="star-outline" class="me-1"></ion-icon> {{ channel.attributes['tvg-id'] }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
{% endif %}
|
||||||
</tr>
|
|
||||||
|
{% if (channel.contentType != null) %}
|
||||||
|
<div title="Тип контента (mime-type)" class="cursor-help">
|
||||||
|
<ion-icon name="eye-outline" class="me-1"></ion-icon> {{ channel.contentType }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if channel.tags|length > 0 %}
|
||||||
|
<ion-icon name="pricetag-outline"
|
||||||
|
class="cursor-help me-1"
|
||||||
|
title="Теги"
|
||||||
|
></ion-icon>
|
||||||
|
{% for tag in channel.tags %}
|
||||||
|
<span class="chtag">#{{ tag }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -434,84 +467,84 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<script src="/js/list.min.js"></script>
|
<script src="/js/list.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
const options = {
|
const options = {
|
||||||
valueNames: [
|
valueNames: [
|
||||||
'chname',
|
'chname',
|
||||||
{data: ['online', 'group', 'tag', 'chtags']}
|
{data: ['online', 'group', 'tag', 'chtags']}
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
const list = new List('chlist', options)
|
const list = new List('chlist', options)
|
||||||
list.on('updated', (data) => document.getElementById('chcount').innerText = data.visibleItems.length)
|
list.on('updated', (data) => document.getElementById('chcount').innerText = data.visibleItems.length)
|
||||||
document.getElementById('search-field').addEventListener('keyup', (e) => list.search(e.target.value))
|
document.getElementById('search-field').addEventListener('keyup', (e) => list.search(e.target.value))
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
const alert = document.getElementById("toomuchalert");
|
const alert = document.getElementById("toomuchalert");
|
||||||
!!alert && alert.remove()
|
!!alert && alert.remove()
|
||||||
});
|
});
|
||||||
|
|
||||||
function savePlaylist() {
|
function savePlaylist() {
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
const content = document.getElementById("m3u-raw").value
|
const content = document.getElementById("m3u-raw").value
|
||||||
const file = new Blob([content], { type: 'text/plain' });
|
const file = new Blob([content], { type: 'text/plain' });
|
||||||
link.href = URL.createObjectURL(file);
|
link.href = URL.createObjectURL(file);
|
||||||
link.download = "{{ playlist.code }}.m3u8";
|
link.download = "{{ playlist.code }}.m3u8";
|
||||||
link.click();
|
link.click();
|
||||||
URL.revokeObjectURL(link.href);
|
URL.revokeObjectURL(link.href);
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetGroup() {
|
||||||
|
document.getElementById('groupSelector').value = 'all'
|
||||||
|
updateFilter()
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetSearch() {
|
||||||
|
list.search('')
|
||||||
|
document.getElementById('search-field').value = ''
|
||||||
|
document.getElementById('chfAll').checked = true
|
||||||
|
document.querySelectorAll('input[id*="btn-tag-"]:checked').forEach(tag => tag.checked = false)
|
||||||
|
updateFilter()
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateFilter() {
|
||||||
|
const groupHash = document.getElementById('groupSelector')?.value ?? 'all';
|
||||||
|
const tagsElements = document.querySelectorAll('input[id*="btn-tag-"]:checked')
|
||||||
|
const tagsSelected = []
|
||||||
|
tagsElements.forEach(tag => tagsSelected.push(tag.attributes['data-tag'].value));
|
||||||
|
const activeType = document.querySelector('input[name="chFilter"]:checked').id;
|
||||||
|
switch (activeType) {
|
||||||
|
case 'chfAll':
|
||||||
|
list.filter(item => {
|
||||||
|
const chTags = item.values().chtags.split('|');
|
||||||
|
const isGroupValid = item.values().group === groupHash || groupHash === 'all';
|
||||||
|
const tagsIntersection = tagsSelected.filter(tagSelected => chTags.includes(tagSelected));
|
||||||
|
const hasValidTags = tagsIntersection.length > 0 || tagsSelected.length === 0;
|
||||||
|
return isGroupValid && hasValidTags;
|
||||||
|
})
|
||||||
|
break
|
||||||
|
case 'chfOnline':
|
||||||
|
list.filter(item => {
|
||||||
|
const isOnline = item.values().online === '1'
|
||||||
|
const chTags = item.values().chtags.split('|');
|
||||||
|
const isGroupValid = item.values().group === groupHash || groupHash === 'all';
|
||||||
|
const tagsIntersection = tagsSelected.filter(tagSelected => chTags.includes(tagSelected));
|
||||||
|
const hasValidTags = tagsIntersection.length > 0 || tagsSelected.length === 0;
|
||||||
|
return isGroupValid && isOnline && hasValidTags
|
||||||
|
})
|
||||||
|
break
|
||||||
|
case 'chfOffline':
|
||||||
|
list.filter(item => {
|
||||||
|
const isOffline = item.values().online === '0'
|
||||||
|
const chTags = item.values().chtags.split('|');
|
||||||
|
const isGroupValid = item.values().group === groupHash || groupHash === 'all';
|
||||||
|
const tagsIntersection = tagsSelected.filter(tagSelected => chTags.includes(tagSelected));
|
||||||
|
const hasValidTags = tagsIntersection.length > 0 || tagsSelected.length === 0;
|
||||||
|
return isGroupValid && isOffline && hasValidTags
|
||||||
|
})
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function resetGroup() {
|
</script>
|
||||||
document.getElementById('groupSelector').value = 'all'
|
|
||||||
updateFilter()
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetSearch() {
|
|
||||||
list.search('')
|
|
||||||
document.getElementById('search-field').value = ''
|
|
||||||
document.getElementById('chfAll').checked = true
|
|
||||||
document.querySelectorAll('input[id*="btn-tag-"]:checked').forEach(tag => tag.checked = false)
|
|
||||||
updateFilter()
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateFilter() {
|
|
||||||
const groupHash = document.getElementById('groupSelector')?.value ?? 'all';
|
|
||||||
const tagsElements = document.querySelectorAll('input[id*="btn-tag-"]:checked')
|
|
||||||
const tagsSelected = []
|
|
||||||
tagsElements.forEach(tag => tagsSelected.push(tag.attributes['data-tag'].value));
|
|
||||||
const activeType = document.querySelector('input[name="chFilter"]:checked').id;
|
|
||||||
switch (activeType) {
|
|
||||||
case 'chfAll':
|
|
||||||
list.filter(item => {
|
|
||||||
const chTags = item.values().chtags.split('|');
|
|
||||||
const isGroupValid = item.values().group === groupHash || groupHash === 'all';
|
|
||||||
const tagsIntersection = tagsSelected.filter(tagSelected => chTags.includes(tagSelected));
|
|
||||||
const hasValidTags = tagsIntersection.length > 0 || tagsSelected.length === 0;
|
|
||||||
return isGroupValid && hasValidTags;
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'chfOnline':
|
|
||||||
list.filter(item => {
|
|
||||||
const isOnline = item.values().online === '1'
|
|
||||||
const chTags = item.values().chtags.split('|');
|
|
||||||
const isGroupValid = item.values().group === groupHash || groupHash === 'all';
|
|
||||||
const tagsIntersection = tagsSelected.filter(tagSelected => chTags.includes(tagSelected));
|
|
||||||
const hasValidTags = tagsIntersection.length > 0 || tagsSelected.length === 0;
|
|
||||||
return isGroupValid && isOnline && hasValidTags
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 'chfOffline':
|
|
||||||
list.filter(item => {
|
|
||||||
const isOffline = item.values().online === '0'
|
|
||||||
const chTags = item.values().chtags.split('|');
|
|
||||||
const isGroupValid = item.values().group === groupHash || groupHash === 'all';
|
|
||||||
const tagsIntersection = tagsSelected.filter(tagSelected => chTags.includes(tagSelected));
|
|
||||||
const hasValidTags = tagsIntersection.length > 0 || tagsSelected.length === 0;
|
|
||||||
return isGroupValid && isOffline && hasValidTags
|
|
||||||
})
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -11,27 +11,27 @@
|
|||||||
{% block metakeywords %}самообновляемые,бесплатные,iptv-плейлисты,iptv,плейлисты{% endblock %}
|
{% block metakeywords %}самообновляемые,бесплатные,iptv-плейлисты,iptv,плейлисты{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<style>
|
<style>
|
||||||
.card {transition: box-shadow .2s, transform .2s}
|
.card {transition: box-shadow .2s, transform .2s}
|
||||||
.card.hover-success:hover {transform: translateY(-7px); box-shadow: rgba(var(--bs-success-rgb), 1) 0 5px 20px -5px}
|
.card.hover-success:hover {transform: translateY(-7px); box-shadow: rgba(var(--bs-success-rgb), 1) 0 5px 20px -5px}
|
||||||
.card.hover-danger:hover {transform: translateY(-7px); box-shadow: rgba(var(--bs-danger-rgb), 1) 0 5px 20px -5px}
|
.card.hover-danger:hover {transform: translateY(-7px); box-shadow: rgba(var(--bs-danger-rgb), 1) 0 5px 20px -5px}
|
||||||
.card.hover-secondary:hover {transform: translateY(-7px); box-shadow: rgba(var(--bs-secondary-rgb), 1) 0 5px 20px -5px}
|
.card.hover-secondary:hover {transform: translateY(-7px); box-shadow: rgba(var(--bs-secondary-rgb), 1) 0 5px 20px -5px}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
function setDefaultLogo(imgtag) {
|
function setDefaultLogo(imgtag) {
|
||||||
imgtag.onerror = null
|
imgtag.onerror = null
|
||||||
imgtag.src = '/no-tvg-logo.png'
|
imgtag.src = '/no-tvg-logo.png'
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header %}
|
{% block header %}
|
||||||
<div class="d-flex flex-wrap justify-content-between align-items-center mb-4">
|
<div class="d-flex flex-wrap justify-content-between align-items-center mb-4">
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<h2 class="mb-0">Список плейлистов ({{ count }})</h2>
|
<h2 class="mb-0">Список плейлистов ({{ count }})</h2>
|
||||||
<div class="text-muted small">Изменён {{ updatedAt }} МСК</div>
|
<div class="text-muted small">Изменён {{ updatedAt }} МСК</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
@@ -49,17 +49,37 @@
|
|||||||
<a href="/{{ code }}/details" class="text-decoration-none">
|
<a href="/{{ code }}/details" class="text-decoration-none">
|
||||||
<div class="card-header d-flex align-items-center gap-2">
|
<div class="card-header d-flex align-items-center gap-2">
|
||||||
<span class="font-monospace text-{{ statusClass }}">{{ code }}</span>
|
<span class="font-monospace text-{{ statusClass }}">{{ code }}</span>
|
||||||
<span class="badge bg-{{ statusClass }} ms-auto">
|
|
||||||
{% if playlist.isOnline is same as(true) %}online
|
|
||||||
{% elseif playlist.isOnline is same as(false) %}offline
|
|
||||||
{% elseif playlist.isOnline is same as(null) %}unknown
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
{% if playlist.isOnline is same as(true) %}
|
{% if playlist.isOnline is same as(true) %}
|
||||||
<span class="badge border border-success" title="Процент рабочих каналов">{{ playlist.onlinePercent }}%</span>
|
<span class="cursor-help badge bg-{{ statusClass }} ms-auto"
|
||||||
|
title="Возможно, этот плейлист рабочий"
|
||||||
|
>online</span>
|
||||||
|
{% elseif playlist.isOnline is same as(false) %}
|
||||||
|
<span class="cursor-help badge bg-{{ statusClass }} ms-auto"
|
||||||
|
title="Этот плейлист нерабочий или его не удалось проверить"
|
||||||
|
>offline</span>
|
||||||
|
{% elseif playlist.isOnline is same as(null) %}
|
||||||
|
<span class="cursor-help badge bg-{{ statusClass }} ms-auto"
|
||||||
|
title="Плейлист ещё не проверялся, придётся подождать"
|
||||||
|
>unknown</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if playlist.isOnline is same as(true) %}
|
||||||
|
<span class="cursor-help badge border border-success"
|
||||||
|
title="Процент рабочих каналов"
|
||||||
|
>{{ playlist.onlinePercent }}%</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if "adult" in playlist.tags %}
|
{% if "adult" in playlist.tags %}
|
||||||
<span class="badge bg-warning text-dark" title="Есть каналы для взрослых!">18+</span>
|
<span class="cursor-help badge bg-warning text-dark"
|
||||||
|
title="Есть каналы для взрослых!"
|
||||||
|
>18+</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if playlist.hasTokens is same as(true) %}
|
||||||
|
<span class="cursor-help badge bg-info text-dark"
|
||||||
|
title="В плейлисте есть каналы, которые могут быть нестабильны"
|
||||||
|
><ion-icon name="paw"></ion-icon></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
@@ -69,7 +89,7 @@
|
|||||||
<h5 class="card-title text-light">{{ playlist.name }}</h5>
|
<h5 class="card-title text-light">{{ playlist.name }}</h5>
|
||||||
</a>
|
</a>
|
||||||
{% if playlist.description is not same as(null) %}
|
{% if playlist.description is not same as(null) %}
|
||||||
<p class="card-text small text-secondary d-none d-md-block">{{ playlist.description }}</p>
|
<p class="card-text small text-secondary d-none d-md-block">{{ playlist.description }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="d-flex flex-wrap gap-2 mb-1">
|
<div class="d-flex flex-wrap gap-2 mb-1">
|
||||||
{% if playlist.isOnline is not same as(null) %}
|
{% if playlist.isOnline is not same as(null) %}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="keywords" content="{% block metakeywords %}{% endblock %}" />
|
<meta name="keywords" content="{% block metakeywords %}{% endblock %}" />
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
<style>.cursor-pointer{cursor:pointer}</style>
|
<style>.cursor-pointer{cursor:pointer}.cursor-help{cursor:help}</style>
|
||||||
<script async type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
|
<script async type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
|
||||||
<script async nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
|
<script async nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
|
||||||
<link href="/css/bootstrap.min.css" rel="stylesheet">
|
<link href="/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
|||||||
Reference in New Issue
Block a user