escape strings
This commit is contained in:
parent
ae10c5c9b9
commit
41edea1862
20 changed files with 74 additions and 74 deletions
|
|
@ -97,8 +97,8 @@ def parse_movies(xml, title):
|
|||
strings.pop()
|
||||
for string in strings:
|
||||
list.append({
|
||||
'id': find_re(string, 'viewMovie\?id=(.*?)&'),
|
||||
'title': find_re(string, '<SetFontStyle normalStyle="outlineTextFontStyle"><b>(.*?)</b></SetFontStyle>')
|
||||
'id': find_re(string, r'viewMovie\?id=(.*?)&'),
|
||||
'title': find_re(string, r'<SetFontStyle normalStyle="outlineTextFontStyle"><b>(.*?)</b></SetFontStyle>')
|
||||
})
|
||||
return list
|
||||
except:
|
||||
|
|
@ -115,7 +115,7 @@ class ItunesAlbum:
|
|||
def get_id(self):
|
||||
url = compose_url('advancedSearch', {'media': 'music', 'title': self.title, 'artist': self.artist})
|
||||
xml = read_url(url, headers = ITUNES_HEADERS)
|
||||
id = find_re(xml, 'viewAlbum\?id=(.*?)&')
|
||||
id = find_re(xml, r'viewAlbum\?id=(.*?)&')
|
||||
return id
|
||||
|
||||
def get_data(self):
|
||||
|
|
@ -146,7 +146,7 @@ class ItunesMovie:
|
|||
def get_id(self):
|
||||
url = compose_url('advancedSearch', {'media': 'movie', 'title': self.title, 'director': self.director})
|
||||
xml = read_url(url, headers = ITUNES_HEADERS)
|
||||
id = find_re(xml, 'viewMovie\?id=(.*?)&')
|
||||
id = find_re(xml, r'viewMovie\?id=(.*?)&')
|
||||
return id
|
||||
|
||||
def get_data(self):
|
||||
|
|
@ -170,7 +170,7 @@ class ItunesMovie:
|
|||
data['releaseDate'] = find_re(xml, 'Released(.*?)<')
|
||||
data['runTime'] = find_re(xml, 'Run Time:(.*?)<')
|
||||
data['screenwriters'] = parse_cast(xml, 'screenwriters')
|
||||
data['soundtrackId'] = find_re(xml, 'viewAlbum\?id=(.*?)&')
|
||||
data['soundtrackId'] = find_re(xml, r'viewAlbum\?id=(.*?)&')
|
||||
data['trailerUrl'] = find_re(xml, 'autoplay="." url="(.*?)"')
|
||||
return data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue