From 2ebf4fafec587ae33f02260bc21d1e79e8a2310d Mon Sep 17 00:00:00 2001 From: limkokhole Date: Thu, 20 Jan 2022 02:34:48 +0800 Subject: [PATCH] Update example output --- README.md | 3 --- pinterest-downloader.py | 10 ++++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 30a728e..9684ca1 100755 --- a/README.md +++ b/README.md @@ -92,9 +92,6 @@ Download all images/videos from Pinterest user/board/section. ### Example Output: xb@dnxb:~/Downloads/pinterest/pinterest-downloader$ python3 pinterest-downloader.py -d comp https://www.pinterest.com/antonellomiglio/computer/ - [...] Getting all images in this board: computer ... [ 74 / ? ] - [W] This images list is not sorted(Due to user reorder or alphanumeric pin ID), fallback to -rs for this list. - [...] Getting all images in this board: computer ... [ 173 / ? ] [➕] Found 195 image/videos Download into directory: comp/antonellomiglio/Computer [✔] Downloaded: |##################################################| 100.0% Complete diff --git a/pinterest-downloader.py b/pinterest-downloader.py index c97bf25..dd9d6f7 100755 --- a/pinterest-downloader.py +++ b/pinterest-downloader.py @@ -291,6 +291,7 @@ def get_board_info(board_or_sec_path, exclude_section, section, board_path, prox board_d = data['props']['initialReduxState']['boards'] #dj(board_d) board_sec_d = data['props']['initialReduxState']['boardsections'] + #dj(board_sec_d) break except json.decoder.JSONDecodeError: pass @@ -309,6 +310,8 @@ def get_board_info(board_or_sec_path, exclude_section, section, board_path, prox b_dk = board_d[k] board_d_map = {} board_d_map['url'] = b_dk.get('url', '') + board_d_map['modified_at'] = b_dk.get('board_order_modified_at', '') + #print('Board modified: ' + repr(board_d_map['modified_at'])) #dj(b_dk, 'board d') # [todo:0] board_order_modified_at help decide re-scrape? board_d_map['id'] = b_dk.get('id', '') board_d_map['name'] = b_dk.get('name', '') @@ -326,6 +329,9 @@ def get_board_info(board_or_sec_path, exclude_section, section, board_path, prox if section and (sec_slug != section): continue + #sec_d_map['modified_at'] = b_dk.get('board_order_modified_at', '') + #print('Section modified: ' + repr(sec_d_map['modified_at'])) + sec_d_map['slug'] = sec_slug sec_d_map['id'] = b_dk.get('id', '') sec_d_map['title'] = b_dk.get('title', '') @@ -1085,7 +1091,7 @@ Please ensure your username/boardname/[section] or link has media item.\n') ) #print('Imgs url ok: ' + str(r.ok)) #print('Imgs url: ' + r.url) data = r.json() - #dj(data, 'imgs loop raw') + dj(data, 'imgs loop raw') # Useful for debug with print only specific id log #if 'e07614d79a22d22c83d51649e2e01e43' in repr(data): #print('res data: ' + repr(data)) @@ -1113,7 +1119,7 @@ Please ensure your username/boardname/[section] or link has media item.\n') ) break if on_hold_break: # Need check above 2 imgs first, test with delete 1 image in unsorted list break - if latest_pin == img['id']: + if latest_pin == img_curr: #print('\nAlready scroll to latest downloaded pin. Break.') #print('bookmark: ' + repr(bookmark)) imgs_round = imgs_round[:img_round_i]