@@ -223,7 +223,7 @@ def _extract_rehydration_data_user(self, profile_url, additional_keys=()):
223223 data = data ["webapp.user-detail" ]
224224 if not self ._check_status_code (data , profile_url , "profile" ):
225225 raise exception .ExtractionError (
226- "%s : could not extract rehydration data", profile_url )
226+ f" { profile_url } : could not extract rehydration data" )
227227 try :
228228 for key in additional_keys :
229229 data = data [key ]
@@ -1048,8 +1048,10 @@ def execute(self, extractor, url, query_parameters):
10481048 cursor_type = self .cursor_type (query_parameters )
10491049 cursor = cursor_type () if cursor_type else None
10501050 for page in itertools .count (start = 1 ):
1051- extractor .log .info ("%s: retrieving %s page %d" , url , self .endpoint ,
1052- page )
1051+ item_count = len (self .items )
1052+ extractor .log .info ("%s: retrieving %s page %d (%d item%s)" , url ,
1053+ self .endpoint , page , item_count ,
1054+ "" if item_count == 1 else "s" )
10531055 tries = 0
10541056 while True :
10551057 try :
@@ -1268,7 +1270,8 @@ def __init__(self, endpoint, type_of_items, range_predicate):
12681270
12691271 def extract_items (self , data ):
12701272 if "itemList" not in data :
1271- self .exit_early_due_to_no_items = True
1273+ if not data .get ("hasMorePrevious" , data .get ("hasMore" , False )):
1274+ self .exit_early_due_to_no_items = True
12721275 return {}
12731276 return {item ["id" ]: item for item in data ["itemList" ]}
12741277
0 commit comments