def main(): mongo_client = create_mongodb_client() minio_client = create_s3_client() resman_client = create_resman_client() migrate_t66y_images(mongo_client, minio_client, resman_client) migrate_sex8_images(mongo_client, minio_client, resman_client) migrate_sex8_videos(mongo_client, minio_client, resman_client) migrate_sex8_novels(mongo_client, resman_client)
import random from typing import Iterable from urllib.parse import urlparse, parse_qs import pymongo from ghs.channels.base import BaseChannel, PushContent from ghs.utils.storage import create_mongodb_client, create_s3_client, bucket_name s3_client = create_s3_client() mongodb_client = create_mongodb_client() collection = mongodb_client.get_database("resman").get_collection("spider_jav") def process_magnet_uri(magnet_uri: str): elements = [] for k, vs in parse_qs(urlparse(magnet_uri).query).items(): if k != "dn": for v in vs: elements.append(f"{k}={v}") return "magnet:?{}".format("&".join(elements)) class JAVChannel(BaseChannel): def __init__(self, category: str, category_display: str, candidate_count: int = 5): self.candidate_count = candidate_count self.category_display = category_display self.category = category