Avoid infinite loop when there are no feed items

main
Bob Mottram 2020-06-28 11:02:59 +01:00
parent cc0d3d34fa
commit d0c1546037
1 changed files with 7 additions and 5 deletions

View File

@ -164,11 +164,13 @@ def parseUserFeed(session, feedUrl: str, asHeader: {},
if nextUrl:
if isinstance(nextUrl, str):
userFeed = parseUserFeed(session, nextUrl, asHeader,
projectVersion, httpPrefix,
domain)
for item in userFeed:
yield item
if '?max_id=0' not in nextUrl:
userFeed = \
parseUserFeed(session, nextUrl, asHeader,
projectVersion, httpPrefix,
domain)
for item in userFeed:
yield item
elif isinstance(nextUrl, dict):
userFeed = nextUrl
if userFeed.get('orderedItems'):