(url, formdata)
| 3 | |
| 4 | const ytv = async yutub => { |
| 5 | function post(url, formdata) { |
| 6 | return fetch(url, { |
| 7 | method: 'POST', |
| 8 | headers: { |
| 9 | accept: '*/*', |
| 10 | 'accept-language': 'en-US,en;q=0.9', |
| 11 | 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', |
| 12 | }, |
| 13 | body: new URLSearchParams(Object.entries(formdata)), |
| 14 | }) |
| 15 | } |
| 16 | const ytIdRegex = |
| 17 | /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/ |
| 18 | let ytId = ytIdRegex.exec(yutub) |