Merge pull request #122 from jnozsc/fix-fanza-hinban-issue
2.7 Update (future)
This commit is contained in:
commit
d647ddfe07
14
fanza.py
14
fanza.py
@ -82,7 +82,15 @@ def main(number):
|
|||||||
if '404 Not Found' in htmlcode:
|
if '404 Not Found' in htmlcode:
|
||||||
htmlcode=get_html('https://www.dmm.co.jp/mono/dvd/-/detail/=/cid='+number)
|
htmlcode=get_html('https://www.dmm.co.jp/mono/dvd/-/detail/=/cid='+number)
|
||||||
url = 'https://www.dmm.co.jp/mono/dvd/-/detail/=/cid='+number
|
url = 'https://www.dmm.co.jp/mono/dvd/-/detail/=/cid='+number
|
||||||
|
if '404 Not Found' in htmlcode:
|
||||||
|
# neither digital nor mono is available
|
||||||
|
return json.dumps({'title': '',})
|
||||||
try:
|
try:
|
||||||
|
# for some old page, the input number does not match the page
|
||||||
|
# for example, the url will be cid=test012
|
||||||
|
# but the hinban on the page is test00012
|
||||||
|
# so get the hinban first, and then pass it to following functions
|
||||||
|
number = getNum(htmlcode)
|
||||||
dic = {
|
dic = {
|
||||||
'title': getTitle(htmlcode).strip(getActor(htmlcode)),
|
'title': getTitle(htmlcode).strip(getActor(htmlcode)),
|
||||||
'studio': getStudio(htmlcode),
|
'studio': getStudio(htmlcode),
|
||||||
@ -91,15 +99,15 @@ def main(number):
|
|||||||
'director': getDirector(htmlcode),
|
'director': getDirector(htmlcode),
|
||||||
'actor': getActor(htmlcode),
|
'actor': getActor(htmlcode),
|
||||||
'release': getRelease(htmlcode),
|
'release': getRelease(htmlcode),
|
||||||
'number': getNum(htmlcode),
|
'number': number,
|
||||||
'cover': getCover(htmlcode,number),
|
'cover': getCover(htmlcode, number),
|
||||||
'imagecut': 1,
|
'imagecut': 1,
|
||||||
'tag': getTag(htmlcode),
|
'tag': getTag(htmlcode),
|
||||||
'label':getLabel(htmlcode),
|
'label':getLabel(htmlcode),
|
||||||
'year': getYear(getRelease(htmlcode)), # str(re.search('\d{4}',getRelease(a)).group()),
|
'year': getYear(getRelease(htmlcode)), # str(re.search('\d{4}',getRelease(a)).group()),
|
||||||
'actor_photo': '',
|
'actor_photo': '',
|
||||||
'website': url,
|
'website': url,
|
||||||
'source': 'siro.py',
|
'source': 'fanza.py',
|
||||||
}
|
}
|
||||||
except :
|
except :
|
||||||
dic = {
|
dic = {
|
||||||
|
Loading…
Reference in New Issue
Block a user