initial: modular iptv-dl with runtime config from ~/.iptv-downloader/config.json
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/* ── Shared IPTV downloader JS ──────────────────────────────── */
|
||||
var BASE = (function(){
|
||||
var m = window.location.pathname.match(/^(\/[^/]+)/);
|
||||
return m ? m[1] : '';
|
||||
})();
|
||||
|
||||
function filter(el) {
|
||||
document.querySelectorAll('.card').forEach(function(c) {
|
||||
c.style.display = c.textContent.toLowerCase().includes(el.value.toLowerCase()) ? '' : 'none';
|
||||
});
|
||||
}
|
||||
|
||||
function dlMov(id, title, ext, icon) {
|
||||
if (!confirm('Download: ' + title + '?')) return;
|
||||
fetch(BASE + '/api/download_movie', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({id: id, title: title, ext: ext || 'mp4', cover_url: icon || ''})
|
||||
}).then(function() { alert('Queued!'); location.href = BASE + '/downloads'; });
|
||||
}
|
||||
Reference in New Issue
Block a user