limkokhole / pinterest-downloader

Download all images/videos from Pinterest user/board/section.
MIT License
278 stars 47 forks source link

UnicodeEncodeError #9

Closed fluffyloopy closed 2 years ago

fluffyloopy commented 2 years ago
Traceback (most recent call last):
  File "pinterest-downloader.py", line 1680, in <module>
    run_direct_main()
  File "pinterest-downloader.py", line 1675, in run_direct_main
    , args.https_proxy, args.http_proxy)
  File "pinterest-downloader.py", line 1545, in run_library_main
    , arg_cut, arg_el, fs_f_max )
  File "pinterest-downloader.py", line 1283, in fetch_imgs
    got_img = write_log(arg_timestamp_log, url_path, shortform, arg_img_only, arg_v_only, save_dir, images, None, arg_cut, break_from_latest_pin)
  File "pinterest-downloader.py", line 927, in write_log
    f.write('Input URL: https://www.pinterest.com/' + url_path.rstrip('/')  + '/\n') # Reuse/refer when want to update
UnicodeEncodeError: 'cp932' codec can't encode character '\uab75' in position 54: illegal multibyte sequence
 Abort.
fluffyloopy commented 2 years ago
924 :   with open(log_url_path, 'w', encoding="utf-8") as f:
949 :   with open(log_path, 'w', encoding="utf-8") as f: 
962 :   with open(log_path, 'w', encoding="utf-8") as f: 

i have no idea how github stuff work so... just gonna leave that here

treksis commented 1 year ago

Encountered the same problem, I added encoding="utf=8" every line started with with open( ----, 'w') and It is working