sS youtubeSearch_userAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"; static int youtubeSearch_timeout = toMS_int(20.0); static L youtubeSearch(S q) { temp tempLoadingAnim("YouTube search: " + q); S html = loadPageWithUserAgentAndTimeout("https://www.youtube.com/results?search_query=" + urlencode(q), youtubeSearch_userAgent, youtubeSearch_timeout); printIndent("XX ", html); int i = indexOf(html, [[{"responseContext":]]); print(i); if (i < 0) null; S json = dropSuffix(";", firstLine(substring(html, i))); print("Got JSON: " + json); ret (L) jsonDecode(json); }