mirror of
https://github.com/Viren070/MediaFusion.git
synced 2025-12-01 23:21:11 +01:00
a6492af5c5
Enhanced TMDB API scraper with better episode and year handling, streamlined year match logic, and improved metadata updates. CSS updates provide a more polished UI with better hover effects, spacing, and theming adjustments for a consistent dark mode appearance.
687 lines
45 KiB
HTML
687 lines
45 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Scraper Controls - {{ addon_name }} Stremio Addon</title>
|
|
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="/static/css/bootstrap-icons.css" rel="stylesheet">
|
|
<link href="/static/css/styles.css" rel="stylesheet">
|
|
<link href="/static/css/toastr.min.css" rel="stylesheet"/>
|
|
<link rel="shortcut icon" href="{{ logo_url }}" type="image/x-icon">
|
|
</head>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-10 col-lg-10 col-md-8 col-sm-10 config-container">
|
|
<a href="/"><img class="logo" src="{{ logo_url }}"></a>
|
|
<h3 class="text-center mb-5"><b>Scraper Controls</b> - Manage Scraping Tasks</h3>
|
|
|
|
<!-- Scraper Selection -->
|
|
<div class="section-container">
|
|
<h4 class="section-header">Scraper Selection</h4>
|
|
<hr class="section-divider">
|
|
<div class="mb-3">
|
|
<label for="scraperSelect" class="form-label">Select Scraper</label>
|
|
<select class="form-select" id="scraperSelect" onchange="updateFormFields()">
|
|
<option value="quick_import">Quick Import (Auto-detect)</option>
|
|
<option value="add_torrent">Add Torrent Data</option>
|
|
<option value="scrapy">Trigger Scrapy Spider</option>
|
|
<option value="add_tv_metadata">Add TV Metadata</option>
|
|
<option value="add_m3u_playlist">Add M3U Playlist</option>
|
|
<option value="update_imdb_data">Update IMDb Data</option>
|
|
<option value="block_torrent">Block Torrent</option>
|
|
<option value="migrate_id">Migrate MediaFusion ID to IMDb ID</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Dynamic Scraper Parameters -->
|
|
<div id="scraperParameters">
|
|
|
|
<div id="quickImportParameters" style="display: none;">
|
|
<div class="section-container">
|
|
<h4 class="section-header">Quick Import</h4>
|
|
<hr class="section-divider">
|
|
|
|
<!-- Content Type Selection -->
|
|
<div class="mb-3">
|
|
<label for="quickMetaType" class="form-label">Content Type</label>
|
|
<select class="form-select" id="quickMetaType" name="quickMetaType" required>
|
|
<option value="movie">Movie</option>
|
|
<option value="series">Series</option>
|
|
<option value="sports">Sports</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Torrent Upload Area -->
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<h6 class="card-subtitle mb-3 text-muted">Recommended: Torrent File Upload</h6>
|
|
<div class="mb-3">
|
|
<label for="quickTorrentFile" class="form-label">Torrent File</label>
|
|
<input type="file" class="form-control" id="quickTorrentFile"
|
|
name="quickTorrentFile" accept=".torrent"
|
|
onchange="toggleInput('quickMagnetLink', this)">
|
|
<div class="form-text">Upload a torrent file for better metadata extraction</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Magnet Link Alternative -->
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<h6 class="card-subtitle mb-3 text-muted">Alternative: Magnet Link</h6>
|
|
<div class="mb-3">
|
|
<label for="quickMagnetLink" class="form-label">Magnet Link</label>
|
|
<input type="text" class="form-control" id="quickMagnetLink"
|
|
name="quickMagnetLink" placeholder="magnet:?xt=urn:btih:..."
|
|
onchange="toggleInput('quickTorrentFile', this)">
|
|
<div class="form-text text-warning">
|
|
<i class="bi bi-exclamation-triangle"></i>
|
|
Note: Magnet links may have limited metadata availability
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Loading Indicator -->
|
|
<div id="analysisLoading" style="display: none;" class="text-center mb-4">
|
|
<div class="spinner-border text-primary" role="status">
|
|
<span class="visually-hidden">Analyzing...</span>
|
|
</div>
|
|
<p class="mt-2">Analyzing torrent and searching for matches...</p>
|
|
</div>
|
|
|
|
<!-- Results Container -->
|
|
<div id="matchResults" class="mb-4" style="display: none;">
|
|
<h5>Potential Matches</h5>
|
|
<div id="matchResultsContent" class="list-group">
|
|
<!-- Matches will be inserted here -->
|
|
</div>
|
|
<button type="button" class="btn btn-secondary mt-3 w-100"
|
|
onclick="switchToManualImport()">
|
|
None of these match? Import manually
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Torrent Upload Parameters Section -->
|
|
<div id="torrentUploadParameters" style="display: none;">
|
|
<div class="section-container">
|
|
<!-- Basic Content Information -->
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Basic Information</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<!-- Content Type and Release Date -->
|
|
<div class="row mb-4">
|
|
<div class="col-md-4">
|
|
<label for="metaType" class="form-label">Content Type</label>
|
|
<select class="form-select" id="metaType" name="metaType" onchange="updateContentType()">
|
|
<option value="movie" {% if prefill_data.meta_type == 'movie' %}selected{% endif %}>Movie</option>
|
|
<option value="series" {% if prefill_data.meta_type == 'series' %}selected{% endif %}>Series</option>
|
|
<option value="sports">Sports</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label for="torrentType" class="form-label">Torrent Type</label>
|
|
<select class="form-select" id="torrentType" name="torrentType">
|
|
<option value="public">Public</option>
|
|
<option value="semi-private">Semi-Private</option>
|
|
<option value="private">Private</option>
|
|
<option value="web-seed">Web-Seed</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label for="createdAt" class="form-label">Release Date</label>
|
|
<input type="date" class="form-control" id="createdAt" name="createdAt" required>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Content Metadata -->
|
|
<div class="row mb-3">
|
|
<div class="col-md-4" id="metaIdContainer">
|
|
<label for="torrentImdbId" class="form-label">IMDb ID</label>
|
|
<input type="text" class="form-control" id="torrentImdbId" maxlength="10" placeholder="e.g., tt1234567"
|
|
value="{% if prefill_data.meta_id %}{{ prefill_data.meta_id }}{% endif %}">
|
|
</div>
|
|
<div class="col-md-8">
|
|
<label for="title" class="form-label">Title</label>
|
|
<alert class="alert alert-info py-1" role="alert">
|
|
<i class="bi bi-info circle"></i> Validate auto-filled data before submission
|
|
</alert>
|
|
<input type="text" class="form-control" id="title" placeholder="Content title">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Media URLs -->
|
|
<div class="row mb-3">
|
|
<div class="col-md-4">
|
|
<label for="poster" class="form-label">Poster URL</label>
|
|
<input type="url" class="form-control" id="poster">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label for="background" class="form-label">Background URL</label>
|
|
<input type="url" class="form-control" id="background">
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label for="logo" class="form-label">Logo URL</label>
|
|
<input type="url" class="form-control" id="logo">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Add title to poster option -->
|
|
<div class="mb-3">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="addTitleToPoster" name="addTitleToPoster">
|
|
<label class="form-check-label" for="addTitleToPoster">
|
|
Add title to poster
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Technical Specifications -->
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Technical Specifications</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<!-- Basic specs grid -->
|
|
<div class="technical-specs-basic"></div>
|
|
|
|
<!-- Advanced Toggle Button will be inserted here -->
|
|
<div class="advanced-toggle" id="toggleAdvanced">
|
|
<i class="bi bi-chevron-down"></i>
|
|
<span>Advanced Technical Options</span>
|
|
</div>
|
|
|
|
<!-- Advanced Technical Specifications -->
|
|
<div class="advanced-section" id="advancedSection">
|
|
<div class="row mb-4">
|
|
<div class="col-md-4">
|
|
<label for="resolution" class="form-label">Resolution</label>
|
|
<select class="form-select" id="resolution" onchange="updateSpecField('resolution', this.value)">
|
|
<option value="">Select Resolution</option>
|
|
<option value="480p">480p</option>
|
|
<option value="576p">576p</option>
|
|
<option value="720p">720p</option>
|
|
<option value="1080p">1080p</option>
|
|
<option value="1440p">1440p</option>
|
|
<option value="2160p">2160p</option>
|
|
<option value="4K">4K</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label for="quality" class="form-label">Quality</label>
|
|
<select class="form-select" id="quality" onchange="updateSpecField('quality', this.value)">
|
|
<option value="">Select Quality</option>
|
|
<option value="BluRay">BluRay</option>
|
|
<option value="BluRay REMUX">BluRay REMUX</option>
|
|
<option value="BRRip">BRRip</option>
|
|
<option value="BDRip">BDRip</option>
|
|
<option value="WEB-DL">WEB-DL</option>
|
|
<option value="HDRip">HDRip</option>
|
|
<option value="DVDRip">DVDRip</option>
|
|
<option value="HDTV">HDTV</option>
|
|
<option value="CAM">CAM</option>
|
|
<option value="TeleSync">TeleSync</option>
|
|
<option value="SCR">SCR</option>
|
|
</select>
|
|
</div>
|
|
<!-- Video Codec -->
|
|
<div id="video-codec-section" class="col-md-4">
|
|
<label for="videoCodec" class="form-label">Video Codec</label>
|
|
<select class="form-select" id="videoCodec" onchange="updateSpecField('codec', this.value)">
|
|
<option value="">Select Video Codec</option>
|
|
<option value="x264">x264</option>
|
|
<option value="x265">x265</option>
|
|
<option value="h.264">H.264</option>
|
|
<option value="h.265">H.265</option>
|
|
<option value="hevc">HEVC</option>
|
|
<option value="avc">AVC</option>
|
|
<option value="mpeg-2">MPEG-2</option>
|
|
<option value="mpeg-4">MPEG-4</option>
|
|
<option value="vp9">VP9</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Audio Codecs -->
|
|
<div id="audio-codecs-section">
|
|
<label class="form-label">Audio Codecs</label>
|
|
<div class="row">
|
|
{% for codec in ['AAC', 'AC3', 'DTS', 'DTS-HD MA', 'TrueHD', 'Atmos', 'DD+', 'Dolby Digital Plus', 'DTS Lossless'] %}
|
|
<div class="col-md-3 col-sm-6">
|
|
<div class="form-check mb-2">
|
|
<input class="form-check-input" type="checkbox"
|
|
name="audioCodecs" value="{{ codec }}"
|
|
id="audio-{{ codec|replace(' ', '')|replace('+', '') }}">
|
|
<label class="form-check-label"
|
|
for="audio-{{ codec|replace(' ', '')|replace('+', '') }}">
|
|
{{ codec }}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- HDR Formats -->
|
|
<div id="hdr-formats-section">
|
|
<label class="form-label">HDR Formats</label>
|
|
<div class="row">
|
|
{% for format in ['DV', 'HDR10+', 'HDR', 'SDR'] %}
|
|
<div class="col-md-3 col-sm-6">
|
|
<div class="form-check mb-2">
|
|
<input class="form-check-input" type="checkbox"
|
|
name="hdrFormats" value="{{ format }}"
|
|
id="hdr-{{ format|replace('+', '') }}">
|
|
<label class="form-check-label"
|
|
for="hdr-{{ format|replace('+', '') }}">
|
|
{{ format }}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Languages -->
|
|
<div id="languages-section">
|
|
<label class="form-label">Languages</label>
|
|
<div class="row">
|
|
{% for language in supported_languages %}
|
|
<div class="col-md-3 col-sm-6">
|
|
<div class="form-check mb-2">
|
|
<input class="form-check-input" type="checkbox"
|
|
name="languages" value="{{ language }}"
|
|
id="lang-{{ language }}">
|
|
<label class="form-check-label"
|
|
for="lang-{{ language }}">
|
|
{{ language }}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Catalogs Section -->
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Content Categories</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<!-- Movie Catalogs -->
|
|
<div id="movieCatalogs" class="catalog-group" style="display: none;">
|
|
<div class="alert alert-info" role="alert">
|
|
<i class="bi bi-info-circle"></i> Select categories to help organize your content
|
|
</div>
|
|
<div class="catalog-grid">
|
|
{% for catalog in supported_movie_catalog_ids %}
|
|
<div class="catalog-item">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" name="catalogs"
|
|
value="{{ catalog }}" id="catalog-{{ catalog }}">
|
|
<label class="form-check-label" for="catalog-{{ catalog }}">
|
|
{{ catalog_data.get(catalog) }}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Series Catalogs -->
|
|
<div id="seriesCatalogs" class="catalog-group" style="display: none;">
|
|
<div class="alert alert-info" role="alert">
|
|
<i class="bi bi-info-circle"></i> Select categories to help organize your content
|
|
</div>
|
|
<div class="catalog-grid">
|
|
{% for catalog in supported_series_catalog_ids %}
|
|
<div class="catalog-item">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" name="catalogs"
|
|
value="{{ catalog }}" id="catalog-{{ catalog }}">
|
|
<label class="form-check-label" for="catalog-{{ catalog }}">
|
|
{{ catalog_data.get(catalog) }}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Sports Catalogs -->
|
|
<div id="sportsCatalogs" class="catalog-group" style="display: none;">
|
|
<div class="col-md-12">
|
|
<select class="form-select" id="sportsCatalog">
|
|
<option value="">Select Sports Category</option>
|
|
<option value="american_football">American Football / NFL</option>
|
|
<option value="baseball">Baseball / MLB</option>
|
|
<option value="basketball">Basketball / NBA</option>
|
|
<option value="football">Football / Soccer</option>
|
|
<option value="formula_racing">Formula Racing</option>
|
|
<option value="hockey">Hockey / NHL</option>
|
|
<option value="motogp_racing">MotoGP Racing</option>
|
|
<option value="other_sports">Other Sports</option>
|
|
<option value="rugby">Rugby / AFL</option>
|
|
<option value="wwe">WWE</option>
|
|
<option value="ufc">UFC</option>
|
|
<option value="fighting">Fighting</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Torrent Data Section -->
|
|
<div class="card mb-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Torrent Data</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="mb-3">
|
|
<label for="torrentFile" class="form-label">Torrent File</label>
|
|
<input type="file" class="form-control" id="torrentFile" accept=".torrent" onchange="toggleInput('magnetLink', this)">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="magnetLink" class="form-label">Magnet Link</label>
|
|
<input type="text" class="form-control" id="magnetLink" placeholder="magnet:?xt=urn:btih:..." onchange="toggleInput('torrentFile', this)">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Uploader Information -->
|
|
<div class="mb-3">
|
|
<label for="uploaderName" class="form-label">Uploader Name (Optional)</label>
|
|
<input type="text" class="form-control" id="uploaderName" placeholder="Enter your name or leave blank for Anonymous">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Scrapy Parameters -->
|
|
<div id="scrapyParameters" style="display: none;">
|
|
<div class="mb-3">
|
|
<label for="spiderName" class="form-label">Spider Name</label>
|
|
<select class="form-select" id="spiderName" name="spider_name">
|
|
{% for spider_id, spider_name in scrapy_spiders %}
|
|
<option value="{{ spider_id }}">{{ spider_name }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<!-- Additional Parameters based on Spider Selection -->
|
|
<div id="tamilmvTamilblastersParams" style="display: none;" class="mb-3 mt-4">
|
|
<label><input type="radio" name="mode" value="page_scraping" onchange="toggleModeSpecificFields()"> Page Scraping</label>
|
|
<label><input type="radio" name="mode" value="keyword_search" checked onchange="toggleModeSpecificFields()"> Keyword Search</label>
|
|
|
|
<!-- Keyword Search Input -->
|
|
<div id="keywordSearchInput" class="mb-3" style="display: none;">
|
|
<label for="keyword" class="form-label">Search Keyword</label>
|
|
<input type="text" class="form-control" id="keyword" name="search_keyword">
|
|
</div>
|
|
|
|
<!-- Page Scraping Input -->
|
|
<div id="pageScrapingInput" class="mb-3" style="display: none;">
|
|
<label for="pages" class="form-label">Number of Pages</label>
|
|
<input type="number" class="form-control" id="pages" name="pages" value="1">
|
|
<label for="startPage" class="form-label">Start Page</label>
|
|
<input type="number" class="form-control" id="startPage" name="start_page" value="1">
|
|
|
|
<!-- Scrap Catalog ID Dropdown -->
|
|
<label for="scrapCatalogId" class="form-label">Scrap Catalog ID</label>
|
|
<select class="form-select" id="scrapCatalogId" name="scrap_catalog_id">
|
|
<option value="all">All</option>
|
|
<option value="tamil_hdrip">Tamil HDRip</option>
|
|
<option value="tamil_tcrip">Tamil TCrip</option>
|
|
<option value="tamil_dubbed">Tamil Dubbed</option>
|
|
<option value="tamil_series">Tamil Series</option>
|
|
<option value="malayalam_hdrip">Malayalam HDRip</option>
|
|
<option value="malayalam_tcrip">Malayalam TCrip</option>
|
|
<option value="malayalam_dubbed">Malayalam Dubbed</option>
|
|
<option value="malayalam_series">Malayalam Series</option>
|
|
<option value="telugu_tcrip">Telugu TCrip</option>
|
|
<option value="telugu_hdrip">Telugu HDRip</option>
|
|
<option value="telugu_dubbed">Telugu Dubbed</option>
|
|
<option value="telugu_series">Telugu Series</option>
|
|
<option value="hindi_tcrip">Hindi TCrip</option>
|
|
<option value="hindi_hdrip">Hindi HDRip</option>
|
|
<option value="hindi_dubbed">Hindi Dubbed</option>
|
|
<option value="hindi_series">Hindi Series</option>
|
|
<option value="kannada_tcrip">Kannada TCrip</option>
|
|
<option value="kannada_hdrip">Kannada HDRip</option>
|
|
<option value="kannada_series">Kannada Series</option>
|
|
<option value="english_tcrip">English TCrip</option>
|
|
<option value="english_hdrip">English HDRip</option>
|
|
<option value="english_series">English Series</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div id="scrapeAllOption" class="mb-3" style="display: none;">
|
|
<label for="totalPages" class="form-label">Total Number of Pages</label>
|
|
<input type="number" class="form-control" id="totalPages" name="total_pages" value="1">
|
|
<label><input type="checkbox" name="scrape_all" id="scrape_all"> Scrape All Pages</label>
|
|
</div>
|
|
</div>
|
|
<!-- TV Metadata Input -->
|
|
<div id="tvMetadataInput" style="display: none;">
|
|
<h4 class="section-header">TV Metadata Input</h4>
|
|
<hr class="section-divider">
|
|
<div class="mb-3">
|
|
<label for="title" class="form-label">Title</label>
|
|
<input type="text" class="form-control" id="title" name="title" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="poster" class="form-label">Poster URL (Optional)</label>
|
|
<input type="url" class="form-control" id="poster" name="poster">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="logo" class="form-label">Logo URL (Optional)</label>
|
|
<input type="url" class="form-control" id="logo" name="logo">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="background" class="form-label">Background URL (Optional)</label>
|
|
<input type="url" class="form-control" id="background" name="background">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="country" class="form-label">Country (Optional)</label>
|
|
<input type="text" class="form-control" id="country" name="country">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="language" class="form-label">Language (Optional)</label>
|
|
<input type="text" class="form-control" id="language" name="language">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="genreInput" class="form-label">Genres (Optional)</label>
|
|
<div id="genreInputs" class="mb-2"></div>
|
|
<input type="text" class="form-control mb-2" id="genreInput" placeholder="Add genre">
|
|
<button type="button" class="btn btn-secondary" onclick="addGenre()">Add Genre</button>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Streams</label>
|
|
<div id="streamInputs"></div>
|
|
<button type="button" class="btn btn-primary" onclick="addStreamInput()">Add Stream</button>
|
|
</div>
|
|
</div>
|
|
<div id="m3uPlaylistInput" style="display: none;">
|
|
<div class="mb-3">
|
|
<div>
|
|
<label><input type="radio" name="m3uInputType" value="url" checked> M3U Playlist URL</label>
|
|
<label><input type="radio" name="m3uInputType" value="file"> Upload M3U File</label>
|
|
</div>
|
|
</div>
|
|
<div class="mb-3" id="m3uPlaylistUrlInput">
|
|
<label for="m3uPlaylistUrl" class="form-label">M3U Playlist URL</label>
|
|
<input type="url" class="form-control" id="m3uPlaylistUrl" name="m3uPlaylistUrl">
|
|
</div>
|
|
<div class="mb-3" id="m3uPlaylistFileInput" style="display: none;">
|
|
<label for="m3uPlaylistFile" class="form-label">Upload M3U File</label>
|
|
<input type="file" class="form-control" id="m3uPlaylistFile" name="m3uPlaylistFile" accept=".m3u">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="m3uPlaylistSource" class="form-label">Playlist Source Name</label>
|
|
<input type="text" class="form-control" id="m3uPlaylistSource" name="m3uPlaylistSource">
|
|
</div>
|
|
</div>
|
|
<!-- IMDb Data Update Parameters -->
|
|
<div id="imdbDataParameters" style="display: none;">
|
|
<div class="mb-3">
|
|
<label for="imdbId" class="form-label">IMDb ID</label>
|
|
<input type="text" class="form-control" id="imdbId" name="imdb_id" placeholder="Enter IMDb ID (e.g., tt1234567)">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="imdbType" class="form-label">IMDb Type</label>
|
|
<select class="form-select" id="imdbType" name="imdb_type">
|
|
<option value="movie">Movie</option>
|
|
<option value="series">Series</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="blockTorrentParameters" style="display: none;">
|
|
<div class="mb-3">
|
|
<label for="blockTorrentInfoHash" class="form-label">Torrent Info Hash</label>
|
|
<input type="text" class="form-control" id="blockTorrentInfoHash" name="blockTorrentInfoHash" required
|
|
value="{% if prefill_data.info_hash %}{{ prefill_data.info_hash }}{% endif %}">
|
|
</div>
|
|
</div>
|
|
|
|
<div id="migrationParameters" style="display: none;">
|
|
<div class="mb-3">
|
|
<label for="mediafusionId" class="form-label">MediaFusion ID</label>
|
|
<input type="text" class="form-control" id="mediafusionId" name="mediafusion_id" required
|
|
value="{% if prefill_data.mediafusion_id %}{{ prefill_data.mediafusion_id }}{% endif %}">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="migrationImdbId" class="form-label">IMDb ID</label>
|
|
<input type="text" class="form-control" id="migrationImdbId" name="imdb_id"
|
|
placeholder="Enter IMDb ID (e.g., tt1234567)" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="mediaType" class="form-label">Media Type</label>
|
|
<select class="form-select" id="mediaType" name="media_type">
|
|
<option value="movie" {% if prefill_data.meta_type == 'movie' %}selected{% endif %}>Movie</option>
|
|
<option value="series" {% if prefill_data.meta_type == 'series' %}selected{% endif %}>Series</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<!-- API Password Configuration -->
|
|
<input type="hidden" id="apiPasswordEnabled" value="{{ api_password_enabled }}">
|
|
<div id="apiPasswordContainer" class="section-container" style="display: none;">
|
|
<h4 class="section-header">API Security Configuration</h4>
|
|
<hr class="section-divider">
|
|
<div class="mb-3">
|
|
<label for="api_password">API Password:</label>
|
|
<div class="input-group">
|
|
<input class="form-control" type="password" id="api_password" name="api_password" placeholder="Enter API Password">
|
|
<button class="btn btn-outline-secondary" type="button" id="toggleApiPassword">
|
|
<span id="toggleApiPasswordIcon" class="bi bi-eye"></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="button-container mt-5">
|
|
<button type="button" class="btn btn-primary" id="submitBtn" onclick="submitScraperForm()">Run</button>
|
|
<div id="loadingSpinner" class="spinner-border text-primary" role="status" style="display: none;">
|
|
<span class="visually-hidden">Loading...</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- File Annotation Modal -->
|
|
<div class="modal fade" id="fileAnnotationModal" tabindex="-1">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Annotate Video Files</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="alert alert-info">
|
|
<i class="bi bi-info-circle"></i> Please specify season and episode numbers for each video file
|
|
</div>
|
|
|
|
<!-- Bulk Season Assignment -->
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<h6 class="card-title">Bulk Season Assignment</h6>
|
|
<div class="row mb-3">
|
|
<div class="col-md-6">
|
|
<label class="form-label">Season</label>
|
|
<div class="input-group">
|
|
<input type="number" class="form-control" id="bulkSeason" min="1" placeholder="Season number">
|
|
<button class="btn btn-outline-secondary" type="button" id="applyBulkSeason">Apply to All</button>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label class="form-label">Multiple Seasons</label>
|
|
<div class="input-group">
|
|
<input type="text" class="form-control" id="multipleSeasons" placeholder="e.g., 1-3 or 1,2,4">
|
|
<button class="btn btn-outline-secondary" type="button" id="applyMultiSeasons">Apply Sequence</button>
|
|
</div>
|
|
<small class="text-muted">For multi-season packs. Will assign seasons sequentially to files.</small>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- File grouping options -->
|
|
<div id="fileGroupingOptions" style="display: none;">
|
|
<h6 class="mt-3">Season Distribution</h6>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="radio" name="seasonDistribution" id="autoDistribute" value="auto" checked>
|
|
<label class="form-check-label" for="autoDistribute">
|
|
Auto-distribute episodes across seasons
|
|
</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="radio" name="seasonDistribution" id="manualGroup" value="manual">
|
|
<label class="form-check-label" for="manualGroup">
|
|
Manually group episodes per season
|
|
</label>
|
|
</div>
|
|
<div id="episodesPerSeason" class="mt-2" style="display: none;">
|
|
<label class="form-label">Episodes per season</label>
|
|
<input type="number" class="form-control" id="episodeCount" min="1" placeholder="Number of episodes per season">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- File list for annotation -->
|
|
<div id="fileAnnotationList"></div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="button" class="btn btn-primary" id="confirmAnnotation">Confirm</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- JS for Bootstrap -->
|
|
<script src="/static/js/jquery-3.6.0.min.js"></script>
|
|
<script src="/static/js/popper.min.js"></script>
|
|
<script src="/static/js/bootstrap.min.js"></script>
|
|
<script src="/static/js/toastr.min.js"></script>
|
|
<script src="/static/js/scraperControl.js"></script>
|
|
</body>
|
|
|
|
</html>
|