net/cache readUrl->read_url / Unicode -> unicode=True
format replace all CammelCase with under_score
This commit is contained in:
parent
c1d0fc6242
commit
2de989e188
33 changed files with 243 additions and 254 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import re
|
||||
|
||||
from ox.cache import readUrlUnicode
|
||||
from ox.cache import read_url
|
||||
from ox import findRe
|
||||
|
||||
def getData(id):
|
||||
|
|
@ -24,7 +24,7 @@ def getId(url):
|
|||
|
||||
def getPostersByUrl(url, group=True, timeout=-1):
|
||||
posters = []
|
||||
html = readUrlUnicode(url, timeout=timeout)
|
||||
html = read_url(url, timeout=timeout, unicode=True)
|
||||
if url in html:
|
||||
if group:
|
||||
results = re.compile('<a href="(http://www.movieposterdb.com/group/.+?)\??">', re.DOTALL).findall(html)
|
||||
|
|
@ -32,7 +32,7 @@ def getPostersByUrl(url, group=True, timeout=-1):
|
|||
posters += getPostersByUrl(result, False)
|
||||
results = re.compile('<a href="(http://www.movieposterdb.com/poster/.+?)">', re.DOTALL).findall(html)
|
||||
for result in results:
|
||||
html = readUrlUnicode(result, timeout=timeout)
|
||||
html = read_url(result, timeout=timeout, unicode=True)
|
||||
posters.append(findRe(html, '"(http://www.movieposterdb.com/posters/.+?\.jpg)"'))
|
||||
return posters
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue