Uses 64664K of libraries. Click here for Pure Java version (9313L/56K).
static L<WithURL<S>> youTubeSearch_all(Browser browser, S query, double cacheExpirationDays default 1) { // simplify query query = simpleSpacesAndTrim(lower(query)); FileBasedStringMap cache = new(javaxCachesDir("YouTube Searches")); File f = cache.fileForKey(query); if (exists(f) && fileAgeInDays(f) < cacheExpirationDays) ret (L) unstructure(cache.get(query)); // not in cache, start browser var result = youTubeSearch_uncached(browser, query); cache.put(query, indentedStructure(result)); ret result; }
download show line numbers debug dex old transpilations
Travelled to 5 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, uelavcdoioby
No comments. add comment
| Snippet ID: | #1032307 |
| Snippet name: | youTubeSearch_all - get all results on first page. uses Playwright. caches query results |
| Eternal ID of this version: | #1032307/12 |
| Text MD5: | 36857c600d25d953e8b01b8faa742529 |
| Transpilation MD5: | c53e5244727e8b17b01271e0cd177826 |
| Author: | stefan |
| Category: | javax / networking |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-08-30 04:31:22 |
| Source code size: | 551 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 410 / 552 |
| Version history: | 11 change(s) |
| Referenced in: | [show references] |