escape strings
This commit is contained in:
parent
ae10c5c9b9
commit
41edea1862
20 changed files with 74 additions and 74 deletions
|
|
@ -46,7 +46,7 @@ def video_url(youtubeId, format='mp4', timeout=cache_timeout):
|
|||
def get_video_info(id):
|
||||
eurl = get_url(id)
|
||||
data = read_url(eurl).decode('utf-8')
|
||||
t = re.compile('\W[\'"]?t[\'"]?: ?[\'"](.+?)[\'"]').findall(data)
|
||||
t = re.compile(r'\W[\'"]?t[\'"]?: ?[\'"](.+?)[\'"]').findall(data)
|
||||
if t:
|
||||
t = t[0]
|
||||
else:
|
||||
|
|
@ -162,7 +162,7 @@ def videos(id, format=''):
|
|||
def playlist(url):
|
||||
data = read_url(url).decode('utf-8')
|
||||
items = []
|
||||
for i in list(set(re.compile('<a href="(/watch\?v=.*?)" title="(.*?)" ').findall(data))):
|
||||
for i in list(set(re.compile(r'<a href="(/watch\?v=.*?)" title="(.*?)" ').findall(data))):
|
||||
items.append({
|
||||
'title': i[1],
|
||||
'url': 'http://www.youtube.com' + i[0].split('&')[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue