Blank json output for all searches
See original GitHub issueI have been using this snippet for a while:
search = json.loads(YoutubeSearch("test", max_results=1).to_json())
videos = search["videos"][0]
link = videos["link"]
print("https://youtube.com" + link)
which now results in list index out of range
Since today, the json output appears to be returning this for all searches:
{"videos": []}
I’m wondering if youtube changed something in the page?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Check if JSON response data is empty - Stack Overflow
Try below code snippet:- if(!Object.keys(response.data).length){ console.log("no data found"); }. If you are getting data as empty object ...
Read more >How to handle empty JSON response
At the bottom of the screenshot, I have a for each loop (which was automatically created) based on the 'customer' output of a...
Read more >Solved: Re: Empty JSON string when getting target response...
I am receiving JSON string response from target endpoint with Content-Type as "text/plain; charset=UTF-8". Here is the RAW raw response from target endpoint....
Read more >JSON REST API response with empty list - OutSystems
I'm producing a REST API with JSON response. In case the response is emtpy, the consumers like to get the following response: {....
Read more >Solved: Can someone Explain why JSON returns empty unless
So to send it back into my client script I used JSON.stringify but it would always return "{}" or empty unless I use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now YouTube randomly returns two types of responses, one within JavaScript and other as HTML… Now we cannot scrape using BeautifulSoup.
I have separately written another script here completely from scratch (without any third party library) and is working with both types of responses.
Feel free to use: https://github.com/alexmercerind/youtube-search-python
It has lot more information in its search result.
All the video info is now contained inside a Javascript object within a script tag on the returned page, so the parser will need to collect from there. I’m testing out some javascript parsing libraries and hopefully will have something soon