Download-18--sanskari-bahu-f-cked--2022--unrated-niksindian-short-film-720p-web-dl---vegamovies -
def search_videos(self, query): self.cursor.execute(''' SELECT * FROM videos WHERE title LIKE ? OR year LIKE ? OR rating LIKE ? OR type LIKE ? OR resolution LIKE ? OR source LIKE ? ''', (f'%{query}%', f'%{query}%', f'%{query}%', f'%{query}%', f'%{query}%', f'%{query}%')) return self.cursor.fetchall()
def add_video(self, metadata): self.cursor.execute(''' INSERT INTO videos VALUES (?, ?, ?, ?, ?, ?) ''', ( metadata['title'], metadata['year'], metadata['rating'], metadata['type'], metadata['resolution'], metadata['source'] )) self.conn.commit() def search_videos(self, query): self
def extract_metadata(filename): # Assuming the filename format: "Title-Year-Rating-Type-Resolution-Source" pattern = r"(.*)--(\d{4})--(.*)--(.*)--(\d{4}p)--(.*)" match = re.match(pattern, filename) if match: return { "title": match.group(1), "year": match.group(2), "rating": match.group(3), "type": match.group(4), "resolution": match.group(5), "source": match.group(6) } else: return None OR type LIKE
import sqlite3
import re
# Example usage filename = "Download-18--Sanskari-Bahu-F-cked--2022--UNRATED-NiksIndian-Short-Film-720p-WEB-DL---VegaMovies" metadata = extract_metadata(filename) print(metadata) For simplicity, we'll use a basic SQLite database to store video metadata. def search_videos(self, query): self