Skip to content

Commit

Permalink
optimize: directly skip top post in parsing #47
Browse files Browse the repository at this point in the history
  • Loading branch information
nondanee committed Nov 23, 2019
1 parent c328207 commit 7cec7ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion weiboPicDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@ def get_resources(uid, video, interval, limit):
for card in cards:
if 'mblog' in card:
mblog = card['mblog']
if 'isTop' in mblog and mblog['isTop']: continue
mid = int(mblog['mid'])
mark = {'mid': mid, 'bid': mblog['bid'], 'date': parse_date(mblog['created_at']), 'text': mblog['text']}
amount += 1
if mid < limit[0] and not ('isTop' in mblog and mblog['isTop']): exceed = True
if mid < limit[0]: exceed = True
if mid < limit[0] or mid > limit[1]: continue
if 'pics' in mblog:
for index, pic in enumerate(mblog['pics'], 1):
Expand Down

0 comments on commit 7cec7ae

Please sign in to comment.