The Studio S01 1080p Web-dl May 2026
const isValid = !!(title && (season
I'll provide a implementation, but the logic can be adapted to Python, C#, etc. Feature: Media Filename Parser Goal Extract title , season , quality , and source from a string like "the studio s01 1080p web-dl" . Output Example "original": "the studio s01 1080p web-dl", "title": "The Studio", "season": 1, "quality": "1080p", "source": "web-dl", "isValid": true the studio s01 1080p web-dl
static parse(filename: string): MediaInfo $this.SOURCES.join(')\\s*`, 'gi' ); title = title.replace(removePattern, '').trim(); // Capitalize words title = title.replace(/\b\w/g, c => c.toUpperCase()); const isValid =
// Output: "The Studio S01 1080p web-dl" import re class MediaParser: QUALITIES = ['1080p', '720p', '4k', '2160p'] SOURCES = ['web-dl', 'webrip', 'bluray', 'hdtv', 'dvd'] "title": "The Studio"
interface MediaInfo null; source: string class MediaFilenameParser private static readonly QUALITIES = ['1080p', '720p', '4k', '2160p']; private static readonly SOURCES = ['web-dl', 'webrip', 'bluray', 'hdtv', 'dvd'];
// Example usage const result = MediaFilenameParser.parse("the studio s01 1080p web-dl"); console.log(result); If you want to normalize filenames into a consistent format:
function toStandardFormat(info: MediaInfo): string const parts = [info.title]; if (info.season !== null) parts.push(`S$info.season.toString().padStart(2, '0')`); if (info.quality) parts.push(info.quality); if (info.source) parts.push(info.source); return parts.join(' ');