better little info but do not fail on imdbpro locked imdb pages
This commit is contained in:
parent
963d95ec0d
commit
f24a6ae4e7
1 changed files with 12 additions and 11 deletions
|
@ -8,7 +8,6 @@ import re, time
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from elementtree.ElementTree import parse, tostring
|
|
||||||
from BeautifulSoup import BeautifulSoup
|
from BeautifulSoup import BeautifulSoup
|
||||||
|
|
||||||
from google import google
|
from google import google
|
||||||
|
@ -412,16 +411,18 @@ class IMDb:
|
||||||
|
|
||||||
def parseReleaseinfo(self):
|
def parseReleaseinfo(self):
|
||||||
soup = BeautifulSoup(self.getReleaseinfo())
|
soup = BeautifulSoup(self.getReleaseinfo())
|
||||||
for row in soup('table',{'border': '0', 'cellpadding':'2'})[0]('tr'):
|
info = soup('table',{'border': '0', 'cellpadding':'2'})
|
||||||
d = row('td', {'align':'right'})
|
if info:
|
||||||
if d:
|
for row in info[0]('tr'):
|
||||||
try:
|
d = row('td', {'align':'right'})
|
||||||
possible_date = stripTags(str(d[0])).strip()
|
if d:
|
||||||
rdate = time.strptime(possible_date, "%d %B %Y")
|
try:
|
||||||
rdate = time.strftime('%Y-%m-%d', rdate)
|
possible_date = stripTags(str(d[0])).strip()
|
||||||
return rdate
|
rdate = time.strptime(possible_date, "%d %B %Y")
|
||||||
except:
|
rdate = time.strftime('%Y-%m-%d', rdate)
|
||||||
pass
|
return rdate
|
||||||
|
except:
|
||||||
|
pass
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def getBusiness(self, forcereload = False):
|
def getBusiness(self, forcereload = False):
|
||||||
|
|
Loading…
Reference in a new issue