Beispiel #1
0
# =========website========
from avdc.WebCrawler import airav
from avdc.WebCrawler import avsox
from avdc.WebCrawler import fanza
from avdc.WebCrawler import fc2
from avdc.WebCrawler import jav321
from avdc.WebCrawler import javbus
from avdc.WebCrawler import javdb
from avdc.WebCrawler import mgstage
from avdc.WebCrawler import xcity
from avdc.WebCrawler import javlib
from avdc.WebCrawler import dlsite
from avdc.WebCrawler import metajavlib

logger = get_logger('avdc.core')


def escape_path(path, escape_literals: str):  # Remove escape literals
    backslash = '\\'
    for literal in escape_literals:
        path = path.replace(backslash + literal, '')
    return path


def moveFailedFolder(filepath, failed_folder):
    config = Config.get_instance()
    if config.failed_move():
        root_path = str(pathlib.Path(filepath).parent)
        file_name = pathlib.Path(filepath).name
        destination_path = root_path + '/' + failed_folder + '/'
Beispiel #2
0
import re
from avdc.util.logging_config import config_logging, get_logger
from lxml import etree
import json
from avdc.ADC_function import *
from avdc.model.movie import Movie
# import sys
# import io
# sys.stdout = io.TextIOWrapper(sys.stdout.buffer, errors = 'replace', line_buffering = True)

logger = get_logger(__name__)

def getTitle(a):
    html = etree.fromstring(a, etree.HTMLParser())
    result = html.xpath("/html/body/section/div/h2/strong/text()")[0]
    return result

def getActor(a) -> list[str]:  # //*[@id="center_column"]/div[2]/div[1]/div/table/tbody/tr[1]/td/text()
    html = etree.fromstring(a, etree.HTMLParser())  # //table/tr[1]/td[1]/text()
    result = html.xpath('//strong[contains(text(),"演員")]/../span/text()|'
                        '//strong[contains(text(),"演員")]/../span/a/text()')
    result = [i.strip() for i in result]
    result = [i for i in result if i and i not in [',', 'N/A']]
    return result

def getaphoto(url):
    html_page = get_html(url)
    img_prether = re.compile(r'<span class\=\"avatar\" style\=\"background\-image\: url\((.*?)\)')
    img_url = img_prether.findall(html_page)
    if img_url:
        return img_url[0]
Beispiel #3
0
import sys
import time
from collections import defaultdict
from pathlib import Path

from avdc.ADC_function import get_html
from avdc.config import Config
from avdc.core import core_main
from avdc.number_parser import get_number
from avdc.util.file_mgmt import (create_success_failed_folder, dir_picker,
                                 rm_empty_success_failed_folder)
from avdc.util.logging_config import config_logging, get_logger
from avdc.util.tag_processor import debug_unknown_tags


logger = get_logger('avdc.main')


def check_update(local_version):
    try:
        data = json.loads(
            get_html(
                "https://api.github.com/repos/yoshiko2/AV_Data_Capture/releases/latest"
            ))
    except:
        print("[-]Failed to update! Please check new version manually:")
        print("[-] https://github.com/yoshiko2/AV_Data_Capture/releases")
        print("[*]======================================================")
        return

    remote = int(data["tag_name"].replace(".",""))