// ==UserScript== // @name M3Unator - Web Directory Playlist Creator // @namespace https://github.com/hasanbeder/M3Unator // @version 1.0.0 // @description Create M3U/M3U8 playlists from directory listing pages. Automatically finds video and audio files in web server indexes. // @author Hasan Beder // @license GPL-3.0 // @match *://*/* // @grant GM_addStyle // @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmNWMyZTciIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cG9seWdvbiBwb2ludHM9IjIzIDcgMTYgMTIgMjMgMTcgMjMgNyIvPjxyZWN0IHg9IjEiIHk9IjUiIHdpZHRoPSIxNSIgaGVpZ2h0PSIxNCIgcng9IjIiIHJ5PSIyIi8+PC9zdmc+ // @homepageURL https://github.com/hasanbeder/M3Unator // @supportURL https://github.com/hasanbeder/M3Unator/issues // @run-at document-end // @noframes true // @downloadURL none // ==/UserScript== (function() { 'use strict'; if (!document.title.includes('Index of')) { console.log('This page is not an Index page, M3Unator disabled.'); return; } GM_addStyle(` @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); [class^="M3Unator"] { font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; } .M3Unator-title { font-weight: 700; letter-spacing: -0.02em; } .M3Unator-input-group label { font-weight: 500; letter-spacing: -0.01em; } .M3Unator-input { font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-size: 0.9375rem; letter-spacing: -0.01em; } .M3Unator-button { font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-weight: 600; letter-spacing: -0.01em; } .M3Unator-control-btn { font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-weight: 500; letter-spacing: -0.01em; } .M3Unator-log { font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.8125rem; letter-spacing: -0.01em; line-height: 1.5; } .M3Unator-log-counter { font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-weight: 600; letter-spacing: -0.01em; } .M3Unator-container { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px); display: none; place-items: center; padding: 1rem; z-index: 9999; } .M3Unator-popup { background: #11111b; color: #cdd6f4; width: 100%; max-width: 480px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); overflow: hidden; animation: slideUp 0.3s ease; position: absolute; } .M3Unator-header { padding: 1.25rem 1.618rem; background: #1e1e2e; color: #cdd6f4; display: flex; align-items: center; justify-content: space-between; cursor: move; user-select: none; border-bottom: 1px solid #313244; } .M3Unator-title { display: flex; align-items: center; gap: 0.75rem; margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1; } .M3Unator-title svg { width: 24px; height: 24px; color: #f5c2e7; filter: drop-shadow(0 0 8px rgba(245, 194, 231, 0.4)); flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px; } .M3Unator-title span { display: flex; align-items: center; line-height: 24px; background: linear-gradient(90deg, #f5c2e7, #cba6f7, #89b4fa, #a6e3a1, #f5c2e7 ); background-size: 300% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: gradient 3s linear infinite; } .M3Unator-close { background: rgba(203, 166, 247, 0.1); border: none; color: #cba6f7; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; transition: all 0.2s ease; } .M3Unator-close:hover { background: rgba(203, 166, 247, 0.2); transform: rotate(360deg); } .M3Unator-close svg { width: 18px; height: 18px; } .M3Unator-content { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.75rem; } .M3Unator-input-group { margin-bottom: 0; } .M3Unator-input-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: #bac2de; } .M3Unator-input { width: 100%; padding: 0.618rem; border: 1px solid #313244; border-radius: 8px; background-color: #1e1e2e !important; color: #cdd6f4 !important; font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-size: 0.9375rem; letter-spacing: -0.01em; transition: all 0.2s ease; -webkit-text-fill-color: #cdd6f4 !important; text-decoration: none !important; -webkit-text-decoration: none !important; } .M3Unator-input:focus { outline: none; border-color: #f5c2e7; box-shadow: 0 0 0 3px rgba(245, 194, 231, 0.1); background-color: #1e1e2e !important; color: #cdd6f4 !important; -webkit-text-fill-color: #cdd6f4 !important; text-decoration: none !important; -webkit-text-decoration: none !important; } .M3Unator-input::placeholder { color: #6c7086; opacity: 1; } .M3Unator-toggle-container { position: relative; display: flex; align-items: center; justify-content: center; } .M3Unator-toggle-container input[type="checkbox"] { display: none; } .M3Unator-toggle-container span { width: 48px; height: 48px; background: #1e1e2e; border: 2px solid #45475a; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; } .M3Unator-toggle-container svg { width: 24px; height: 24px; opacity: 0.7; transition: all 0.3s ease; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .M3Unator-toggle-container input[type="checkbox"]:checked + span { background: rgba(203, 166, 247, 0.1); border-color: #cba6f7; box-shadow: 0 0 20px rgba(203, 166, 247, 0.2); } .M3Unator-toggle-container input[type="checkbox"]:checked + span svg { opacity: 1; color: #cba6f7; filter: drop-shadow(0 0 8px rgba(203, 166, 247, 0.4)); } .M3Unator-toggle-container span:hover { background: #313244; transform: translateY(-2px); } .M3Unator-toggle-container span:active { transform: translateY(1px); } .M3Unator-toggle-container input[type="checkbox"]:checked + span:hover { background: rgba(203, 166, 247, 0.2); } .M3Unator-toggle-container span:active { transform: translateY(1px); } .M3Unator-toggle-container svg { width: 24px; height: 24px; opacity: 0.8; transition: all 0.2s ease; } .M3Unator-toggle-container input[type="checkbox"]:checked + span svg { opacity: 1; color: #cba6f7; } .M3Unator-toggle-group { display: flex; gap: 0.75rem; margin: 0.75rem 0; justify-content: center; background: rgba(30, 30, 46, 0.4); padding: 0.75rem; border-radius: 12px; backdrop-filter: blur(8px); } [title]:hover::after { content: attr(title); position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); padding: 0.5rem 0.75rem; background: rgba(30, 30, 46, 0.95); color: #cdd6f4; font-size: 0.875rem; white-space: nowrap; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); z-index: 1000; border: 1px solid #313244; text-align: center; backdrop-filter: blur(8px); pointer-events: none; } .M3Unator-button { width: 100%; padding: 0.75rem; background: #f5c2e7; color: #11111b; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 0.5rem; } .M3Unator-button:hover { background: #f5c2e7; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245, 194, 231, 0.2); } .M3Unator-button:active { transform: translateY(0); } .M3Unator-button:disabled { opacity: 0.5; cursor: not-allowed; } .M3Unator-launcher { position: fixed; top: 1rem; right: 1.618rem; height: 48px; padding: 0 1.25rem; border-radius: 12px; background: rgba(30, 30, 46, 0.95); border: 2px solid #313244; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); display: flex; align-items: center; gap: 0.75rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 9998; backdrop-filter: blur(12px); } .M3Unator-launcher:hover { background: rgba(30, 30, 46, 0.98); border-color: #45475a; transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); } .M3Unator-launcher svg { width: 24px; height: 24px; color: #f5c2e7; filter: drop-shadow(0 0 8px rgba(245, 194, 231, 0.4)); } .M3Unator-launcher span { font-weight: 600; font-size: 0.95rem; background: linear-gradient(90deg, #f5c2e7, #cba6f7, #89b4fa, #a6e3a1, #f5c2e7 ); background-size: 300% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: gradient 3s linear infinite; } @keyframes gradient { 0% { background-position: 0% 50%; filter: hue-rotate(0deg); } 50% { background-position: 100% 50%; filter: hue-rotate(180deg); } 100% { background-position: 0% 50%; filter: hue-rotate(360deg); } } .M3Unator-dropdown { position: relative; width: 100%; } .M3Unator-dropdown-button { width: 100%; padding: 0.618rem; background: #1e1e2e; border: 1px solid #313244; border-radius: 8px; color: #cdd6f4; font-size: 0.875rem; text-align: left; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: space-between; } .M3Unator-dropdown-button:hover { border-color: #45475a; background: rgba(30, 30, 46, 0.8); } .M3Unator-dropdown-button svg { width: 16px; height: 16px; transition: transform 0.2s ease; } .M3Unator-dropdown.active .M3Unator-dropdown-button { border-color: #cba6f7; border-radius: 8px 8px 0 0; } .M3Unator-dropdown.active .M3Unator-dropdown-button svg { transform: rotate(180deg); } .M3Unator-dropdown-menu { position: absolute; top: 100%; left: 0; right: 0; background: #1e1e2e; border: 1px solid #cba6f7; border-top: none; border-radius: 0 0 8px 8px; overflow: hidden; z-index: 1000; display: none; animation: dropdownSlide 0.2s ease; user-select: none; } .M3Unator-dropdown.active .M3Unator-dropdown-menu { display: block; } .M3Unator-dropdown-item { padding: 0.618rem; color: #cdd6f4; cursor: pointer; transition: all 0.2s ease; user-select: none; } .M3Unator-dropdown-item:hover { background: rgba(203, 166, 247, 0.1); } .M3Unator-dropdown-item.selected { background: rgba(203, 166, 247, 0.1); color: #cba6f7; } @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } .M3Unator-log { margin-top: 0.75rem; max-height: calc(100vh - 70vh); font-size: 0.8125rem; line-height: 1.4; } .M3Unator-log:empty { display: none; } .M3Unator-log-entry { padding: 0.25rem 0.5rem; border-bottom: 1px solid #313244; } .M3Unator-log-entry:last-child { border-bottom: none; } .M3Unator-log-entry.success { color: #94e2d5; } .M3Unator-log-entry.error { color: #f38ba8; } .M3Unator-log-entry.warning { color: #fab387; } .M3Unator-log-counter { display: inline-flex; align-items: center; justify-content: center; background: rgba(245, 194, 231, 0.1); color: #f5c2e7; padding: 0.25rem 0.75rem; border-radius: 8px; font-size: 0.875rem; font-weight: 500; margin-left: 0.75rem; min-width: 3rem; text-align: center; } @keyframes gradient { 0% { background-position: 0% 50%; filter: hue-rotate(0deg); } 50% { background-position: 100% 50%; filter: hue-rotate(180deg); } 100% { background-position: 0% 50%; filter: hue-rotate(360deg); } } .M3Unator-title span.text { display: inline-block; position: relative; padding: 0 0.25rem; } .M3Unator-title.scanning span.text { background: linear-gradient(90deg, #f5c2e7, #cba6f7, #89b4fa, #a6e3a1, #f5c2e7 ); background-size: 300% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: gradient 3s linear infinite; font-weight: 700; letter-spacing: 0.5px; } .M3Unator-title.scanning span.text::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background: inherit; animation: gradient 3s linear infinite; } .M3Unator-title.scanning svg { animation: morphAnimation 2s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(203, 166, 247, 0.5)); } @keyframes morphAnimation { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } } .M3Unator-controls { display: none; gap: 0.75rem; margin: 0.75rem 0; justify-content: center; } .M3Unator-controls.active { display: flex; } .M3Unator-control-btn { display: none; padding: 0.75rem 1.5rem; border-radius: 12px; font-weight: 600; font-size: 0.95rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); align-items: center; gap: 0.75rem; min-width: 160px; justify-content: center; background: rgba(30, 30, 46, 0.6); backdrop-filter: blur(8px); width: 160px; } .M3Unator-control-btn:hover { background: #313244; transform: translateY(-1px); } .M3Unator-control-btn:active { transform: translateY(1px); } .M3Unator-control-btn.pause { border-color: #fab387; color: #fab387; } .M3Unator-control-btn.pause:hover { background: rgba(250, 179, 135, 0.1); } .M3Unator-control-btn.resume { border-color: #94e2d5; color: #94e2d5; } .M3Unator-control-btn.resume:hover { background: rgba(148, 226, 213, 0.1); } .M3Unator-control-btn.cancel { border-color: #f38ba8; color: #f38ba8; } .M3Unator-control-btn.cancel:hover { background: rgba(243, 139, 168, 0.1); } .M3Unator-control-btn svg { width: 14px; height: 14px; } .M3Unator-button { width: 100%; padding: 0 1rem; background: #f5c2e7; color: #11111b; border: none; border-radius: 6px; font-weight: 600; font-size: 0.875rem; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 0.375rem; height: 48px; min-height: 48px; line-height: 1; } .M3Unator-spinner { width: 20px; height: 20px; border: 2px solid rgba(17, 17, 27, 0.3); border-radius: 50%; border-top-color: #11111b; animation: spin 0.6s linear infinite; margin-right: 0; flex-shrink: 0; } .M3Unator-toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 100002; } .M3Unator-toast { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 12px; margin-top: 8px; font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-size: 14px; font-weight: 500; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); animation: toastIn 0.3s ease; background: #1e1e2e; border: 2px solid; } .M3Unator-toast.success { color: #a6e3a1; border-color: #a6e3a1; } .M3Unator-toast.error { color: #f38ba8; border-color: #f38ba8; } .M3Unator-toast.warning { color: #fab387; border-color: #fab387; } .M3Unator-toast.removing { animation: toastOut 0.3s ease forwards; } @keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } } @keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } } .M3Unator-toast svg { width: 20px; height: 20px; flex-shrink: 0; } .M3Unator-input-row { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; } .M3Unator-input-row .M3Unator-input-group { margin-bottom: 0; } .M3Unator-input-row .M3Unator-input-group:first-child { flex: 2; } .M3Unator-input-row .M3Unator-input-group:last-child { flex: 1; } .M3Unator-social { display: flex; gap: 8px; margin-right: 8px; } .M3Unator-social a { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #cdd6f4; background: rgba(205, 214, 244, 0.1); transition: all 0.2s ease; } .M3Unator-social a:hover { background: rgba(205, 214, 244, 0.2); transform: rotate(360deg); } .M3Unator-social svg { width: 18px; height: 18px; } .M3Unator-advanced-settings { margin-top: 1rem; padding: 1rem; background: rgba(30, 30, 46, 0.5); border: 1px solid #313244; border-radius: 8px; display: none; } .M3Unator-advanced-settings.active { display: block; animation: fadeIn 0.3s ease; } .M3Unator-advanced-toggle { width: 100%; padding: 0.75rem; background: #1e1e2e; border: 1px solid #313244; border-radius: 8px; color: #cdd6f4; font-size: 0.875rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: all 0.2s ease; } .M3Unator-advanced-toggle:hover { background: #313244; } .M3Unator-advanced-toggle svg { width: 16px; height: 16px; transition: transform 0.2s ease; } .M3Unator-advanced-toggle.active svg { transform: rotate(180deg); } .M3Unator-depth-slider { -webkit-appearance: none; width: 100%; height: 4px; border-radius: 2px; background: #313244; outline: none; margin: 1rem 0; } .M3Unator-depth-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #cba6f7; cursor: pointer; transition: all 0.2s ease; } .M3Unator-depth-slider::-webkit-slider-thumb:hover { transform: scale(1.2); } .M3Unator-depth-value { text-align: center; font-size: 0.875rem; color: #cdd6f4; margin-top: 0.5rem; } @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } } .M3Unator-depth-settings { margin-top: 0.75rem; margin-left: 1.75rem; padding: 0.75rem; background: rgba(30, 30, 46, 0.3); border-left: 2px solid #cba6f7; border-radius: 0 8px 8px 0; display: none; animation: slideDown 0.3s ease; } .M3Unator-depth-settings.active { display: block; } .M3Unator-depth-input { position: relative; display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; } .M3Unator-depth-input input[type="number"] { width: 64px; padding: 0.25rem 0.375rem; border: 1px solid #45475a; border-radius: 4px; background: rgba(30, 30, 46, 0.8); color: #cdd6f4; font-size: 0.875rem; text-align: center; margin: 0 0 0 0.5rem; } .M3Unator-depth-input input[type="number"]:focus { outline: none; border-color: #cba6f7; box-shadow: 0 0 0 2px rgba(203, 166, 247, 0.2); } .M3Unator-depth-input input[type="number"]::-webkit-inner-spin-button { opacity: 1; background: #313244; border-left: 1px solid #45475a; border-radius: 0 4px 4px 0; cursor: pointer; } .M3Unator-depth-toggle { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; background: #1e1e2e; border: 1px solid #45475a; border-radius: 6px; color: #cdd6f4; font-size: 0.875rem; cursor: pointer; transition: all 0.2s ease; } .M3Unator-depth-toggle:hover { background: #313244; border-color: #cba6f7; } .M3Unator-depth-toggle.active { background: rgba(203, 166, 247, 0.1); border-color: #cba6f7; color: #cba6f7; } @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } } .M3Unator-stats-bar { margin: 0.75rem 0; padding: 0.5rem; background: rgba(30, 30, 46, 0.5); border: 1px solid #313244; border-radius: 8px; display: none; } .M3Unator-stats-bar.active { display: block; } .M3Unator-stats { display: flex; align-items: center; justify-content: space-around; gap: 0.382rem; padding: 0.25rem; } .M3Unator-stat { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: #cdd6f4; cursor: help; min-width: 40px; justify-content: flex-start; padding: 0 0.25rem; position: relative; } .M3Unator-stat span { min-width: 16px; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.7rem; font-weight: 500; } .M3Unator-stat svg { opacity: 0.8; flex-shrink: 0; width: 14px; height: 14px; } .M3Unator-stat.video { color: #94e2d5; } .M3Unator-stat.audio { color: #89b4fa; } .M3Unator-stat.dir { color: #cba6f7; } .M3Unator-stat.error { color: #f38ba8; } .M3Unator-stat.depth { color: #a6e3a1; transition: color 0.3s ease; } .M3Unator-stat.depth[data-progress="high"] { color: #f38ba8; } .M3Unator-stat.depth[data-progress="medium"] { color: #fab387; } .M3Unator-stat.depth[data-progress="low"] { color: #f9e2af; } .M3Unator-stat:hover::after { content: attr(title); position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); padding: 0.5rem 0.75rem; background: rgba(30, 30, 46, 0.95); color: #cdd6f4; font-size: 0.875rem; white-space: nowrap; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); z-index: 1000; border: 1px solid #313244; text-align: center; backdrop-filter: blur(8px); pointer-events: none; } .M3Unator-spinner { width: 20px; height: 20px; border: 2px solid rgba(17, 17, 27, 0.3); border-radius: 50%; border-top-color: #11111b; animation: spin 0.6s linear infinite; margin-right: 0; flex-shrink: 0; } @keyframes spin { to { transform: rotate(360deg); } } .M3Unator-toast { animation: toastSlideUp 0.2s ease forwards; } .M3Unator-toast.removing { animation: toastSlideDown 0.2s ease forwards; } .M3Unator-popup { animation: slideUp 0.2s ease; } .M3Unator-stats-bar { animation: fadeIn 0.2s ease; } .M3Unator-log { transition: max-height 0.3s ease; } .M3Unator-log.collapsed { max-height: 0; overflow: hidden; } .M3Unator-log-toggle { width: 100%; padding: 0.75rem; background: #1e1e2e; border: none; color: #cdd6f4; display: flex; align-items: center; justify-content: center; gap: 0.75rem; cursor: pointer; transition: all 0.2s ease; font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; } .M3Unator-log-toggle:hover { background: rgba(30, 30, 46, 0.8); } .M3Unator-log-toggle svg { width: 20px; height: 20px; flex-shrink: 0; } .M3Unator-log-toggle.active svg { transform: rotate(180deg); } .M3Unator-toggle-container span svg .infinity-icon { opacity: 0.5; transition: opacity 0.2s ease; transform: scale(0.6) translateY(4px); transform-origin: center; stroke-width: 1.5; } .M3Unator-toggle-container input[type="checkbox"]:checked + span svg .infinity-icon { opacity: 1; } .M3Unator-depth-controls { background: rgba(30, 30, 46, 0.4); backdrop-filter: blur(8px); border: 1px solid #313244; border-radius: 8px; padding: 0.618rem; margin-top: 1rem; display: none; } .M3Unator-depth-controls.active { display: block; } .M3Unator-radio-group { display: flex; gap: 0.75rem; justify-content: center; background: rgba(30, 30, 46, 0.6); padding: 0.5rem; border-radius: 6px; } .M3Unator-radio { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; padding: 0.5rem; border-radius: 4px; transition: all 0.2s ease; background: transparent; border: 1px solid transparent; } .M3Unator-radio:hover { background: rgba(203, 166, 247, 0.1); } .M3Unator-radio input[type="radio"] { display: none; } .M3Unator-radio .radio-mark { width: 16px; height: 16px; border: 1.5px solid #45475a; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; flex-shrink: 0; background: rgba(30, 30, 46, 0.6); position: relative; } .M3Unator-radio input[type="radio"]:checked + .radio-mark { border-color: #cba6f7; background: rgba(203, 166, 247, 0.1); } .M3Unator-radio input[type="radio"]:checked + .radio-mark::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #cba6f7; position: absolute; } .M3Unator-radio .radio-label { color: #cdd6f4; font-size: 0.875rem; user-select: none; display: flex; align-items: center; gap: 0.5rem; } .M3Unator-depth-input { width: 64px; padding: 0.25rem 0.375rem; border: 1px solid #45475a; border-radius: 4px; background: rgba(30, 30, 46, 0.8); color: #cdd6f4; font-size: 0.875rem; text-align: center; transition: all 0.2s ease; -moz-appearance: textfield; margin-top: -1px; display: inline-flex; align-items: center; height: 28px; } .M3Unator-depth-input::-webkit-outer-spin-button, .M3Unator-depth-input::-webkit-inner-spin-button { -webkit-appearance: inner-spin-button; opacity: 1; background: #313244; border-left: 1px solid #45475a; border-radius: 0 4px 4px 0; cursor: pointer; height: 100%; position: absolute; right: 0; top: 0; } .M3Unator-depth-input:focus { outline: none; border-color: #cba6f7; box-shadow: 0 0 0 2px rgba(203, 166, 247, 0.2); } .M3Unator-depth-input:disabled { opacity: 0.5; cursor: not-allowed; background: rgba(30, 30, 46, 0.4); } .M3Unator-radio .radio-label { display: flex; align-items: center; gap: 0.5rem; color: #cdd6f4; font-size: 0.875rem; user-select: none; } .M3Unator-url-container { display: flex; align-items: center; background: rgba(30, 30, 46, 0.6); border: 1px solid #313244; border-radius: 6px; padding: 0.618rem; margin-bottom: 1rem; transition: all 0.2s ease; } .M3Unator-url-container:hover { border-color: #45475a; } .M3Unator-url-icon { color: #6c7086; margin-right: 0.618rem; flex-shrink: 0; } .M3Unator-url-input { flex: 1; background: transparent; border: none; color: #cdd6f4; font-size: 0.875rem; padding: 0; margin: 0; width: 100%; } .M3Unator-url-input:focus { outline: none; } .M3Unator-url-copy { background: transparent; border: none; color: #6c7086; padding: 0.382rem; margin-left: 0.618rem; cursor: pointer; border-radius: 4px; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; } .M3Unator-url-copy:hover { color: #cdd6f4; background: rgba(205, 214, 244, 0.1); } .M3Unator-url-copy.copied { color: #a6e3a1; animation: copyPulse 0.3s ease; } @keyframes copyPulse { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } } .M3Unator-toggle-group { display: flex; gap: 1.25rem; margin: 1.5rem 0; justify-content: center; background: rgba(30, 30, 46, 0.4); padding: 1.25rem; border-radius: 16px; backdrop-filter: blur(8px); } .M3Unator-toggle-container { position: relative; } .M3Unator-toggle-container span { width: 64px; height: 64px; background: #1e1e2e; border: 2px solid #45475a; border-radius: 16px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; justify-content: center; } .M3Unator-toggle-container input[type="checkbox"]:checked + span { background: rgba(203, 166, 247, 0.1); border-color: #cba6f7; box-shadow: 0 0 20px rgba(203, 166, 247, 0.2); transform: translateY(-2px); } .M3Unator-toggle-container span:hover { background: #313244; transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); } .M3Unator-toggle-container svg { width: 32px; height: 32px; opacity: 0.7; transition: all 0.3s ease; } .M3Unator-toggle-container input[type="checkbox"]:checked + span svg { opacity: 1; color: #cba6f7; filter: drop-shadow(0 0 8px rgba(203, 166, 247, 0.4)); } .M3Unator-progress { background: rgba(30, 30, 46, 0.6); border-radius: 12px; padding: 1rem; margin: 1rem 0; backdrop-filter: blur(8px); border: 1px solid rgba(203, 166, 247, 0.2); } .M3Unator-progress-text { color: #f5c2e7; font-weight: 600; text-align: center; margin-bottom: 0.5rem; font-size: 1.1rem; } .M3Unator-progress-spinner { width: 24px; height: 24px; border: 3px solid rgba(245, 194, 231, 0.1); border-top-color: #f5c2e7; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; } .M3Unator-controls { display: flex; gap: 0.75rem; margin: 0.75rem 0; justify-content: center; } .M3Unator-control-btn { display: none; padding: 0.75rem 1.5rem; border-radius: 12px; font-weight: 600; font-size: 0.95rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); align-items: center; gap: 0.75rem; min-width: 160px; justify-content: center; background: rgba(30, 30, 46, 0.6); backdrop-filter: blur(8px); width: 160px; } .M3Unator-control-btn.pause { background: rgba(250, 179, 135, 0.1); border: 2px solid #fab387; color: #fab387; } .M3Unator-control-btn.resume { background: rgba(148, 226, 213, 0.1); border: 2px solid #94e2d5; color: #94e2d5; } .M3Unator-control-btn.cancel { background: rgba(243, 139, 168, 0.1); border: 2px solid #f38ba8; color: #f38ba8; } .M3Unator-control-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); } .M3Unator-control-btn svg { width: 20px; height: 20px; } .M3Unator-layers-icon { width: 20px; height: 20px; margin-right: 0.5rem; } .M3Unator-input:-webkit-autofill, .M3Unator-input:-webkit-autofill:hover, .M3Unator-input:-webkit-autofill:focus, .M3Unator-input:-webkit-autofill:active { -webkit-text-fill-color: #cdd6f4 !important; -webkit-box-shadow: 0 0 0 30px #1e1e2e inset !important; box-shadow: 0 0 0 30px #1e1e2e inset !important; background-color: #1e1e2e !important; color: #cdd6f4 !important; caret-color: #cdd6f4 !important; transition: background-color 5000s ease-in-out 0s !important; text-decoration: none !important; -webkit-text-decoration: none !important; } .M3Unator-input:-moz-autofill, .M3Unator-input:-moz-autofill-preview { background-color: #1e1e2e !important; color: #cdd6f4 !important; text-decoration: none !important; } .M3Unator-input:-ms-input-placeholder { background-color: #1e1e2e !important; color: #cdd6f4 !important; text-decoration: none !important; } .M3Unator-log-container { margin: 0; } .M3Unator-log-toggle { width: 100%; padding: 0.5rem 0.75rem; background: rgba(203, 166, 247, 0.05); border: none; color: #cdd6f4; display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: all 0.2s ease; font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-size: 0.875rem; font-weight: 500; border-radius: 6px; } .M3Unator-log-toggle:hover { background: rgba(203, 166, 247, 0.1); } .M3Unator-log-toggle svg { width: 18px; height: 18px; color: #cba6f7; opacity: 0.8; transition: all 0.2s ease; margin-right: 0.5rem; } .M3Unator-log-toggle.active svg { transform: rotate(180deg); opacity: 1; } .M3Unator-log-counter { background: rgba(203, 166, 247, 0.1); color: #cba6f7; padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; min-width: 1.5rem; text-align: center; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; } .M3Unator-log-toggle:hover .M3Unator-log-counter { background: rgba(203, 166, 247, 0.15); } .M3Unator-log-toggle .toggle-text { display: flex; align-items: center; gap: 0.5rem; } .M3Unator-log { height: 0; max-height: 0; overflow: hidden; transition: all 0.3s ease; background: #11111b; padding: 0; border-top: none; margin: 0; } .M3Unator-log.expanded { height: auto; max-height: 300px; padding: 0.75rem; border-top: 1px solid #313244; overflow-y: auto; } .M3Unator-log-entry { padding: 0.25rem 0.5rem; border-bottom: 1px solid rgba(49, 50, 68, 0.5); font-size: 0.875rem; } .M3Unator-log-entry:last-child { border-bottom: none; } .M3Unator-log-time { color: #6c7086; margin-right: 0.5rem; } .M3Unator-log-entry.success { color: #94e2d5; } .M3Unator-log-entry.error { color: #f38ba8; } .M3Unator-log-entry.warning { color: #fab387; } .M3Unator-log-entry.info { color: #89b4fa; } .M3Unator-log-entry.final { color: #a6e3a1; font-weight: 500; } .M3Unator-log { margin-top: 0.75rem; max-height: calc(100vh - 70vh); font-size: 0.8125rem; line-height: 1.4; } .M3Unator-log-entry { padding: 0.25rem 0.5rem; border-radius: 4px; } .M3Unator-log-toggle { padding: 0.5rem 0.75rem; height: 36px; } .M3Unator-log-counter { padding: 0.125rem 0.375rem; font-size: 0.75rem; border-radius: 4px; } .M3Unator-log-time { font-size: 0.75rem; opacity: 0.7; margin-right: 0.5rem; } `); GM_addStyle(` .M3Unator-popup { position: fixed; background: #11111b; color: #cdd6f4; width: 100%; max-width: 480px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); overflow: hidden; animation: slideUp 0.3s ease; z-index: 9999; } .M3Unator-header { padding: 1rem 1.25rem; background: #1e1e2e; color: #cdd6f4; display: flex; align-items: center; justify-content: space-between; cursor: move; user-select: none; border-bottom: 1px solid #313244; } .M3Unator-container { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px); display: none; place-items: center; z-index: 9999; } `); GM_addStyle(` /* Info Modal Styles */ .info-modal { display: none; position: fixed; z-index: 100000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(30, 30, 46, 0.6); backdrop-filter: blur(8px); } .info-modal-content { background-color: #1e1e2e; color: #cdd6f4; margin: 15% auto; padding: 24px; border: 2px solid #45475a; width: 90%; max-width: 600px; border-radius: 12px; position: relative; z-index: 100001; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); } .info-close { position: absolute; right: 16px; top: 16px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; color: #6c7086; cursor: pointer; transition: color 0.2s ease; background: none; border: none; padding: 0; } .info-close:hover { color: #cba6f7; } .info-link { cursor: pointer; color: #6c7086; transition: color 0.2s ease; display: flex; align-items: center; justify-content: center; } .info-link:hover { color: #cba6f7; } .info-section { margin-bottom: 24px; } .info-section:last-child { margin-bottom: 0; } .info-section h3 { color: #cba6f7; margin-bottom: 12px; font-size: 1.1em; font-weight: 600; } .info-section p { color: #cdd6f4; line-height: 1.6; margin: 0; } .info-section strong { color: #89b4fa; font-weight: 600; } `); class PlaylistGenerator { constructor() { this.initialStats = { directories: { total: 0, depth: 0 }, files: { video: { total: 0, current: 0 }, audio: { total: 0, current: 0 } }, errors: { total: 0, skipped: 0 }, totalFiles: 0 }; this.domElements = {}; this.state = { isGenerating: false, isPaused: false, selectedFormat: 'm3u', includeVideo: false, includeAudio: false, maxEntries: 100000, timeoutMs: 5000, retryCount: 2, maxDepth: 0, maxSeenUrls: 5000, stats: { ...this.initialStats } }; this.sortOptions = { numeric: true, sensitivity: 'base' }; this.entries = []; this.seenUrls = new Set(); this.toastQueue = []; this.isProcessingToast = false; this.videoFormats = [ '.mp4', '.mkv', '.avi', '.webm', '.mov', '.flv', '.wmv', '.m4v', '.mpg', '.mpeg', '.3gp', '.vob', '.ts', '.mts', '.m2ts', '.divx', '.xvid', '.asf', '.ogv', '.rm', '.rmvb', '.wtv', '.qt', '.hevc', '.f4v', '.swf', '.vro', '.ogx', '.drc', '.gifv', '.mxf', '.roq', '.nsv' ]; this.audioFormats = [ '.mp3', '.m4a', '.wav', '.flac', '.aac', '.ogg', '.wma', '.opus', '.aiff', '.ape', '.mka', '.ac3', '.dts', '.m4b', '.m4p', '.m4r', '.mid', '.midi', '.mp2', '.mpa', '.mpc', '.ra', '.tta', '.voc', '.vox', '.amr', '.awb', '.dsf', '.dff', '.alac', '.wv', '.oga', '.sln', '.aif', '.pcm' ]; this.icons = { video: ``, audio: ``, folder: ``, info: ``, file: ``, download: ``, close: ``, pause: ``, resume: ``, cancel: ``, success: ``, error: ``, warning: ``, github: ``, twitter: ``, chevronDown: ``, layers: ``, logToggle: `` }; this.templates = { toggleButton: (id, title, icon, checked = false) => `