KurtBestor / Hitomi-Downloader

:cake: Desktop utility to download images/videos/music/text from various websites, and more.
22.25k stars 2.05k forks source link

https://kr26.sogirl.co/ 수정. #3890

Open jongki99 opened 3 years ago

jongki99 commented 3 years ago

coding: utf8

title: AVSoGirl 사이트 추가

author: Kurt Bestor

import downloader from utils import Soup, try_n, Downloader, urljoin, get_print, Session, clean_url, clean_title, LazyUrl, get_ext, fix_title, lazy, get_imgsalready from translator import tr import page_selector import utils from time import sleep import clf2 import ree as re from ratelimit import limits, sleep_and_retry

@Downloader.register class Downloader_sogirl(Downloader): type = 'sogirl' URLS = ['.sogirl.co'] single = True

def read(self):
    # soup = downloader.read_soup(self.url)
    self.session, soup = get_soup(self.url)

    title = soup.find('meta', {'property': 'og:title'})['content'].strip()

    playlist = soup.find('div', class_='fp-playlist-external')
    srcs = []
    for a in playlist.findAll('a'):
        data = a.get('data-item')
        if not data:
            continue
        data = json.loads(data)
        for src in data['sources']:
            if src.get('fv_title'): # Ad
                continue
            srcs.append(src['src'])

    url_video = srcs[0]
    self.urls.append(url_video)
    self.filenames[url_video] = '{}{}'.format(clean_title(title), get_ext(url_video))
    self.referer = self.url

    self.title = title

@sleep_and_retry @limits(1, 10) def getsoup(url, session=None): if session is None: session = Session() res = clf2.solve(url, session=session) print = getprint(None) print('read start xxx') print('res = {}'.format(res)) soup = Soup(res['html']) print('soup = {}'.format(soup))

return session, soup

messageBox(u'{}: AVSogirl'.format(tr_(u'사이트를 추가했습니다')))

KurtBestor commented 3 years ago

clf2.solve 만 추가하셨고 https://github.com/KurtBestor/Hitomi-Downloader/issues/3393 이거 다운로드 안 되네요.

jongki99 commented 3 years ago

DRM 걸려 있는 영상은 원래 안되었던 걸로 알고 있었는데... ( 수정해서 되었던가요? 전 안되길래 자막 있는 건 DRM 이라 안되는 걸로 알고 있었네요 ) 도메인 새로 바뀌면서 다른 것들도 안 되길래 올렸습니다.. 뭐 기다리면 알아서 올리셨겠지만... 저처럼 성격 급한 사람은 혹시 필요할까 해서 올렸네요.

phthon 은 초짜라 잘 안되서 이것저것 복붙해서 넣었네요.

hjsg1010 commented 2 years ago

선생님, sogirl주소가 바뀌어서 아래와 같이 코드수정했는데 안되는데 혹시 방법 아실까요?

#coding: utf8
#title: AVSoGirl 사이트 추가
#author: Kurt Bestor

import downloader
from utils import Downloader, get_ext
import json
from translator import tr_

@Downloader.register
class Downloader_sogirl(Downloader):
    type = 'sogirl'
    URLS = ['.sogirl.so']
    single = True

    def read(self):
        soup = downloader.read_soup(self.url)

        title = soup.find('meta', {'property': 'og:title'})['content'].strip()

        playlist = soup.find('div', class_='fp-playlist-external')
        srcs = []
        for a in playlist.findAll('a'):
            data = a.get('data-item')
            if not data:
                continue
            data = json.loads(data)
            for src in data['sources']:
                if src.get('fv_title'): # Ad
                    continue
                srcs.append(src['src'])

        url_video = srcs[0]
        self.urls.append(url_video)
        self.filenames[url_video] = '{}{}'.format(clean_title(title), get_ext(url_video))
        self.referer = self.url

        self.title = title

messageBox(u'{}: AVSogirl'.format(tr_(u'사이트를 추가했습니다')))

제가 시도한 사이트는 https://kr29.sogirl.so/mide-991-%ec%95%bc%ea%b8%b0-%eb%82%98%eb%82%98-%ec%9c%a0%eb%aa%a8%ec%9e%90%eb%a7%89-hd/ 입니다.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.