JustAnotherArchivist / snscrape

A social networking service scraper in Python
GNU General Public License v3.0
4.33k stars 699 forks source link

Facebook: JSONDecodeError due to empty response #30

Closed JustAnotherArchivist closed 5 years ago

JustAnotherArchivist commented 5 years ago

While scraping FWPthailand, I just got this exception:

Traceback (most recent call last):
  File ".../bin/snscrape", line 11, in <module>
    load_entry_point('snscrape==0.1.3', 'console_scripts', 'snscrape')()
  File ".../lib/python3.6/site-packages/snscrape/cli.py", line 59, in main
    for i, item in enumerate(scraper.get_items(), start = 1):
  File ".../lib/python3.6/site-packages/snscrape/modules/facebook.py", line 59, in get_items
    response = json.loads(spuriousForLoopPattern.sub('', r.text))
  File ".../lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File ".../lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File ".../lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Facebook apparently sends a completely empty response there. I can reproduce this at the moment.

kiska3 commented 5 years ago

Profile: rossvastamp

Traceback (most recent call last): File "/home/kiska/.local/bin/snscrape", line 10, in <module> sys.exit(main()) File "/home/kiska/.local/lib/python3.6/site-packages/snscrape/cli.py", line 59, in main for i, item in enumerate(scraper.get_items(), start = 1): File "/home/kiska/.local/lib/python3.6/site-packages/snscrape/modules/facebook.py", line 59, in get_items response = json.loads(spuriousForLoopPattern.sub('', r.text)) File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

JustAnotherArchivist commented 5 years ago

Confirmed, and I found another case today: vihreat

All three cases are reproducible currently, pointing at a permanent server-side issue.

jodizzle commented 5 years ago

Another example that seems to be reproducible: MyANCza.

JustAnotherArchivist commented 5 years ago

I'm no longer able to reproduce this with the four mentioned accounts. Please reopen if it reoccurs.

JustAnotherArchivist commented 3 years ago

Currently reproducible with daswasfehlt, breaks around 2019-06-09. I don't think this is fixable in snscrape.