Open yarliganfatih opened 1 year ago
https://regexr.com/ https://regex101.com/
/0:00 |0:01 |0:02 |0:03 |0:04 |0:05 |0:06 |0:07 |0:08 |0:09 |0:10 |0:11 |0:12 |0:13 |0:14 |0:15 |0:16 |0:17 |0:18 |0:19 |0:20 |0:21 |0:22 |0:23 |0:24 |0:25 |0:26 |0:27 |0:28 |0:29 |0:30 |0:31 |0:32 |0:33 |0:34 |0:35 |0:36 |0:37 |0:38 |0:39 |0:40 |0:41 |0:42 |0:43 |0:44 |0:45 |0:46 |0:47 |0:48 |0:49 |0:50 |0:51 |0:52 |0:53 |0:54 |0:55 |0:56 |0:57 |0:58 |0:59 |1:00 |1:01 |1:02 |1:03 |1:04 |1:05 |1:06 |1:07 |1:08 |1:09 |1:10 |1:11 |1:12 |1:13 |1:14 |1:15 |1:16 |1:17 |1:18 |1:19 |1:20 |1:21 |1:22 |1:23 |1:24 |1:25 |1:26 |1:27 |1:28 |1:29 |1:30 |1:31 |1:32 |1:33 |1:34 |1:35 |1:36 |1:37 |1:38 |1:39 |1:40 |1:41 |1:42 |1:43 |1:44 |1:45 |1:46 |1:47 |1:48 |1:49 |1:50 ... /
/[0-9]:[0-5][0-9] /
/(0|1|2|3|4|5|6|7|8|9):(0|1|2|3|4|5)(0|1|2|3|4|5|6|7|8|9) /
searchTerms : \u003ca
=> totalResults : 0
searchTerms : \u003ca href="https://www.youtube.com/watch?v=
=> totalResults : 0
This method has been tried before. https://anobjectisa.medium.com/youtube-pop-up-comments-chrome-extension-68e8d5a834ce
https://developers.google.com/search/apis/indexing-api/v3/quota-pricing https://support.google.com/youtube/contact/yt_api_form?hl=en
https://support.google.com/youtube/contact/yt_api_form?hl=en
https://developers.google.com/youtube/v3/guides/quota_and_compliance_audits?hl=tr https://developers.google.com/youtube/v3/determine_quota_cost?hl=tr
function preCommentThreads ( videoId, page=1 ) {
}
In step 3, the number of requests can be greatly reduced by sending the request in 10 seconds searchTerms.
0:00 |0:01 |0:02 ... |0:08 |0:09
0:10 |0:11 |0:12 ... |0:18 |0:19
(n/6) + ":" + (10*(n%6)+i)
Of course, the comments in the api response will not be ordered as we want, so it will be necessary to group them according to timestamps.because of searchTerms accepts 100 char maximum. every second m:ss |
should be in the form.
m:ss
but is not for mm:ss
mm:ss
but is not for h:mm:ss
hh:mm:ss
Let's say the comments of video X were saved to the database on date Y. Then for anyone watching the X video, comments saved on Y date will be returned from the database instead of sending a request to the Youtube Data API again. However, comments published after the Y date will not be displayed.
For this, a time period will be determined depending on the temperature of the video. In the 2nd stage, the updatedness of the last recorded comments will be checked and if they are out of date, the 3rd stage will be applied.
Sample Middleware restAPI project => https://github.com/yarliganfatih/placesmap-restapi