Fixes some twitter profiles crashing
This was caused by line 874, when a tweet was not available
This commit is contained in:
parent
0829838063
commit
3dbb76d6a3
@ -397,7 +397,7 @@ def get_best_urls(urls):
|
|||||||
for url in urls:
|
for url in urls:
|
||||||
for f in best_formats:
|
for f in best_formats:
|
||||||
if url['format_id'] == f:
|
if url['format_id'] == f:
|
||||||
best_urls.append(url)
|
best_urls.append(url)
|
||||||
return best_urls
|
return best_urls
|
||||||
|
|
||||||
def get_live_urls(urls):
|
def get_live_urls(urls):
|
||||||
@ -432,11 +432,10 @@ def watch():
|
|||||||
|
|
||||||
if info['video']['isUpcoming']:
|
if info['video']['isUpcoming']:
|
||||||
vid_urls=[]
|
vid_urls=[]
|
||||||
|
elif info['video']['isLive']:
|
||||||
|
vid_urls = get_live_urls(info['video']['urls'])
|
||||||
else:
|
else:
|
||||||
vid_urls = get_best_urls(info['video']['urls'])
|
vid_urls = get_best_urls(info['video']['urls'])
|
||||||
|
|
||||||
if info['video']['isLive']:
|
|
||||||
vid_urls = get_live_urls(info['video']['urls'])
|
|
||||||
|
|
||||||
video={
|
video={
|
||||||
'title':info['video']['title'],
|
'title':info['video']['title'],
|
||||||
@ -872,7 +871,10 @@ def getPosts(account):
|
|||||||
if quote.find('a', attrs={'class':'still-image'}):
|
if quote.find('a', attrs={'class':'still-image'}):
|
||||||
newPost.replyAttachedImg = NITTERINSTANCE+quote.find('a', attrs={'class':'still-image'})['href'][1:]
|
newPost.replyAttachedImg = NITTERINSTANCE+quote.find('a', attrs={'class':'still-image'})['href'][1:]
|
||||||
|
|
||||||
newPost.replyingUser=quote.find('a', attrs={'class':'username'}).text
|
try:
|
||||||
|
newPost.replyingUser=quote.find('a', attrs={'class':'username'}).text
|
||||||
|
except:
|
||||||
|
newPost.replyingUser="Unavailable"
|
||||||
post.find('div', attrs={'class':'quote'}).decompose()
|
post.find('div', attrs={'class':'quote'}).decompose()
|
||||||
|
|
||||||
if post.find('div', attrs={'class':'attachments'}):
|
if post.find('div', attrs={'class':'attachments'}):
|
||||||
|
Reference in New Issue
Block a user