duwing commited on
Commit
9c72e61
·
verified ·
1 Parent(s): 6bd3528

Update app.py

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