Update example output

This commit is contained in:
limkokhole
2022-01-20 02:34:48 +08:00
parent c1e7a914a7
commit 2ebf4fafec
2 changed files with 8 additions and 5 deletions

View File

@@ -92,9 +92,6 @@ Download all images/videos from Pinterest user/board/section.
### Example Output: ### Example Output:
xb@dnxb:~/Downloads/pinterest/pinterest-downloader$ python3 pinterest-downloader.py -d comp https://www.pinterest.com/antonellomiglio/computer/ 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 [...] Getting all images in this board: computer ... [ 173 / ? ] [] Found 195 image/videos
Download into directory: comp/antonellomiglio/Computer Download into directory: comp/antonellomiglio/Computer
[✔] Downloaded: |##################################################| 100.0% Complete [✔] Downloaded: |##################################################| 100.0% Complete

View File

@@ -291,6 +291,7 @@ def get_board_info(board_or_sec_path, exclude_section, section, board_path, prox
board_d = data['props']['initialReduxState']['boards'] board_d = data['props']['initialReduxState']['boards']
#dj(board_d) #dj(board_d)
board_sec_d = data['props']['initialReduxState']['boardsections'] board_sec_d = data['props']['initialReduxState']['boardsections']
#dj(board_sec_d)
break break
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:
pass pass
@@ -309,6 +310,8 @@ def get_board_info(board_or_sec_path, exclude_section, section, board_path, prox
b_dk = board_d[k] b_dk = board_d[k]
board_d_map = {} board_d_map = {}
board_d_map['url'] = b_dk.get('url', '') 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? #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['id'] = b_dk.get('id', '')
board_d_map['name'] = b_dk.get('name', '') 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): if section and (sec_slug != section):
continue 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['slug'] = sec_slug
sec_d_map['id'] = b_dk.get('id', '') sec_d_map['id'] = b_dk.get('id', '')
sec_d_map['title'] = b_dk.get('title', '') 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 ok: ' + str(r.ok))
#print('Imgs url: ' + r.url) #print('Imgs url: ' + r.url)
data = r.json() data = r.json()
#dj(data, 'imgs loop raw') dj(data, 'imgs loop raw')
# Useful for debug with print only specific id log # Useful for debug with print only specific id log
#if 'e07614d79a22d22c83d51649e2e01e43' in repr(data): #if 'e07614d79a22d22c83d51649e2e01e43' in repr(data):
#print('res data: ' + repr(data)) #print('res data: ' + repr(data))
@@ -1113,7 +1119,7 @@ Please ensure your username/boardname/[section] or link has media item.\n') )
break break
if on_hold_break: # Need check above 2 imgs first, test with delete 1 image in unsorted list if on_hold_break: # Need check above 2 imgs first, test with delete 1 image in unsorted list
break break
if latest_pin == img['id']: if latest_pin == img_curr:
#print('\nAlready scroll to latest downloaded pin. Break.') #print('\nAlready scroll to latest downloaded pin. Break.')
#print('bookmark: ' + repr(bookmark)) #print('bookmark: ' + repr(bookmark))
imgs_round = imgs_round[:img_round_i] imgs_round = imgs_round[:img_round_i]