fixing a bug in itunes.py
This commit is contained in:
parent
b34403d15e
commit
209e754d35
1 changed files with 13 additions and 9 deletions
22
ox/itunes.py
22
ox/itunes.py
|
@ -88,14 +88,17 @@ def parseCast(xml, title):
|
||||||
|
|
||||||
def parseMovies(xml, title):
|
def parseMovies(xml, title):
|
||||||
list = []
|
list = []
|
||||||
strings = findRe(xml, '<SetFontStyle normalStyle="outlineTitleFontStyle"><b>%s(.*?)</Test>' % title[:-1].upper()).split('</GotoURL>')
|
try:
|
||||||
strings.pop()
|
strings = findRe(xml, '<SetFontStyle normalStyle="outlineTitleFontStyle"><b>%s(.*?)</Test>' % title[:-1].upper()).split('</GotoURL>')
|
||||||
for string in strings:
|
strings.pop()
|
||||||
list.append({
|
for string in strings:
|
||||||
'id': findRe(string, 'viewMovie\?id=(.*?)&'),
|
list.append({
|
||||||
'title': findRe(string, '<SetFontStyle normalStyle="outlineTextFontStyle"><b>(.*?)</b></SetFontStyle>')
|
'id': findRe(string, 'viewMovie\?id=(.*?)&'),
|
||||||
})
|
'title': findRe(string, '<SetFontStyle normalStyle="outlineTextFontStyle"><b>(.*?)</b></SetFontStyle>')
|
||||||
return list
|
})
|
||||||
|
return list
|
||||||
|
except:
|
||||||
|
return list
|
||||||
|
|
||||||
class ItunesAlbum:
|
class ItunesAlbum:
|
||||||
def __init__(self, id = '', title = '', artist = ''):
|
def __init__(self, id = '', title = '', artist = ''):
|
||||||
|
@ -176,4 +179,5 @@ if __name__ == '__main__':
|
||||||
for v in data['relatedMovies']:
|
for v in data['relatedMovies']:
|
||||||
data = ItunesMovie(id = v['id']).getData()
|
data = ItunesMovie(id = v['id']).getData()
|
||||||
print simplejson.dumps(data, sort_keys = True, indent = 4)
|
print simplejson.dumps(data, sort_keys = True, indent = 4)
|
||||||
# print test.getData()
|
data = ItunesMovie(id='272960052').getData()
|
||||||
|
print simplejson.dumps(data, sort_keys = True, indent = 4)
|
||||||
|
|
Loading…
Reference in a new issue