question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expecting value: line 1 column 1 (char 0) issue with save_hashtag_video_urls()

See original GitHub issue

Thanks for all your hard work in this module! I’ve been using it to scrape TikTok videos by hashtag for a research study, but today when I try to run save_hashtag_video_urls() with any hashtag, I keep getting the following output:

Expecting value: line 1 column 1 (char 0)
Expecting value: line 1 column 1 (char 0)
Expecting value: line 1 column 1 (char 0)
Expecting value: line 1 column 1 (char 0)
Expecting value: line 1 column 1 (char 0)

and it keeps repeating. I’m still able to use the other functions, and I first noticed this issue around 12 pm CDT today. Would this be an issue with the TikTok API changing?

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:3
  • Comments:53 (21 by maintainers)

github_iconTop GitHub Comments

3reactions
dfreeloncommented, Nov 21, 2022

OK, I looked into this over the weekend and have a few observations:

  • as @stefanuq noted, TikTok has stepped up their security around comment retrieval. Comments are not stored in the page source, and while the JSON object stored inside each video page contain a field called comments, it’s been blank for every video I’ve checked.
  • I’ve figured out two ways to pull comments using Selenium-based browser emulation:
  1. Pull the comments directly from the emulated source using something like BeautifulSoup, or
  2. Capture the relevant XHR request to /api/comment/list/, resend the request with all necessary URL params, and capture the results.

I hesitate to implement anything using Selenium for several reasons:

  • Installation is complex and OS-dependent.
  • It’s slow.
  • Getting more than 20 comments would probably require multiple Selenium requests, which compounds the slowness problem.
  • TikTok is apparently releasing a research API next year, so I kinda want to wait and see what it can do before investing lots of time in rigging together a janky comment pipeline only to have it superseded by something much better.

But if anyone figures out anything faster for comments between now and then, LMK and I’ll consider implementing it.

2reactions
dfreeloncommented, Nov 21, 2022

@Jmallone I’m willing to wait and see in the short term (also because I have other commitments…) but I will at least fix the search function, likely over the next few days

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Show activity on this post. I am getting error Expecting value: line 1 column 1 (char 0) when trying to decode JSON. The...
Read more >
Expecting value: line 1 column 1 (char 0) · Issue #615 - GitHub
Hi guys, Yesterday I could retrieve the calender info with any issues, trying it this morning (same code), I received the following error ......
Read more >
trying to create page with api: message "Expecting value
Expecting value : line 1 column 1 (char 0). (100% received and 100% Xferd, but error on line 1 column 1 instead of...
Read more >
Expecting value: line 1 column 1 (char 0) | JSONDecodeError
json.decoder.JSONDecodeError: Expecting value : line 1 column 1 ( char 0 )In this video we will be discusing various causes leading to ...
Read more >
Expecting value: line 1 column 1 (char 0) in Python - YouTube
raise JSONDecodeError("Expecting value", s, err.value) from None ,json.decoder.JSONDecodeError: Expecting value : line 1 column 1 ( char 0 ) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found