Rutube отдает превью (обложку) видео в самом максимальном разрешении. Захотелось решить эту небольшую проблему.
Обращаемся к серверу i.rtimg.ru и получаем изображение в разных размерах.
i.rtimg.ru/vi/{video_id}/{size}/
| <?php | |
| function replace_area_format(string $area): string | |
| { | |
| $pattern = [ | |
| '/\bсот(к[а|и]|ок)\b/ui' => 'сот.', | |
| '/\b(гектар)(|[ы]|(а|ов))\b/ui' => 'Га', | |
| '/\b(кв(.\s?)м)(|етр)(|ов|а)\b/ui' => 'м²', | |
| ]; |
| { | |
| fields: [ | |
| { | |
| id: 2, | |
| name: '\u0422\u0438\u043f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f', | |
| slug: 'offer-type', | |
| base_slug: 'offer_type', | |
| parent_id: 0, | |
| type: 'select', | |
| is_number: false, |
| // ================================================== | |
| // fancyBox v3.5.7 | |
| // | |
| // Licensed GPLv3 for open source use | |
| // or fancyBox Commercial License for commercial use | |
| // | |
| // http://fancyapps.com/fancybox/ | |
| // Copyright 2022 fancyApps | |
| // | |
| // ================================================== |
| / 20220218235112 | |
| // http://fqe0/_dt.php | |
| { | |
| "Лера Михайлова": [ | |
| 367581, | |
| 294822 | |
| ], | |
| "Maria Sysoikina": [ | |
| 367581, |
| function isPrimaryStateRegistrationNumber($number) { | |
| let n = $number.length == 13 ? 11 : $number.length == 15 ? 13 : 0, | |
| j = $number.slice(0, -1), | |
| v = j / n, | |
| g = v.toString().replace(/\..*/gm, '') * n, | |
| f = (j - g).toString(), | |
| k = f > 9 ? f.slice(-1) : f, | |
| t = k == $number.toString().slice(-1); | |
| return t; |
| document['documentElement']['outerHTML'] | |
| ['match'](/"ydoWorkerId":(["\w"|-])+/m)[0x0] | |
| ['split'](':')[0x1] | |
| ['replaceAll']('\x22', ''); | |
| // "ydoWorkerId":"(.*?)" |
| <?php | |
| $request = simplexml_load_string( | |
| file_get_contents( | |
| $uri = 'https://www.cbr.ru/scripts/XML_daily.asp', | |
| false, | |
| stream_context_create([ | |
| 'http' => [ | |
| 'method' => 'GET', | |
| 'header' => |
| [ | |
| { | |
| "pathName": "path22", | |
| "pathMass": [ | |
| { | |
| "x": 3823.8979, | |
| "y": 1195.8703 | |
| }, | |
| { | |
| "x": 30.3906, |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Generation qr-code 🤠</title> | |
| <link rel="stylesheet" href="styles.css" /> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/picnic" /> | |
| <!-- Подключаем файл jsPDF.js --> |