Merge branch 'yoshiko2:master' into master
This commit is contained in:
@@ -56,7 +56,8 @@ def get_data_from_json(file_number, oCC, specified_source, specified_url):
|
|||||||
json_data = search(file_number, sources, proxies=proxies, verify=cacert,
|
json_data = search(file_number, sources, proxies=proxies, verify=cacert,
|
||||||
dbsite=javdb_site, dbcookies=javdb_cookies,
|
dbsite=javdb_site, dbcookies=javdb_cookies,
|
||||||
morestoryline=conf.is_storyline(),
|
morestoryline=conf.is_storyline(),
|
||||||
specifiedSource=specified_source, specifiedUrl=specified_url)
|
specifiedSource=specified_source, specifiedUrl=specified_url,
|
||||||
|
debug = conf.debug())
|
||||||
# Return if data not found in all sources
|
# Return if data not found in all sources
|
||||||
if not json_data:
|
if not json_data:
|
||||||
print('[-]Movie Number not found!')
|
print('[-]Movie Number not found!')
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import config
|
|
||||||
from .airav import Airav
|
from .airav import Airav
|
||||||
from .carib import Carib
|
from .carib import Carib
|
||||||
from .dlsite import Dlsite
|
from .dlsite import Dlsite
|
||||||
@@ -25,9 +24,7 @@ from .tmdb import Tmdb
|
|||||||
from .imdb import Imdb
|
from .imdb import Imdb
|
||||||
|
|
||||||
|
|
||||||
def search(number, sources: str=None, proxies=None, verify=None, type='adult',
|
def search(number, sources: str=None, **kwargs):
|
||||||
specifiedSource=None, specifiedUrl=None,
|
|
||||||
dbcookies=None, dbsite=None, morestoryline=False):
|
|
||||||
""" 根据`番号/电影`名搜索信息
|
""" 根据`番号/电影`名搜索信息
|
||||||
|
|
||||||
:param number: number/name depends on type
|
:param number: number/name depends on type
|
||||||
@@ -35,9 +32,7 @@ def search(number, sources: str=None, proxies=None, verify=None, type='adult',
|
|||||||
:param type: `adult`, `general`
|
:param type: `adult`, `general`
|
||||||
"""
|
"""
|
||||||
sc = Scraping()
|
sc = Scraping()
|
||||||
return sc.search(number, sources, proxies=proxies, verify=verify, type=type,
|
return sc.search(number, sources, **kwargs)
|
||||||
specifiedSource=specifiedSource, specifiedUrl=specifiedUrl,
|
|
||||||
dbcookies=dbcookies, dbsite=dbsite, morestoryline=morestoryline)
|
|
||||||
|
|
||||||
|
|
||||||
def getSupportedSources(tag='adult'):
|
def getSupportedSources(tag='adult'):
|
||||||
@@ -83,6 +78,8 @@ class Scraping():
|
|||||||
'imdb': Imdb().scrape,
|
'imdb': Imdb().scrape,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug = False
|
||||||
|
|
||||||
proxies = None
|
proxies = None
|
||||||
verify = None
|
verify = None
|
||||||
specifiedSource = None
|
specifiedSource = None
|
||||||
@@ -95,7 +92,9 @@ class Scraping():
|
|||||||
|
|
||||||
def search(self, number, sources=None, proxies=None, verify=None, type='adult',
|
def search(self, number, sources=None, proxies=None, verify=None, type='adult',
|
||||||
specifiedSource=None, specifiedUrl=None,
|
specifiedSource=None, specifiedUrl=None,
|
||||||
dbcookies=None, dbsite=None, morestoryline=False):
|
dbcookies=None, dbsite=None, morestoryline=False,
|
||||||
|
debug=False):
|
||||||
|
self.debug = debug
|
||||||
self.proxies = proxies
|
self.proxies = proxies
|
||||||
self.verify = verify
|
self.verify = verify
|
||||||
self.specifiedSource = specifiedSource
|
self.specifiedSource = specifiedSource
|
||||||
@@ -119,7 +118,7 @@ class Scraping():
|
|||||||
json_data = {}
|
json_data = {}
|
||||||
for source in sources:
|
for source in sources:
|
||||||
try:
|
try:
|
||||||
if config.getInstance().debug():
|
if self.debug:
|
||||||
print('[+]select', source)
|
print('[+]select', source)
|
||||||
try:
|
try:
|
||||||
data = self.general_func_mapping[source](name, self)
|
data = self.general_func_mapping[source](name, self)
|
||||||
@@ -152,7 +151,7 @@ class Scraping():
|
|||||||
json_data = {}
|
json_data = {}
|
||||||
for source in sources:
|
for source in sources:
|
||||||
try:
|
try:
|
||||||
if config.getInstance().debug():
|
if self.debug:
|
||||||
print('[+]select', source)
|
print('[+]select', source)
|
||||||
try:
|
try:
|
||||||
data = self.adult_func_mapping[source](number, self)
|
data = self.adult_func_mapping[source](number, self)
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ class wwwGetchu(Parser):
|
|||||||
idn = re.findall('\d+',number)[0]
|
idn = re.findall('\d+',number)[0]
|
||||||
return "http://www.getchu.com/soft.phtml?id=" + idn
|
return "http://www.getchu.com/soft.phtml?id=" + idn
|
||||||
else:
|
else:
|
||||||
self.number = quote(number, encoding="euc_jp")
|
queryUrl = self.GETCHU_WWW_SEARCH_URL.replace("_WORD_", quote(number, encoding="euc_jp"))
|
||||||
queryUrl = self.GETCHU_WWW_SEARCH_URL.replace("_WORD_", self.number)
|
|
||||||
# NOTE dont know why will try 2 times
|
# NOTE dont know why will try 2 times
|
||||||
retry = 2
|
retry = 2
|
||||||
for i in range(retry):
|
for i in range(retry):
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ class Parser:
|
|||||||
expr_userrating = ''
|
expr_userrating = ''
|
||||||
expr_uservotes = ''
|
expr_uservotes = ''
|
||||||
|
|
||||||
def __init__(self):
|
def init(self):
|
||||||
|
""" 初始化参数
|
||||||
|
"""
|
||||||
# 推荐剪切poster封面:
|
# 推荐剪切poster封面:
|
||||||
# `0` 复制cover
|
# `0` 复制cover
|
||||||
# `1` 裁剪cover
|
# `1` 裁剪cover
|
||||||
@@ -63,7 +65,7 @@ class Parser:
|
|||||||
""" 刮削番号
|
""" 刮削番号
|
||||||
"""
|
"""
|
||||||
# 每次调用,初始化参数
|
# 每次调用,初始化参数
|
||||||
self.__init__()
|
self.init()
|
||||||
self.updateCore(core)
|
self.updateCore(core)
|
||||||
result = self.search(number)
|
result = self.search(number)
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user