duwing commited on
Commit
26dabec
·
verified ·
1 Parent(s): 6bc398e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -111,7 +111,10 @@ def get_comments(news_url):
111
  return title.text.strip(), article.text.strip(), processing_data(json_data['result']['commentList'])
112
  else if ('insta' in news_url):
113
  list = news_url.split('/')
114
- pid = list[-2] + list[-1]
 
 
 
115
  L = instaloader.Instaloader()
116
  post = Post.from_shortcode(L.context, pid)
117
 
 
111
  return title.text.strip(), article.text.strip(), processing_data(json_data['result']['commentList'])
112
  else if ('insta' in news_url):
113
  list = news_url.split('/')
114
+ if list[-1]:
115
+ pid = list[-1]
116
+ else:
117
+ pid = list[-2]
118
  L = instaloader.Instaloader()
119
  post = Post.from_shortcode(L.context, pid)
120