Libraryless. Click here for Pure Java version (4202L/28K).
1 | // page contents is cached using webScrape |
2 | // returns pairs (video id, title plus stats) |
3 | static LPairS videoLinksFromYouTubePage(S url, O... _) { |
4 | S html = emitIntermediate html(_, webScrape(youtubeURL(url))); |
5 | LS l = regexpExtractAll([[\\"(label|videoId)\\":\\"(.*?)\\"]], html); |
6 | //print(+l); |
7 | S videoId = null; |
8 | new LPairS out; |
9 | for (S s : l) { |
10 | PairS p = listToPair(unquoteAll(splitAtColon(unquoteRaw(s)))), continue if null; |
11 | if (eq(p.a, "videoId")) videoId = p.b; |
12 | else out.add(pair(videoId, p.b)); |
13 | } |
14 | ret out; |
15 | } |
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028022 |
Snippet name: | videoLinksFromYouTubePage |
Eternal ID of this version: | #1028022/13 |
Text MD5: | cdae98e4b7906d29817cf76517120e8e |
Transpilation MD5: | 848679a4e4a1731949f8ae5dd5b1b8bc |
Author: | stefan |
Category: | javax / networking |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-05-04 01:17:22 |
Source code size: | 550 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 208 / 336 |
Version history: | 12 change(s) |
Referenced in: | [show references] |