Commit afbea153 authored by minamotorin's avatar minamotorin Committed by GitHub

Update feed.py

Fix bug
parent a6ab848d
...@@ -55,15 +55,15 @@ def MobileFav(response): ...@@ -55,15 +55,15 @@ def MobileFav(response):
def _get_cursor(response): def _get_cursor(response):
try: # case 1 if isinstance(response, dict): # case 1
try:
next_cursor = response['timeline']['instructions'][0]['addEntries']['entries'][-1]['content'][ next_cursor = response['timeline']['instructions'][0]['addEntries']['entries'][-1]['content'][
'operation']['cursor']['value'] 'operation']['cursor']['value']
except KeyError: except KeyError:
try: # case 1
# this is needed because after the first request location of cursor is changed # this is needed because after the first request location of cursor is changed
next_cursor = response['timeline']['instructions'][-1]['replaceEntry']['entry']['content']['operation'][ next_cursor = response['timeline']['instructions'][-1]['replaceEntry']['entry']['content']['operation'][
'cursor']['value'] 'cursor']['value']
except KeyError: # case 2 else: # case 2
next_cursor = response[-1]['content']['value'] next_cursor = response[-1]['content']['value']
return next_cursor return next_cursor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment