UltimaScraper icon indicating copy to clipboard operation
UltimaScraper copied to clipboard

Autoscrape and manually scraping all will lead to errors

Open Kurosaki22 opened this issue 6 years ago • 6 comments

Hi there, It seems like that there is currently something wrong with the auto scrape function. If I set "auto_scrape_names" to true I receive the following error:

2020-08-09 23:31:02,587 ERROR errors local variable 'value' referenced before assignment
Traceback (most recent call last):
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\datascraper\main_datascraper.py", line 232, in start_datascraper
    session, username, site_name, app_token, choice_type=value)
UnboundLocalError: local variable 'value' referenced before assignment

If is set it to false and select 0=All for scraping all "manually" I receive another error message:

2020-08-09 23:28:29,794 WARNING urllib3.connectionpool Connection pool is full, discarding connection: onlyfans.com
2020-08-09 23:28:29,829 ERROR errors Expecting ',' delimiter: line 1 column 908417 (char 908416)
Traceback (most recent call last):
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\datascraper\main_datascraper.py", line 231, in start_datascraper
    result = x.start_datascraper(
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\modules\onlyfans.py", line 100, in start_datascraper
    results = prepare_scraper(
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\modules\onlyfans.py", line 531, in prepare_scraper
    export_archive(metadata_set, archive_directory, json_settings)
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\helpers\main_helper.py", line 106, in export_archive
    datas2 = ofrenamer.start(archive_path, json_settings)
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\extras\OFRenamer\start.py", line 85, in start
    metadatas = json.load(open(metadata_filepath))
  File "C:\Users\oehy2\AppData\Local\Programs\Python\Python38-32\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\oehy2\AppData\Local\Programs\Python\Python38-32\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Users\oehy2\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\oehy2\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 908417 (char 908416)

When I set "auto_scrape_names" to false and scrape everything 1 by 1 its working totally fine

Kurosaki22 avatar Aug 09 '20 21:08 Kurosaki22

Should be fixed in latest commit

UltimaHoarder avatar Aug 09 '20 22:08 UltimaHoarder

The first one is fixed but as soon as the auto scrape starts the 2nd error shows up

2020-08-10 01:13:57,500 WARNING urllib3.connectionpool Connection pool is full, discarding connection: onlyfans.com
Scraping [video | stream | gif]. Should take less than a minute.
2020-08-10 01:14:04,960 WARNING urllib3.connectionpool Connection pool is full, discarding connection: onlyfans.com
2020-08-10 01:14:04,992 ERROR errors Expecting ',' delimiter: line 1 column 908417 (char 908416)
Traceback (most recent call last):
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\datascraper\main_datascraper.py", line 232, in start_datascraper
    result = x.start_datascraper(
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\modules\onlyfans.py", line 100, in start_datascraper
    results = prepare_scraper(
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\modules\onlyfans.py", line 531, in prepare_scraper
    export_archive(metadata_set, archive_directory, json_settings)
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\helpers\main_helper.py", line 106, in export_archive
    datas2 = ofrenamer.start(archive_path, json_settings)
  File "D:\OneDrive\Box\OF_Scraper\OnlyFans\extras\OFRenamer\start.py", line 85, in start
    metadatas = json.load(open(metadata_filepath))
  File "C:\Users\oehy2\AppData\Local\Programs\Python\Python38-32\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\oehy2\AppData\Local\Programs\Python\Python38-32\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Users\oehy2\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\oehy2\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 908417 (char 908416)

Kurosaki22 avatar Aug 09 '20 23:08 Kurosaki22

Which user are you trying to scrape

UltimaHoarder avatar Aug 09 '20 23:08 UltimaHoarder

You are right it only appears when I scrape from sophiedeelive She had a promo for a 3 days trial. if I do not include her in the scrape process everything is working fine so it is not related to the auto scrape feature since it also happen if I try to scrape her manually.

Kurosaki22 avatar Aug 10 '20 00:08 Kurosaki22

Ah, delete the metadata folder in her folder and scrape it again

UltimaHoarder avatar Aug 10 '20 00:08 UltimaHoarder

Deleting the metadata folder worked :) And since you already fixed the other issue ths defect here is fixed. Thanks for your great and extremly fast work

Kurosaki22 avatar Aug 10 '20 00:08 Kurosaki22