import re
import os
import json
import time
import csv
from urllib.parse import urlparse
import logging


# 去掉 https://www.javdb.com/makers/16w?f=download 后面的参数
def remove_url_query(url: str) -> str:
    try:
        parsed_url = urlparse(url)
        clean_url = f"{parsed_url.scheme}://{parsed_url.netloc}{parsed_url.path}"
        return clean_url
    except Exception as e:
        print(f"解析 URL 失败: {e}")
        return url
