diff --git a/KomplexHubContent/pages/HomePage.qml b/KomplexHubContent/pages/HomePage.qml index 93e0de8..3378a0e 100644 --- a/KomplexHubContent/pages/HomePage.qml +++ b/KomplexHubContent/pages/HomePage.qml @@ -179,16 +179,14 @@ Item { required property string author required property string authorId required property string authorUrl - required property string description required property string thumbnail - required property string original SearchResultItem { anchors.fill: parent - title: "Pexels Photo" + title: parent.author author: parent.author - description: parent.description + description: "Video provided by Pexels" thumbnail: parent.thumbnail uuid: parent.uuid } diff --git a/KomplexHubPlugin/CMakeLists.txt b/KomplexHubPlugin/CMakeLists.txt index 7aa4c3a..d7bdf6e 100644 --- a/KomplexHubPlugin/CMakeLists.txt +++ b/KomplexHubPlugin/CMakeLists.txt @@ -48,6 +48,8 @@ qt_add_qml_module( SOURCES paginators/featuredvideospaginator.h SOURCES common/imagecache.h SOURCES paginators/imagepaginator.h + SOURCES common/videocache.h + SOURCES paginators/videopaginator.h ) diff --git a/KomplexHubPlugin/common/data.json b/KomplexHubPlugin/common/data.json index 5bc4215..0c6f2d3 100644 --- a/KomplexHubPlugin/common/data.json +++ b/KomplexHubPlugin/common/data.json @@ -1,337 +1,2253 @@ { "page": 1, "per_page": 15, - "photos": [ + "total_results": 8000, + "url": "https://api.pexels.com/videos/", + "videos": [ { - "alt": "A solitary church atop a hill in Iceland set against a dramatic cloudy sky in black and white.", - "avg_color": "#777777", - "height": 4000, - "id": 37953511, - "liked": false, - "photographer": "Alexis B", - "photographer_id": 1699196, - "photographer_url": "https://www.pexels.com/@alexis-b-1699196", - "src": { - "landscape": "https://images.pexels.com/photos/37953511/pexels-photo-37953511.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/37953511/pexels-photo-37953511.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/37953511/pexels-photo-37953511.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/37953511/pexels-photo-37953511.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/37953511/pexels-photo-37953511.jpeg", - "portrait": "https://images.pexels.com/photos/37953511/pexels-photo-37953511.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/37953511/pexels-photo-37953511.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/37953511/pexels-photo-37953511.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 7, + "full_res": null, + "height": 1920, + "id": 6963395, + "image": "https://images.pexels.com/videos/6963395/eco-friendly-environment-environmentally-friendly-mothernature-6963395.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=630", + "tags": [], + "url": "https://www.pexels.com/video/a-person-holding-a-eucalyptus-plant-with-soil-6963395/", + "user": { + "id": 3716105, + "name": "Cup of Couple", + "url": "https://www.pexels.com/@cup-of-couple" }, - "url": "https://www.pexels.com/photo/isolated-church-on-icelandic-hill-in-black-and-white-37953511/", - "width": 6000 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 25, + "height": 960, + "id": 10253111, + "link": "https://videos.pexels.com/video-files/6963395/6963395-sd_540_960_25fps.mp4", + "quality": "sd", + "size": 1275312, + "width": 540 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 1920, + "id": 10253142, + "link": "https://videos.pexels.com/video-files/6963395/6963395-hd_1080_1920_25fps.mp4", + "quality": "hd", + "size": 4214061, + "width": 1080 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 640, + "id": 10253184, + "link": "https://videos.pexels.com/video-files/6963395/6963395-sd_360_640_25fps.mp4", + "quality": "sd", + "size": 437793, + "width": 360 + }, + { + "file_type": "video/mp4", + "fps": 50, + "height": 1280, + "id": 10253223, + "link": "https://videos.pexels.com/video-files/6963395/6963395-hd_720_1280_50fps.mp4", + "quality": "hd", + "size": 2297154, + "width": 720 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 426, + "id": 10253254, + "link": "https://videos.pexels.com/video-files/6963395/6963395-sd_240_426_25fps.mp4", + "quality": "sd", + "size": 270056, + "width": 240 + } + ], + "video_pictures": [ + { + "id": 5475995, + "nr": 0, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-0.jpeg" + }, + { + "id": 5476002, + "nr": 1, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-1.jpeg" + }, + { + "id": 5476007, + "nr": 2, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-2.jpeg" + }, + { + "id": 5476016, + "nr": 3, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-3.jpeg" + }, + { + "id": 5476024, + "nr": 4, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-4.jpeg" + }, + { + "id": 5476033, + "nr": 5, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-5.jpeg" + }, + { + "id": 5476039, + "nr": 6, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-6.jpeg" + }, + { + "id": 5476048, + "nr": 7, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-7.jpeg" + }, + { + "id": 5476055, + "nr": 8, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-8.jpeg" + }, + { + "id": 5476058, + "nr": 9, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-9.jpeg" + }, + { + "id": 5476062, + "nr": 10, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-10.jpeg" + }, + { + "id": 5476074, + "nr": 11, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-11.jpeg" + }, + { + "id": 5476078, + "nr": 12, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-12.jpeg" + }, + { + "id": 5476081, + "nr": 13, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-13.jpeg" + }, + { + "id": 5476083, + "nr": 14, + "picture": "https://images.pexels.com/videos/6963395/pictures/preview-14.jpeg" + } + ], + "width": 1080 }, { - "alt": "A stylish wedding couple poses in a historic Istanbul location, embodying romance and elegance.", - "avg_color": "#242424", - "height": 6304, - "id": 38109250, - "liked": false, - "photographer": "Mina Fotoğraf", - "photographer_id": 2162259056, - "photographer_url": "https://www.pexels.com/@mina-fotograf-2162259056", - "src": { - "landscape": "https://images.pexels.com/photos/38109250/pexels-photo-38109250.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/38109250/pexels-photo-38109250.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/38109250/pexels-photo-38109250.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/38109250/pexels-photo-38109250.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/38109250/pexels-photo-38109250.jpeg", - "portrait": "https://images.pexels.com/photos/38109250/pexels-photo-38109250.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/38109250/pexels-photo-38109250.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/38109250/pexels-photo-38109250.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 15, + "full_res": null, + "height": 4096, + "id": 5386411, + "image": "https://images.pexels.com/videos/5386411/pexels-photo-5386411.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=630", + "tags": [], + "url": "https://www.pexels.com/video/a-monk-meditating-on-a-tree-5386411/", + "user": { + "id": 1437723, + "name": "cottonbro studio", + "url": "https://www.pexels.com/@cottonbro" }, - "url": "https://www.pexels.com/photo/elegant-wedding-couple-in-historic-istanbul-venue-38109250/", - "width": 4203 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 25, + "height": 426, + "id": 9686353, + "link": "https://videos.pexels.com/video-files/5386411/5386411-sd_226_426_25fps.mp4", + "quality": "sd", + "size": 550863, + "width": 226 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 2732, + "id": 9686395, + "link": "https://videos.pexels.com/video-files/5386411/5386411-uhd_1440_2732_25fps.mp4", + "quality": "uhd", + "size": 22201616, + "width": 1440 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 1366, + "id": 9686495, + "link": "https://videos.pexels.com/video-files/5386411/5386411-hd_720_1366_25fps.mp4", + "quality": "hd", + "size": 4627760, + "width": 720 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 640, + "id": 9686545, + "link": "https://videos.pexels.com/video-files/5386411/5386411-sd_338_640_25fps.mp4", + "quality": "sd", + "size": 854156, + "width": 338 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 4096, + "id": 9686594, + "link": "https://videos.pexels.com/video-files/5386411/5386411-uhd_2160_4096_25fps.mp4", + "quality": "uhd", + "size": 41359169, + "width": 2160 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 960, + "id": 9686663, + "link": "https://videos.pexels.com/video-files/5386411/5386411-sd_506_960_25fps.mp4", + "quality": "sd", + "size": 2383979, + "width": 506 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 2048, + "id": 9686707, + "link": "https://videos.pexels.com/video-files/5386411/5386411-hd_1080_2048_25fps.mp4", + "quality": "hd", + "size": 9030224, + "width": 1080 + } + ], + "video_pictures": [ + { + "id": 2747973, + "nr": 0, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-0.jpeg" + }, + { + "id": 2747978, + "nr": 1, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-1.jpeg" + }, + { + "id": 2747983, + "nr": 2, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-2.jpeg" + }, + { + "id": 2747990, + "nr": 3, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-3.jpeg" + }, + { + "id": 2747997, + "nr": 4, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-4.jpeg" + }, + { + "id": 2748004, + "nr": 5, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-5.jpeg" + }, + { + "id": 2748009, + "nr": 6, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-6.jpeg" + }, + { + "id": 2748020, + "nr": 7, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-7.jpeg" + }, + { + "id": 2748026, + "nr": 8, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-8.jpeg" + }, + { + "id": 2748039, + "nr": 9, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-9.jpeg" + }, + { + "id": 2748050, + "nr": 10, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-10.jpeg" + }, + { + "id": 2748060, + "nr": 11, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-11.jpeg" + }, + { + "id": 2748066, + "nr": 12, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-12.jpeg" + }, + { + "id": 2748076, + "nr": 13, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-13.jpeg" + }, + { + "id": 2748087, + "nr": 14, + "picture": "https://images.pexels.com/videos/5386411/pictures/preview-14.jpeg" + } + ], + "width": 2160 }, { - "alt": "Black and white cityscape capturing two people walking along a quaint European street at twilight.", - "avg_color": "#434343", - "height": 7728, - "id": 37644555, - "liked": false, - "photographer": "Alec Doualetas", - "photographer_id": 61739, - "photographer_url": "https://www.pexels.com/@alecdoua", - "src": { - "landscape": "https://images.pexels.com/photos/37644555/pexels-photo-37644555.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/37644555/pexels-photo-37644555.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/37644555/pexels-photo-37644555.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/37644555/pexels-photo-37644555.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/37644555/pexels-photo-37644555.jpeg", - "portrait": "https://images.pexels.com/photos/37644555/pexels-photo-37644555.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/37644555/pexels-photo-37644555.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/37644555/pexels-photo-37644555.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 9, + "full_res": null, + "height": 4096, + "id": 7438482, + "image": "https://images.pexels.com/videos/7438482/pexels-photo-7438482.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=630", + "tags": [], + "url": "https://www.pexels.com/video/close-up-video-of-a-flowers-7438482/", + "user": { + "id": 2678846, + "name": "ROMAN ODINTSOV", + "url": "https://www.pexels.com/@roman-odintsov" }, - "url": "https://www.pexels.com/photo/charming-urban-street-view-with-evening-stroll-37644555/", - "width": 5152 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 624, + "id": 10434220, + "link": "https://videos.pexels.com/video-files/7438482/7438482-sd_360_624_30fps.mp4", + "quality": "sd", + "size": 639568, + "width": 360 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 3744, + "id": 10434264, + "link": "https://videos.pexels.com/video-files/7438482/uhd_30fps.mp4", + "quality": "uhd", + "size": 24681382, + "width": 2160 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 936, + "id": 10434303, + "link": "https://videos.pexels.com/video-files/7438482/7438482-sd_540_936_30fps.mp4", + "quality": "sd", + "size": 1811068, + "width": 540 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 1872, + "id": 10434337, + "link": "https://videos.pexels.com/video-files/7438482/7438482-hd_1080_1872_30fps.mp4", + "quality": "hd", + "size": 5675937, + "width": 1080 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 2496, + "id": 10434385, + "link": "https://videos.pexels.com/video-files/7438482/uhd_30fps.mp4", + "quality": "uhd", + "size": 13699980, + "width": 1440 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 1248, + "id": 10434420, + "link": "https://videos.pexels.com/video-files/7438482/7438482-hd_720_1248_30fps.mp4", + "quality": "hd", + "size": 2972846, + "width": 720 + } + ], + "video_pictures": [ + { + "id": 6402991, + "nr": 0, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-0.jpeg" + }, + { + "id": 6402995, + "nr": 1, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-1.jpeg" + }, + { + "id": 6403000, + "nr": 2, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-2.jpeg" + }, + { + "id": 6403006, + "nr": 3, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-3.jpeg" + }, + { + "id": 6403013, + "nr": 4, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-4.jpeg" + }, + { + "id": 6403022, + "nr": 5, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-5.jpeg" + }, + { + "id": 6403027, + "nr": 6, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-6.jpeg" + }, + { + "id": 6403030, + "nr": 7, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-7.jpeg" + }, + { + "id": 6403034, + "nr": 8, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-8.jpeg" + }, + { + "id": 6403037, + "nr": 9, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-9.jpeg" + }, + { + "id": 6403041, + "nr": 10, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-10.jpeg" + }, + { + "id": 6403047, + "nr": 11, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-11.jpeg" + }, + { + "id": 6403052, + "nr": 12, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-12.jpeg" + }, + { + "id": 6403056, + "nr": 13, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-13.jpeg" + }, + { + "id": 6403060, + "nr": 14, + "picture": "https://images.pexels.com/videos/7438482/pictures/preview-14.jpeg" + } + ], + "width": 2363 }, { - "alt": "Monochrome portrait of a young man in a denim jacket seated indoors.", - "avg_color": "#626262", - "height": 6000, - "id": 38110448, - "liked": false, - "photographer": "Portraits By PB", - "photographer_id": 2162091442, - "photographer_url": "https://www.pexels.com/@pbportraits", - "src": { - "landscape": "https://images.pexels.com/photos/38110448/pexels-photo-38110448.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/38110448/pexels-photo-38110448.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/38110448/pexels-photo-38110448.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/38110448/pexels-photo-38110448.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/38110448/pexels-photo-38110448.jpeg", - "portrait": "https://images.pexels.com/photos/38110448/pexels-photo-38110448.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/38110448/pexels-photo-38110448.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/38110448/pexels-photo-38110448.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 10, + "full_res": null, + "height": 1080, + "id": 1526909, + "image": "https://images.pexels.com/videos/1526909/free-video-1526909.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/seal-on-the-beach-1526909/", + "user": { + "id": 574687, + "name": "Ruvim M", + "url": "https://www.pexels.com/@digitech" }, - "url": "https://www.pexels.com/photo/black-and-white-portrait-of-young-man-in-denim-38110448/", - "width": 4000 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 23.98, + "height": 720, + "id": 9263836, + "link": "https://videos.pexels.com/video-files/1526909/1526909-hd_1280_720_24fps.mp4", + "quality": "hd", + "size": 3489802, + "width": 1280 + }, + { + "file_type": "video/mp4", + "fps": 23.98, + "height": 1080, + "id": 9263921, + "link": "https://videos.pexels.com/video-files/1526909/1526909-hd_1920_1080_24fps.mp4", + "quality": "hd", + "size": 6795452, + "width": 1920 + }, + { + "file_type": "video/mp4", + "fps": 23.98, + "height": 360, + "id": 9264004, + "link": "https://videos.pexels.com/video-files/1526909/1526909-sd_640_360_24fps.mp4", + "quality": "sd", + "size": 628038, + "width": 640 + }, + { + "file_type": "video/mp4", + "fps": 23.98, + "height": 540, + "id": 9264039, + "link": "https://videos.pexels.com/video-files/1526909/1526909-sd_960_540_24fps.mp4", + "quality": "sd", + "size": 1704344, + "width": 960 + } + ], + "video_pictures": [ + { + "id": 141547, + "nr": 0, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-0.jpg" + }, + { + "id": 141548, + "nr": 1, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-1.jpg" + }, + { + "id": 141549, + "nr": 2, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-2.jpg" + }, + { + "id": 141550, + "nr": 3, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-3.jpg" + }, + { + "id": 141551, + "nr": 4, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-4.jpg" + }, + { + "id": 141552, + "nr": 5, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-5.jpg" + }, + { + "id": 141553, + "nr": 6, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-6.jpg" + }, + { + "id": 141554, + "nr": 7, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-7.jpg" + }, + { + "id": 141555, + "nr": 8, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-8.jpg" + }, + { + "id": 141556, + "nr": 9, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-9.jpg" + }, + { + "id": 141557, + "nr": 10, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-10.jpg" + }, + { + "id": 141558, + "nr": 11, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-11.jpg" + }, + { + "id": 141559, + "nr": 12, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-12.jpg" + }, + { + "id": 141560, + "nr": 13, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-13.jpg" + }, + { + "id": 141561, + "nr": 14, + "picture": "https://images.pexels.com/videos/1526909/pictures/preview-14.jpg" + } + ], + "width": 1920 }, { - "alt": "A dynamic black and white photo capturing reflections on modern building windows.", - "avg_color": "#6B6B6B", - "height": 3840, - "id": 37488903, - "liked": false, - "photographer": "wal_ 172619", - "photographer_id": 2156618639, - "photographer_url": "https://www.pexels.com/@wal_-172619-2156618639", - "src": { - "landscape": "https://images.pexels.com/photos/37488903/pexels-photo-37488903.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/37488903/pexels-photo-37488903.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/37488903/pexels-photo-37488903.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/37488903/pexels-photo-37488903.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/37488903/pexels-photo-37488903.jpeg", - "portrait": "https://images.pexels.com/photos/37488903/pexels-photo-37488903.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/37488903/pexels-photo-37488903.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/37488903/pexels-photo-37488903.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 21, + "full_res": null, + "height": 2160, + "id": 1409899, + "image": "https://images.pexels.com/videos/1409899/free-video-1409899.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/waves-rushing-and-splashing-to-the-shore-1409899/", + "user": { + "id": 439094, + "name": "Michal Marek", + "url": "https://www.pexels.com/@michalmarek" }, - "url": "https://www.pexels.com/photo/abstract-black-and-white-modern-building-reflection-37488903/", - "width": 5760 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 25, + "height": 2160, + "id": 9263058, + "link": "https://videos.pexels.com/video-files/1409899/1409899-uhd_3840_2160_25fps.mp4", + "quality": "uhd", + "size": 56807332, + "width": 3840 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 720, + "id": 9263080, + "link": "https://videos.pexels.com/video-files/1409899/1409899-hd_1280_720_25fps.mp4", + "quality": "hd", + "size": 6509533, + "width": 1280 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 1080, + "id": 9263092, + "link": "https://videos.pexels.com/video-files/1409899/1409899-hd_1920_1080_25fps.mp4", + "quality": "hd", + "size": 12833003, + "width": 1920 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 540, + "id": 9263110, + "link": "https://videos.pexels.com/video-files/1409899/1409899-sd_960_540_25fps.mp4", + "quality": "sd", + "size": 3687720, + "width": 960 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 1440, + "id": 9263123, + "link": "https://videos.pexels.com/video-files/1409899/1409899-uhd_2560_1440_25fps.mp4", + "quality": "uhd", + "size": 30896084, + "width": 2560 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 360, + "id": 9263137, + "link": "https://videos.pexels.com/video-files/1409899/1409899-sd_640_360_25fps.mp4", + "quality": "sd", + "size": 1295056, + "width": 640 + } + ], + "video_pictures": [ + { + "id": 128525, + "nr": 0, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-0.jpg" + }, + { + "id": 128526, + "nr": 1, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-1.jpg" + }, + { + "id": 128527, + "nr": 2, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-2.jpg" + }, + { + "id": 128528, + "nr": 3, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-3.jpg" + }, + { + "id": 128529, + "nr": 4, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-4.jpg" + }, + { + "id": 128530, + "nr": 5, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-5.jpg" + }, + { + "id": 128531, + "nr": 6, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-6.jpg" + }, + { + "id": 128532, + "nr": 7, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-7.jpg" + }, + { + "id": 128533, + "nr": 8, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-8.jpg" + }, + { + "id": 128534, + "nr": 9, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-9.jpg" + }, + { + "id": 128535, + "nr": 10, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-10.jpg" + }, + { + "id": 128536, + "nr": 11, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-11.jpg" + }, + { + "id": 128537, + "nr": 12, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-12.jpg" + }, + { + "id": 128538, + "nr": 13, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-13.jpg" + }, + { + "id": 128539, + "nr": 14, + "picture": "https://images.pexels.com/videos/1409899/pictures/preview-14.jpg" + } + ], + "width": 3840 }, { - "alt": "Black and white photo of cyclists racing under a bridge, casting shadows on a concrete wall.", - "avg_color": "#666666", - "height": 3648, - "id": 37730682, - "liked": false, - "photographer": "Emeric Laperriere", - "photographer_id": 3009913, - "photographer_url": "https://www.pexels.com/@emeric07", - "src": { - "landscape": "https://images.pexels.com/photos/37730682/pexels-photo-37730682.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/37730682/pexels-photo-37730682.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/37730682/pexels-photo-37730682.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/37730682/pexels-photo-37730682.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/37730682/pexels-photo-37730682.jpeg", - "portrait": "https://images.pexels.com/photos/37730682/pexels-photo-37730682.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/37730682/pexels-photo-37730682.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/37730682/pexels-photo-37730682.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 30, + "full_res": null, + "height": 2160, + "id": 3163534, + "image": "https://images.pexels.com/videos/3163534/free-video-3163534.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/changes-in-form-and-appearance-of-a-submerged-material-3163534/", + "user": { + "id": 755060, + "name": "Oleg Gamulinskii", + "url": "https://www.pexels.com/@oleg-gamulinskii-755060" }, - "url": "https://www.pexels.com/photo/cyclists-racing-under-urban-bridge-in-shadows-37730682/", - "width": 5472 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 30, + "height": 2160, + "id": 9300132, + "link": "https://videos.pexels.com/video-files/3163534/3163534-uhd_3840_2160_30fps.mp4", + "quality": "uhd", + "size": 71070000, + "width": 3840 + }, + { + "file_type": "video/mp4", + "fps": 30, + "height": 1440, + "id": 9300168, + "link": "https://videos.pexels.com/video-files/3163534/3163534-uhd_2560_1440_30fps.mp4", + "quality": "uhd", + "size": 36840171, + "width": 2560 + }, + { + "file_type": "video/mp4", + "fps": 30, + "height": 360, + "id": 9300204, + "link": "https://videos.pexels.com/video-files/3163534/3163534-sd_640_360_30fps.mp4", + "quality": "sd", + "size": 1887185, + "width": 640 + }, + { + "file_type": "video/mp4", + "fps": 30, + "height": 540, + "id": 9300233, + "link": "https://videos.pexels.com/video-files/3163534/3163534-sd_960_540_30fps.mp4", + "quality": "sd", + "size": 5670241, + "width": 960 + }, + { + "file_type": "video/mp4", + "fps": 30, + "height": 720, + "id": 9300277, + "link": "https://videos.pexels.com/video-files/3163534/3163534-hd_1280_720_30fps.mp4", + "quality": "hd", + "size": 10581309, + "width": 1280 + }, + { + "file_type": "video/mp4", + "fps": 30, + "height": 240, + "id": 9300304, + "link": "https://videos.pexels.com/video-files/3163534/3163534-sd_426_240_30fps.mp4", + "quality": "sd", + "size": 1257859, + "width": 426 + }, + { + "file_type": "video/mp4", + "fps": 30, + "height": 1080, + "id": 9300339, + "link": "https://videos.pexels.com/video-files/3163534/3163534-hd_1920_1080_30fps.mp4", + "quality": "hd", + "size": 21074997, + "width": 1920 + } + ], + "video_pictures": [ + { + "id": 560127, + "nr": 0, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-0.jpg" + }, + { + "id": 560128, + "nr": 1, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-1.jpg" + }, + { + "id": 560129, + "nr": 2, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-2.jpg" + }, + { + "id": 560130, + "nr": 3, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-3.jpg" + }, + { + "id": 560131, + "nr": 4, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-4.jpg" + }, + { + "id": 560132, + "nr": 5, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-5.jpg" + }, + { + "id": 560133, + "nr": 6, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-6.jpg" + }, + { + "id": 560134, + "nr": 7, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-7.jpg" + }, + { + "id": 560135, + "nr": 8, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-8.jpg" + }, + { + "id": 560136, + "nr": 9, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-9.jpg" + }, + { + "id": 560137, + "nr": 10, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-10.jpg" + }, + { + "id": 560138, + "nr": 11, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-11.jpg" + }, + { + "id": 560139, + "nr": 12, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-12.jpg" + }, + { + "id": 560140, + "nr": 13, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-13.jpg" + }, + { + "id": 560141, + "nr": 14, + "picture": "https://images.pexels.com/videos/3163534/pictures/preview-14.jpg" + } + ], + "width": 3840 }, { - "alt": "Two hikers standing atop a grassy hill in Scotland, captured in striking black and white.", - "avg_color": "#9C9C9C", - "height": 4530, - "id": 33777882, - "liked": false, - "photographer": "Phil Desforges", - "photographer_id": 1226422, - "photographer_url": "https://www.pexels.com/@storybyphil", - "src": { - "landscape": "https://images.pexels.com/photos/33777882/pexels-photo-33777882.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/33777882/pexels-photo-33777882.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/33777882/pexels-photo-33777882.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/33777882/pexels-photo-33777882.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/33777882/pexels-photo-33777882.jpeg", - "portrait": "https://images.pexels.com/photos/33777882/pexels-photo-33777882.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/33777882/pexels-photo-33777882.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/33777882/pexels-photo-33777882.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 86, + "full_res": null, + "height": 2160, + "id": 2169880, + "image": "https://images.pexels.com/videos/2169880/free-video-2169880.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/aerial-view-of-beautiful-resort-2169880/", + "user": { + "id": 3052, + "name": "Tom Fisk", + "url": "https://www.pexels.com/@tomfisk" }, - "url": "https://www.pexels.com/photo/stunning-black-and-white-hiking-scene-in-scotland-33777882/", - "width": 3624 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 1440, + "id": 9267134, + "link": "https://videos.pexels.com/video-files/2169880/2169880-uhd_2560_1440_30fps.mp4", + "quality": "uhd", + "size": 144250203, + "width": 2560 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 2160, + "id": 9267151, + "link": "https://videos.pexels.com/video-files/2169880/2169880-uhd_3840_2160_30fps.mp4", + "quality": "uhd", + "size": 238851967, + "width": 3840 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 1080, + "id": 9267165, + "link": "https://videos.pexels.com/video-files/2169880/2169880-hd_1920_1080_30fps.mp4", + "quality": "hd", + "size": 61016320, + "width": 1920 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 720, + "id": 9267181, + "link": "https://videos.pexels.com/video-files/2169880/2169880-hd_1280_720_30fps.mp4", + "quality": "hd", + "size": 31285838, + "width": 1280 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 540, + "id": 9267194, + "link": "https://videos.pexels.com/video-files/2169880/2169880-sd_960_540_30fps.mp4", + "quality": "sd", + "size": 17899436, + "width": 960 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 360, + "id": 9267199, + "link": "https://videos.pexels.com/video-files/2169880/2169880-sd_640_360_30fps.mp4", + "quality": "sd", + "size": 7066627, + "width": 640 + } + ], + "video_pictures": [ + { + "id": 232758, + "nr": 0, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-0.jpg" + }, + { + "id": 232759, + "nr": 1, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-1.jpg" + }, + { + "id": 232760, + "nr": 2, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-2.jpg" + }, + { + "id": 232761, + "nr": 3, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-3.jpg" + }, + { + "id": 232762, + "nr": 4, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-4.jpg" + }, + { + "id": 232763, + "nr": 5, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-5.jpg" + }, + { + "id": 232764, + "nr": 6, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-6.jpg" + }, + { + "id": 232765, + "nr": 7, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-7.jpg" + }, + { + "id": 232766, + "nr": 8, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-8.jpg" + }, + { + "id": 232767, + "nr": 9, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-9.jpg" + }, + { + "id": 232768, + "nr": 10, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-10.jpg" + }, + { + "id": 232769, + "nr": 11, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-11.jpg" + }, + { + "id": 232770, + "nr": 12, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-12.jpg" + }, + { + "id": 232771, + "nr": 13, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-13.jpg" + }, + { + "id": 232772, + "nr": 14, + "picture": "https://images.pexels.com/videos/2169880/pictures/preview-14.jpg" + } + ], + "width": 3840 }, { - "alt": "Silhouettes of two children playing indoors by a large window with a view of a ship in İstanbul.", - "avg_color": "#A4A4A4", - "height": 4209, - "id": 28319243, - "liked": false, - "photographer": "İrem Dur", - "photographer_id": 1175044181, - "photographer_url": "https://www.pexels.com/@i-rem-dur-1175044181", - "src": { - "landscape": "https://images.pexels.com/photos/28319243/pexels-photo-28319243.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/28319243/pexels-photo-28319243.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/28319243/pexels-photo-28319243.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/28319243/pexels-photo-28319243.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/28319243/pexels-photo-28319243.jpeg", - "portrait": "https://images.pexels.com/photos/28319243/pexels-photo-28319243.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/28319243/pexels-photo-28319243.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/28319243/pexels-photo-28319243.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 14, + "full_res": null, + "height": 1280, + "id": 857251, + "image": "https://images.pexels.com/videos/857251/free-video-857251.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/beautiful-timelapse-of-the-night-sky-with-reflections-in-a-lake-857251/", + "user": { + "id": 121938, + "name": "eberhard grossgasteiger", + "url": "https://www.pexels.com/@eberhardgross" }, - "url": "https://www.pexels.com/photo/two-people-are-walking-through-a-glass-door-28319243/", - "width": 6313 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 25, + "height": 360, + "id": 9256110, + "link": "https://videos.pexels.com/video-files/857251/857251-sd_540_360_25fps.mp4", + "quality": "sd", + "size": 757302, + "width": 540 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 1080, + "id": 9256123, + "link": "https://videos.pexels.com/video-files/857251/857251-hd_1620_1080_25fps.mp4", + "quality": "hd", + "size": 8673809, + "width": 1620 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 720, + "id": 9256134, + "link": "https://videos.pexels.com/video-files/857251/857251-hd_1080_720_25fps.mp4", + "quality": "hd", + "size": 4415136, + "width": 1080 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 540, + "id": 9256158, + "link": "https://videos.pexels.com/video-files/857251/857251-sd_810_540_25fps.mp4", + "quality": "sd", + "size": 1887175, + "width": 810 + } + ], + "video_pictures": [ + { + "id": 59354, + "nr": 0, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-0.jpg" + }, + { + "id": 59355, + "nr": 1, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-1.jpg" + }, + { + "id": 59356, + "nr": 2, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-2.jpg" + }, + { + "id": 59357, + "nr": 3, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-3.jpg" + }, + { + "id": 59358, + "nr": 4, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-4.jpg" + }, + { + "id": 59359, + "nr": 5, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-5.jpg" + }, + { + "id": 59360, + "nr": 6, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-6.jpg" + }, + { + "id": 59361, + "nr": 7, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-7.jpg" + }, + { + "id": 59362, + "nr": 8, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-8.jpg" + }, + { + "id": 59363, + "nr": 9, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-9.jpg" + }, + { + "id": 59364, + "nr": 10, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-10.jpg" + }, + { + "id": 59365, + "nr": 11, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-11.jpg" + }, + { + "id": 59366, + "nr": 12, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-12.jpg" + }, + { + "id": 59367, + "nr": 13, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-13.jpg" + }, + { + "id": 59368, + "nr": 14, + "picture": "https://images.pexels.com/videos/857251/pictures/preview-14.jpg" + } + ], + "width": 1920 }, { - "alt": "Delicate cherry blossoms captured in black and white, showcasing their elegant beauty in springtime.", - "avg_color": "#797979", - "height": 3089, - "id": 27661694, - "liked": false, - "photographer": "Anna Holodna", - "photographer_id": 237271098, - "photographer_url": "https://www.pexels.com/@holodna", - "src": { - "landscape": "https://images.pexels.com/photos/27661694/pexels-photo-27661694.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/27661694/pexels-photo-27661694.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/27661694/pexels-photo-27661694.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/27661694/pexels-photo-27661694.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/27661694/pexels-photo-27661694.jpeg", - "portrait": "https://images.pexels.com/photos/27661694/pexels-photo-27661694.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/27661694/pexels-photo-27661694.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/27661694/pexels-photo-27661694.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 14, + "full_res": null, + "height": 2304, + "id": 856973, + "image": "https://images.pexels.com/videos/856973/free-video-856973.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/time-lapse-video-sunset-856973/", + "user": { + "id": 2659, + "name": "Pixabay", + "url": "https://www.pexels.com/@pixabay" }, - "url": "https://www.pexels.com/photo/black-and-white-photograph-of-flowers-in-bloom-27661694/", - "width": 2048 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 25, + "height": 540, + "id": 9256634, + "link": "https://videos.pexels.com/video-files/856973/856973-sd_960_540_25fps.mp4", + "quality": "sd", + "size": 1397390, + "width": 960 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 1440, + "id": 9256676, + "link": "https://videos.pexels.com/video-files/856973/856973-uhd_2560_1440_25fps.mp4", + "quality": "uhd", + "size": 11038982, + "width": 2560 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 1080, + "id": 9256738, + "link": "https://videos.pexels.com/video-files/856973/856973-hd_1920_1080_25fps.mp4", + "quality": "hd", + "size": 6092783, + "width": 1920 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 360, + "id": 9256770, + "link": "https://videos.pexels.com/video-files/856973/856973-sd_640_360_25fps.mp4", + "quality": "sd", + "size": 614881, + "width": 640 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 2160, + "id": 9256820, + "link": "https://videos.pexels.com/video-files/856973/856973-uhd_3840_2160_25fps.mp4", + "quality": "uhd", + "size": 24947735, + "width": 3840 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 720, + "id": 9256871, + "link": "https://videos.pexels.com/video-files/856973/856973-hd_1280_720_25fps.mp4", + "quality": "hd", + "size": 2564119, + "width": 1280 + } + ], + "video_pictures": [ + { + "id": 58274, + "nr": 0, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-0.jpg" + }, + { + "id": 58275, + "nr": 1, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-1.jpg" + }, + { + "id": 58276, + "nr": 2, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-2.jpg" + }, + { + "id": 58277, + "nr": 3, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-3.jpg" + }, + { + "id": 58278, + "nr": 4, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-4.jpg" + }, + { + "id": 58279, + "nr": 5, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-5.jpg" + }, + { + "id": 58280, + "nr": 6, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-6.jpg" + }, + { + "id": 58281, + "nr": 7, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-7.jpg" + }, + { + "id": 58282, + "nr": 8, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-8.jpg" + }, + { + "id": 58283, + "nr": 9, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-9.jpg" + }, + { + "id": 58284, + "nr": 10, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-10.jpg" + }, + { + "id": 58285, + "nr": 11, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-11.jpg" + }, + { + "id": 58286, + "nr": 12, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-12.jpg" + }, + { + "id": 58287, + "nr": 13, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-13.jpg" + }, + { + "id": 58288, + "nr": 14, + "picture": "https://images.pexels.com/videos/856973/pictures/preview-14.jpg" + } + ], + "width": 4096 }, { - "alt": "Textured sand dunes in Monahans, Texas captured in striking black and white.", - "avg_color": "#8E8E8E", - "height": 6336, - "id": 37152401, - "liked": false, - "photographer": "Phil Evenden", - "photographer_id": 69038984, - "photographer_url": "https://www.pexels.com/@philevenphotos", - "src": { - "landscape": "https://images.pexels.com/photos/37152401/pexels-photo-37152401.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/37152401/pexels-photo-37152401.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/37152401/pexels-photo-37152401.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/37152401/pexels-photo-37152401.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/37152401/pexels-photo-37152401.jpeg", - "portrait": "https://images.pexels.com/photos/37152401/pexels-photo-37152401.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/37152401/pexels-photo-37152401.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/37152401/pexels-photo-37152401.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 36, + "full_res": null, + "height": 2160, + "id": 2098989, + "image": "https://images.pexels.com/videos/2098989/free-video-2098989.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/beauty-of-waterfalls-2098989/", + "user": { + "id": 631997, + "name": "Engin Akyurt", + "url": "https://www.pexels.com/@enginakyurt" }, - "url": "https://www.pexels.com/photo/monahans-sandhills-ripples-in-black-and-white-37152401/", - "width": 9504 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 720, + "id": 9266944, + "link": "https://videos.pexels.com/video-files/2098989/2098989-hd_1280_720_30fps.mp4", + "quality": "hd", + "size": 13457657, + "width": 1280 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 2160, + "id": 9266961, + "link": "https://videos.pexels.com/video-files/2098989/2098989-uhd_3840_2160_30fps.mp4", + "quality": "uhd", + "size": 112958753, + "width": 3840 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 1440, + "id": 9266988, + "link": "https://videos.pexels.com/video-files/2098989/2098989-uhd_2560_1440_30fps.mp4", + "quality": "uhd", + "size": 61812091, + "width": 2560 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 360, + "id": 9267011, + "link": "https://videos.pexels.com/video-files/2098989/2098989-sd_640_360_30fps.mp4", + "quality": "sd", + "size": 3019408, + "width": 640 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 1080, + "id": 9267040, + "link": "https://videos.pexels.com/video-files/2098989/2098989-hd_1920_1080_30fps.mp4", + "quality": "hd", + "size": 26098035, + "width": 1920 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 540, + "id": 9267060, + "link": "https://videos.pexels.com/video-files/2098989/2098989-sd_960_540_30fps.mp4", + "quality": "sd", + "size": 7770367, + "width": 960 + } + ], + "video_pictures": [ + { + "id": 222873, + "nr": 0, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-0.jpg" + }, + { + "id": 222874, + "nr": 1, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-1.jpg" + }, + { + "id": 222875, + "nr": 2, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-2.jpg" + }, + { + "id": 222876, + "nr": 3, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-3.jpg" + }, + { + "id": 222877, + "nr": 4, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-4.jpg" + }, + { + "id": 222878, + "nr": 5, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-5.jpg" + }, + { + "id": 222879, + "nr": 6, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-6.jpg" + }, + { + "id": 222880, + "nr": 7, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-7.jpg" + }, + { + "id": 222881, + "nr": 8, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-8.jpg" + }, + { + "id": 222882, + "nr": 9, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-9.jpg" + }, + { + "id": 222883, + "nr": 10, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-10.jpg" + }, + { + "id": 222884, + "nr": 11, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-11.jpg" + }, + { + "id": 222885, + "nr": 12, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-12.jpg" + }, + { + "id": 222886, + "nr": 13, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-13.jpg" + }, + { + "id": 222887, + "nr": 14, + "picture": "https://images.pexels.com/videos/2098989/pictures/preview-14.jpg" + } + ], + "width": 3840 }, { - "alt": "Black and white photo of a bicycle leaning against a brick building in Copenhagen.", - "avg_color": "#707070", - "height": 3918, - "id": 20643887, - "liked": false, - "photographer": "Mihai Vlasceanu", - "photographer_id": 602123, - "photographer_url": "https://www.pexels.com/@vlasceanu", - "src": { - "landscape": "https://images.pexels.com/photos/20643887/pexels-photo-20643887.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/20643887/pexels-photo-20643887.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/20643887/pexels-photo-20643887.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/20643887/pexels-photo-20643887.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/20643887/pexels-photo-20643887.jpeg", - "portrait": "https://images.pexels.com/photos/20643887/pexels-photo-20643887.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/20643887/pexels-photo-20643887.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/20643887/pexels-photo-20643887.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 8, + "full_res": null, + "height": 1080, + "id": 1093662, + "image": "https://images.pexels.com/videos/1093662/free-video-1093662.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/water-crashing-over-the-rocks-1093662/", + "user": { + "id": 417939, + "name": "Peter Fowler", + "url": "https://www.pexels.com/@peter-fowler-417939" }, - "url": "https://www.pexels.com/photo/bicycle-near-building-wall-in-black-and-white-20643887/", - "width": 5602 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 30, + "height": 720, + "id": 9259320, + "link": "https://videos.pexels.com/video-files/1093662/1093662-hd_1280_720_30fps.mp4", + "quality": "hd", + "size": 2741411, + "width": 1280 + }, + { + "file_type": "video/mp4", + "fps": 30, + "height": 1080, + "id": 9259347, + "link": "https://videos.pexels.com/video-files/1093662/1093662-hd_1920_1080_30fps.mp4", + "quality": "hd", + "size": 5195621, + "width": 1920 + }, + { + "file_type": "video/mp4", + "fps": 30, + "height": 360, + "id": 9259384, + "link": "https://videos.pexels.com/video-files/1093662/1093662-sd_640_360_30fps.mp4", + "quality": "sd", + "size": 615155, + "width": 640 + }, + { + "file_type": "video/mp4", + "fps": 30, + "height": 540, + "id": 9259415, + "link": "https://videos.pexels.com/video-files/1093662/1093662-sd_960_540_30fps.mp4", + "quality": "sd", + "size": 1717678, + "width": 960 + } + ], + "video_pictures": [ + { + "id": 79696, + "nr": 0, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-0.jpg" + }, + { + "id": 79697, + "nr": 1, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-1.jpg" + }, + { + "id": 79698, + "nr": 2, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-2.jpg" + }, + { + "id": 79699, + "nr": 3, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-3.jpg" + }, + { + "id": 79700, + "nr": 4, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-4.jpg" + }, + { + "id": 79701, + "nr": 5, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-5.jpg" + }, + { + "id": 79702, + "nr": 6, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-6.jpg" + }, + { + "id": 79703, + "nr": 7, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-7.jpg" + }, + { + "id": 79704, + "nr": 8, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-8.jpg" + }, + { + "id": 79705, + "nr": 9, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-9.jpg" + }, + { + "id": 79706, + "nr": 10, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-10.jpg" + }, + { + "id": 79707, + "nr": 11, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-11.jpg" + }, + { + "id": 79708, + "nr": 12, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-12.jpg" + }, + { + "id": 79709, + "nr": 13, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-13.jpg" + }, + { + "id": 79710, + "nr": 14, + "picture": "https://images.pexels.com/videos/1093662/pictures/preview-14.jpg" + } + ], + "width": 1920 }, { - "alt": "A contemplative moment captured at a park in Honolulu with silhouetted trees and a bench.", - "avg_color": "#36332E", - "height": 5762, - "id": 37134995, - "liked": false, - "photographer": "Roy Serafin", - "photographer_id": 2157973447, - "photographer_url": "https://www.pexels.com/@roythephotographer", - "src": { - "landscape": "https://images.pexels.com/photos/37134995/pexels-photo-37134995.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/37134995/pexels-photo-37134995.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/37134995/pexels-photo-37134995.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/37134995/pexels-photo-37134995.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/37134995/pexels-photo-37134995.jpeg", - "portrait": "https://images.pexels.com/photos/37134995/pexels-photo-37134995.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/37134995/pexels-photo-37134995.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/37134995/pexels-photo-37134995.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 7, + "full_res": null, + "height": 720, + "id": 857195, + "image": "https://images.pexels.com/videos/857195/free-video-857195.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/time-lapse-video-of-night-sky-857195/", + "user": { + "id": 290933, + "name": "Vimeo", + "url": "https://www.pexels.com/@vimeo" }, - "url": "https://www.pexels.com/photo/serene-silhouette-in-honolulu-park-37134995/", - "width": 3839 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 25, + "height": 360, + "id": 9253257, + "link": "https://videos.pexels.com/video-files/857195/857195-sd_640_360_25fps.mp4", + "quality": "sd", + "size": 413131, + "width": 640 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 540, + "id": 9253297, + "link": "https://videos.pexels.com/video-files/857195/857195-sd_960_540_25fps.mp4", + "quality": "sd", + "size": 1248736, + "width": 960 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 720, + "id": 9253310, + "link": "https://videos.pexels.com/video-files/857195/857195-hd_1280_720_25fps.mp4", + "quality": "hd", + "size": 2076845, + "width": 1280 + } + ], + "video_pictures": [ + { + "id": 12841, + "nr": 0, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-0.jpg" + }, + { + "id": 12842, + "nr": 1, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-1.jpg" + }, + { + "id": 12843, + "nr": 2, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-2.jpg" + }, + { + "id": 12844, + "nr": 3, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-3.jpg" + }, + { + "id": 12845, + "nr": 4, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-4.jpg" + }, + { + "id": 12846, + "nr": 5, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-5.jpg" + }, + { + "id": 12847, + "nr": 6, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-6.jpg" + }, + { + "id": 12848, + "nr": 7, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-7.jpg" + }, + { + "id": 12849, + "nr": 8, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-8.jpg" + }, + { + "id": 12850, + "nr": 9, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-9.jpg" + }, + { + "id": 12851, + "nr": 10, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-10.jpg" + }, + { + "id": 12852, + "nr": 11, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-11.jpg" + }, + { + "id": 12853, + "nr": 12, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-12.jpg" + }, + { + "id": 12854, + "nr": 13, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-13.jpg" + }, + { + "id": 12855, + "nr": 14, + "picture": "https://images.pexels.com/videos/857195/pictures/preview-14.jpg" + } + ], + "width": 1280 }, { - "alt": "Panoramic view of rugged cliffs and ocean in La Gomera, showcasing dramatic landscapes.", - "avg_color": "#6E7C7F", - "height": 6000, - "id": 34145802, - "liked": false, - "photographer": "Liisbet Luup", - "photographer_id": 121486327, - "photographer_url": "https://www.pexels.com/@liisbet-luup-121486327", - "src": { - "landscape": "https://images.pexels.com/photos/34145802/pexels-photo-34145802.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/34145802/pexels-photo-34145802.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/34145802/pexels-photo-34145802.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/34145802/pexels-photo-34145802.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/34145802/pexels-photo-34145802.jpeg", - "portrait": "https://images.pexels.com/photos/34145802/pexels-photo-34145802.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/34145802/pexels-photo-34145802.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/34145802/pexels-photo-34145802.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 64, + "full_res": null, + "height": 4096, + "id": 5329239, + "image": "https://images.pexels.com/videos/5329239/pexels-photo-5329239.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=630", + "tags": [], + "url": "https://www.pexels.com/video/couple-talking-to-each-other-while-standing-near-their-pickup-truck-5329239/", + "user": { + "id": 1437723, + "name": "cottonbro studio", + "url": "https://www.pexels.com/@cottonbro" }, - "url": "https://www.pexels.com/photo/dramatic-cliffs-and-ocean-view-canary-islands-34145802/", - "width": 4000 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 25, + "height": 4096, + "id": 9670052, + "link": "https://videos.pexels.com/video-files/5329239/5329239-uhd_2160_4096_25fps.mp4", + "quality": "uhd", + "size": 172177024, + "width": 2160 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 2048, + "id": 9670096, + "link": "https://videos.pexels.com/video-files/5329239/5329239-hd_1080_2048_25fps.mp4", + "quality": "hd", + "size": 37972177, + "width": 1080 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 1366, + "id": 9670148, + "link": "https://videos.pexels.com/video-files/5329239/5329239-hd_720_1366_25fps.mp4", + "quality": "hd", + "size": 19813118, + "width": 720 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 2732, + "id": 9670211, + "link": "https://videos.pexels.com/video-files/5329239/5329239-uhd_1440_2732_25fps.mp4", + "quality": "uhd", + "size": 92829147, + "width": 1440 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 960, + "id": 9670292, + "link": "https://videos.pexels.com/video-files/5329239/5329239-sd_506_960_25fps.mp4", + "quality": "sd", + "size": 10089742, + "width": 506 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 426, + "id": 9670377, + "link": "https://videos.pexels.com/video-files/5329239/5329239-sd_226_426_25fps.mp4", + "quality": "sd", + "size": 2203778, + "width": 226 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 640, + "id": 9670438, + "link": "https://videos.pexels.com/video-files/5329239/5329239-sd_338_640_25fps.mp4", + "quality": "sd", + "size": 3499554, + "width": 338 + } + ], + "video_pictures": [ + { + "id": 2656217, + "nr": 0, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-0.jpeg" + }, + { + "id": 2656228, + "nr": 1, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-1.jpeg" + }, + { + "id": 2656236, + "nr": 2, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-2.jpeg" + }, + { + "id": 2656245, + "nr": 3, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-3.jpeg" + }, + { + "id": 2656250, + "nr": 4, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-4.jpeg" + }, + { + "id": 2656260, + "nr": 5, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-5.jpeg" + }, + { + "id": 2656268, + "nr": 6, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-6.jpeg" + }, + { + "id": 2656276, + "nr": 7, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-7.jpeg" + }, + { + "id": 2656282, + "nr": 8, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-8.jpeg" + }, + { + "id": 2656288, + "nr": 9, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-9.jpeg" + }, + { + "id": 2656292, + "nr": 10, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-10.jpeg" + }, + { + "id": 2656298, + "nr": 11, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-11.jpeg" + }, + { + "id": 2656301, + "nr": 12, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-12.jpeg" + }, + { + "id": 2656305, + "nr": 13, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-13.jpeg" + }, + { + "id": 2656306, + "nr": 14, + "picture": "https://images.pexels.com/videos/5329239/pictures/preview-14.jpeg" + } + ], + "width": 2160 }, { - "alt": "Lush pine trees in a tranquil forest setting, capturing the beauty of Finnish nature.", - "avg_color": "#6B645A", - "height": 3637, - "id": 38101841, - "liked": false, - "photographer": "Alice Tran", - "photographer_id": 2162267306, - "photographer_url": "https://www.pexels.com/@alice-tran-2162267306", - "src": { - "landscape": "https://images.pexels.com/photos/38101841/pexels-photo-38101841.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/38101841/pexels-photo-38101841.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/38101841/pexels-photo-38101841.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/38101841/pexels-photo-38101841.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/38101841/pexels-photo-38101841.jpeg", - "portrait": "https://images.pexels.com/photos/38101841/pexels-photo-38101841.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/38101841/pexels-photo-38101841.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/38101841/pexels-photo-38101841.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 17, + "full_res": null, + "height": 4096, + "id": 4057252, + "image": "https://images.pexels.com/videos/4057252/pexels-photo-4057252.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=630", + "tags": [], + "url": "https://www.pexels.com/video/woman-feet-legs-girl-4057252/", + "user": { + "id": 1437723, + "name": "cottonbro studio", + "url": "https://www.pexels.com/@cottonbro" }, - "url": "https://www.pexels.com/photo/serene-pine-forest-in-finnish-wilderness-38101841/", - "width": 2433 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 25, + "height": 2048, + "id": 9343097, + "link": "https://videos.pexels.com/video-files/4057252/4057252-hd_1080_2048_25fps.mp4", + "quality": "hd", + "size": 7930382, + "width": 1080 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 2732, + "id": 9343159, + "link": "https://videos.pexels.com/video-files/4057252/4057252-uhd_1440_2732_25fps.mp4", + "quality": "uhd", + "size": 14878864, + "width": 1440 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 4096, + "id": 9343203, + "link": "https://videos.pexels.com/video-files/4057252/4057252-uhd_2160_4096_25fps.mp4", + "quality": "uhd", + "size": 39868941, + "width": 2160 + }, + { + "file_type": "video/mp4", + "fps": 50, + "height": 1366, + "id": 9343248, + "link": "https://videos.pexels.com/video-files/4057252/4057252-hd_720_1366_50fps.mp4", + "quality": "hd", + "size": 3846682, + "width": 720 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 640, + "id": 9343349, + "link": "https://videos.pexels.com/video-files/4057252/4057252-sd_338_640_25fps.mp4", + "quality": "sd", + "size": 938017, + "width": 338 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 426, + "id": 9343443, + "link": "https://videos.pexels.com/video-files/4057252/4057252-sd_226_426_25fps.mp4", + "quality": "sd", + "size": 552724, + "width": 226 + }, + { + "file_type": "video/mp4", + "fps": 25, + "height": 960, + "id": 9343536, + "link": "https://videos.pexels.com/video-files/4057252/4057252-sd_506_960_25fps.mp4", + "quality": "sd", + "size": 1834003, + "width": 506 + } + ], + "video_pictures": [ + { + "id": 1105623, + "nr": 0, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-0.jpeg" + }, + { + "id": 1105627, + "nr": 1, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-1.jpeg" + }, + { + "id": 1105634, + "nr": 2, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-2.jpeg" + }, + { + "id": 1105644, + "nr": 3, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-3.jpeg" + }, + { + "id": 1105650, + "nr": 4, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-4.jpeg" + }, + { + "id": 1105660, + "nr": 5, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-5.jpeg" + }, + { + "id": 1105671, + "nr": 6, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-6.jpeg" + }, + { + "id": 1105680, + "nr": 7, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-7.jpeg" + }, + { + "id": 1105688, + "nr": 8, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-8.jpeg" + }, + { + "id": 1105696, + "nr": 9, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-9.jpeg" + }, + { + "id": 1105703, + "nr": 10, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-10.jpeg" + }, + { + "id": 1105709, + "nr": 11, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-11.jpeg" + }, + { + "id": 1105717, + "nr": 12, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-12.jpeg" + }, + { + "id": 1105722, + "nr": 13, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-13.jpeg" + }, + { + "id": 1105732, + "nr": 14, + "picture": "https://images.pexels.com/videos/4057252/pictures/preview-14.jpeg" + } + ], + "width": 2160 }, { - "alt": "A scenic aerial view of boats anchored in a tranquil blue bay surrounded by lush hills.", - "avg_color": "#3B6571", - "height": 7008, - "id": 33802711, - "liked": false, - "photographer": "Sueda Dilli", - "photographer_id": 143459271, - "photographer_url": "https://www.pexels.com/@suedadilli", - "src": { - "landscape": "https://images.pexels.com/photos/33802711/pexels-photo-33802711.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", - "large": "https://images.pexels.com/photos/33802711/pexels-photo-33802711.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", - "large2x": "https://images.pexels.com/photos/33802711/pexels-photo-33802711.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", - "medium": "https://images.pexels.com/photos/33802711/pexels-photo-33802711.jpeg?auto=compress&cs=tinysrgb&h=350", - "original": "https://images.pexels.com/photos/33802711/pexels-photo-33802711.jpeg", - "portrait": "https://images.pexels.com/photos/33802711/pexels-photo-33802711.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", - "small": "https://images.pexels.com/photos/33802711/pexels-photo-33802711.jpeg?auto=compress&cs=tinysrgb&h=130", - "tiny": "https://images.pexels.com/photos/33802711/pexels-photo-33802711.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" + "avg_color": null, + "duration": 9, + "full_res": null, + "height": 1080, + "id": 1580455, + "image": "https://images.pexels.com/videos/1580455/free-video-1580455.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", + "tags": [], + "url": "https://www.pexels.com/video/autumn-season-1580455/", + "user": { + "id": 43782, + "name": "David Bartus", + "url": "https://www.pexels.com/@david-bartus-43782" }, - "url": "https://www.pexels.com/photo/serene-aerial-view-of-boats-in-a-blue-bay-33802711/", - "width": 4672 + "video_files": [ + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 540, + "id": 9263735, + "link": "https://videos.pexels.com/video-files/1580455/1580455-sd_960_540_30fps.mp4", + "quality": "sd", + "size": 1681254, + "width": 960 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 360, + "id": 9263770, + "link": "https://videos.pexels.com/video-files/1580455/1580455-sd_640_360_30fps.mp4", + "quality": "sd", + "size": 656085, + "width": 640 + }, + { + "file_type": "video/mp4", + "fps": 29.97, + "height": 1080, + "id": 9263806, + "link": "https://videos.pexels.com/video-files/1580455/1580455-hd_1920_1080_30fps.mp4", + "quality": "hd", + "size": 5315793, + "width": 1920 + }, + { + "file_type": "video/mp4", + "fps": 59.94, + "height": 720, + "id": 9263872, + "link": "https://videos.pexels.com/video-files/1580455/1580455-hd_1280_720_60fps.mp4", + "quality": "hd", + "size": 2786760, + "width": 1280 + } + ], + "video_pictures": [ + { + "id": 147712, + "nr": 0, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-0.jpg" + }, + { + "id": 147713, + "nr": 1, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-1.jpg" + }, + { + "id": 147714, + "nr": 2, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-2.jpg" + }, + { + "id": 147715, + "nr": 3, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-3.jpg" + }, + { + "id": 147716, + "nr": 4, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-4.jpg" + }, + { + "id": 147717, + "nr": 5, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-5.jpg" + }, + { + "id": 147718, + "nr": 6, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-6.jpg" + }, + { + "id": 147719, + "nr": 7, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-7.jpg" + }, + { + "id": 147720, + "nr": 8, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-8.jpg" + }, + { + "id": 147721, + "nr": 9, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-9.jpg" + }, + { + "id": 147722, + "nr": 10, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-10.jpg" + }, + { + "id": 147723, + "nr": 11, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-11.jpg" + }, + { + "id": 147724, + "nr": 12, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-12.jpg" + }, + { + "id": 147725, + "nr": 13, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-13.jpg" + }, + { + "id": 147726, + "nr": 14, + "picture": "https://images.pexels.com/videos/1580455/pictures/preview-14.jpg" + } + ], + "width": 1920 } - ], - "total_results": 64520 + ] } \ No newline at end of file diff --git a/KomplexHubPlugin/common/videocache.h b/KomplexHubPlugin/common/videocache.h new file mode 100644 index 0000000..ba5dd9b --- /dev/null +++ b/KomplexHubPlugin/common/videocache.h @@ -0,0 +1,77 @@ +#ifndef VIDEOCACHE_H +#define VIDEOCACHE_H + +#include "komplex_global.h" + +#include + +struct KOMPLEX_EXPORT VideoEntry +{ + QString type; + qint64 fps = std::numeric_limits::infinity(); + qint64 height = std::numeric_limits::infinity(); + qint64 width = std::numeric_limits::infinity(); + qint64 size = std::numeric_limits::infinity(); + qint64 id = std::numeric_limits::infinity(); + QString url; + QString quality; + + auto operator == (const VideoEntry &other) const -> bool + { + return ( + other.fps == fps && + other.height == height && + other.id == id && + other.quality == quality && + other.size == size && + other.type == type && + other.url == url && + other.width == width + ); + } + + auto operator != (const VideoEntry &other) const -> bool + { + return !(other == *this); + } +}; +Q_DECLARE_METATYPE(VideoEntry) + +struct KOMPLEX_EXPORT VideoCache +{ + QString averageColor; + qint64 duration = std::numeric_limits::infinity(); + qint64 height = std::numeric_limits::infinity(); + qint64 width = std::numeric_limits::infinity(); + qint64 id = std::numeric_limits::infinity(); + QString thumbnail; + QString url; + QString author; + QString authorUrl; + qint64 authorId; + QList files; + + auto operator == (const VideoCache &other) const -> bool + { + return ( + other.averageColor == averageColor && + other.duration == duration && + other.height == height && + other.width == width && + other.id == id && + other.thumbnail == thumbnail && + other.url == url && + other.author == author && + other.authorUrl == authorUrl && + other.authorId == authorId && + other.files == files + ); + } + + auto operator != (const VideoCache &other) const -> bool + { + return !(other == *this); + } +}; + +#endif // VIDEOCACHE_H diff --git a/KomplexHubPlugin/featuredvideosmodel.cpp b/KomplexHubPlugin/featuredvideosmodel.cpp index 2eeb4bc..c4897e0 100644 --- a/KomplexHubPlugin/featuredvideosmodel.cpp +++ b/KomplexHubPlugin/featuredvideosmodel.cpp @@ -1,5 +1,5 @@ #include "featuredvideosmodel.h" -#include "common/wallpapercache.h" +#include "common/videocache.h" FeaturedVideosModel::FeaturedVideosModel(QObject *parent) : QAbstractListModel{parent} { @@ -59,46 +59,40 @@ auto FeaturedVideosModel::data(const QModelIndex &index, int role) const -> QVar return {}; } - WallpaperCache dataPoint = m_data.at(index.row()); + VideoCache dataPoint = m_data.at(index.row()); QVariant data; switch(static_cast(role)) { case UuidRole: - data = dataPoint.uuid; + data = dataPoint.id; break; case AuthorRole: data = dataPoint.author; break; - case DescriptionRole: - data = dataPoint.description; + case AuthorIdRole: + data = dataPoint.authorId; break; - case NameRole: - data = dataPoint.name; + case AuthorUrlRole: + data = dataPoint.authorUrl; + break; + case DurationRole: + data = dataPoint.duration; break; case ThumbnailRole: data = dataPoint.thumbnail; break; - case CreatedDateRole: - data = dataPoint.createdDate; + case UrlRole: + data = dataPoint.url; break; - case AuthorIdRole: - data = dataPoint.authorId; + case HeightRole: + data = dataPoint.height; break; - case PriceRole: - data = dataPoint.price; + case WidthRole: + data = dataPoint.width; break; - case CurrencyRole: - data = dataPoint.currency; - break; - case DownloadCountRole: - data = dataPoint.downloadCount; - break; - case TypeRole: - data = dataPoint.type; - break; - } + } return data; } @@ -160,7 +154,7 @@ auto FeaturedVideosModel::resetDataModel() -> void beginInsertRows(QModelIndex(), 0, m_paginator->count() - 1); auto dataset = m_paginator->data(); - for(const WallpaperCache& data : std::as_const(dataset)) + for(const VideoCache& data : std::as_const(dataset)) { m_data.append(data); } diff --git a/KomplexHubPlugin/featuredvideosmodel.h b/KomplexHubPlugin/featuredvideosmodel.h index 9b800ce..b1d904d 100644 --- a/KomplexHubPlugin/featuredvideosmodel.h +++ b/KomplexHubPlugin/featuredvideosmodel.h @@ -65,14 +65,12 @@ public: UuidRole = Qt::UserRole + 1, AuthorRole, AuthorIdRole, - DescriptionRole, - NameRole, + AuthorUrlRole, + DurationRole, ThumbnailRole, - CreatedDateRole, - PriceRole, - CurrencyRole, - DownloadCountRole, - TypeRole + UrlRole, + HeightRole, + WidthRole }; Q_ENUM(DataRole) @@ -251,36 +249,28 @@ private: QByteArray("authorId") }, { - static_cast(DescriptionRole), - QByteArray("description") + static_cast(AuthorUrlRole), + QByteArray("authorUrl") }, { - static_cast(NameRole), - QByteArray("name") + static_cast(DurationRole), + QByteArray("duration") }, { static_cast(ThumbnailRole), QByteArray("thumbnail") }, { - static_cast(CreatedDateRole), - QByteArray("createdDate") + static_cast(UrlRole), + QByteArray("url") }, { - static_cast(PriceRole), - QByteArray("price") + static_cast(HeightRole), + QByteArray("height") }, { - static_cast(CurrencyRole), - QByteArray("currency") - }, - { - static_cast(DownloadCountRole), - QByteArray("downloadCount") - }, - { - static_cast(TypeRole), - QByteArray("type") + static_cast(WidthRole), + QByteArray("width") } }; State m_state = Idle; @@ -289,7 +279,7 @@ private: FeaturedVideosPaginator *m_paginator = nullptr; - mutable QList m_data; + mutable QList m_data; Q_PROPERTY(State state READ state WRITE setState RESET resetState NOTIFY stateChanged FINAL) Q_PROPERTY(QString errorString READ errorString WRITE setErrorString NOTIFY errorStringChanged FINAL) diff --git a/KomplexHubPlugin/paginators/featuredvideospaginator.h b/KomplexHubPlugin/paginators/featuredvideospaginator.h index d25c658..f06ac77 100644 --- a/KomplexHubPlugin/paginators/featuredvideospaginator.h +++ b/KomplexHubPlugin/paginators/featuredvideospaginator.h @@ -29,12 +29,12 @@ #include #include -#include "wallpaperpaginator.h" +#include "videopaginator.h" -class KOMPLEX_EXPORT FeaturedVideosPaginator : public WallpaperPaginator +class KOMPLEX_EXPORT FeaturedVideosPaginator : public VideoPaginator { public: - explicit FeaturedVideosPaginator(QObject *parent = nullptr) : WallpaperPaginator(parent) + explicit FeaturedVideosPaginator(QObject *parent = nullptr) : VideoPaginator(parent) { setUri( QString::fromUtf8(KOMPLEX_ENDPOINT_VIDEOS_FEATURED) diff --git a/KomplexHubPlugin/paginators/videopaginator.h b/KomplexHubPlugin/paginators/videopaginator.h new file mode 100644 index 0000000..2dd9b1c --- /dev/null +++ b/KomplexHubPlugin/paginators/videopaginator.h @@ -0,0 +1,335 @@ +/* + * Komplex Wallpaper Engine + * Copyright (C) 2026 @DigitalArtifex + * https://digitalartifex.dev - https://github.com/DigitalArtifex + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ +#ifndef VIDEOPAGINATOR_H +#define VIDEOPAGINATOR_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common/logging.h" +#include "common/paginator.h" +#include "common/videocache.h" +#include "common/coreservices.h" + +/** + * @brief The VideoPaginator class + * Most of the media endpoints for the Komplex API have the same data structure so + * child classes can make use of this generic controller where possible + */ +class KOMPLEX_EXPORT VideoPaginator : public Paginator +{ + Q_OBJECT +public: + explicit VideoPaginator(QObject *parent = nullptr) : Paginator(parent) + { + SlidingCacheController *controller = this->controller(); + controller->setFetch( + std::bind(&VideoPaginator::fetch, this, std::placeholders::_1, std::placeholders::_2) + ); + } + + /** + * @brief uri + * URI of the API Endpoint. This is set by the child class + * @return + */ + [[nodiscard]] + auto uri() const -> QString + { + return m_uri; + } + + /** + * @brief query + * Current query string, if the API Endpoint supports queries + * @return + */ + [[nodiscard]] + auto query() const -> QString + { + return m_query; + } + + /** + * @brief setQuery + * Sets the new query string and updates the controller + * @param query + */ + auto setQuery(const QString &query) -> void + { + if(query == m_query) + { + return; + } + + m_query = query; + Q_EMIT queryChanged(); + + reset(); + setOffset(0); + } + +signals: + /** + * @brief uriChanged + */ + auto uriChanged() -> void; + + /** + * @brief queryChanged + */ + auto queryChanged() -> void; + +protected: + /** + * @brief fetch + * Used to fetch results from the API endpoint + * for the CacheController. It is intended to be passed + * to the Cache Controller not meant to be called directly. + * @param offset Offset index to start the results from + * @param limit Number of results to attempt to fetch + * @return FetchResult + */ + [[nodiscard]] + auto fetch( + qsizetype offset, + qsizetype limit + ) const -> FetchResult + { + LOG_ERROR_X(m_uri.isEmpty(), + "VideoPaginator::fetch", + "Uri not set", + {} + ); + + QUrl url( + QString::fromUtf8("%1/%2/%3").arg( + KOMPLEX_API_HOST, + KOMPLEX_API_VERSION, + m_uri + ) + ); + + QNetworkRequest request(url); + request.setHeaders( + QHttpHeaders::fromMultiMap( + { + { + QByteArray("query"), + m_query.toUtf8() + }, + { + QByteArray("offset"), + QString::number(offset).toUtf8() + }, + { + QByteArray("limit"), + QString::number(limit).toUtf8() + }, + { + QByteArray("session_token"), + CoreServices::sessionToken() + } + } + ) + ); + + QNetworkReply *reply = getNetworkReply(request); + + if(reply == nullptr) + { + return {}; + } + + QJsonDocument document = getDocument(reply); + + QJsonObject rootObject = document.object(); + const QJsonArray resultsArray = rootObject.value(QString::fromUtf8("videos")).toArray(); + + QList fetchedResults; + + for(const QJsonValue &result : resultsArray) + { + if(!result.isObject()) + { + continue; + } + + QJsonObject resultObject = result.toObject(); + + QJsonObject userObject = resultObject.value(QString::fromUtf8("user")).toObject(); + QList videos; + const QJsonArray videosArray = resultObject.value(QString::fromUtf8("video_files")).toArray(); + + for(const QJsonValue &entry : videosArray) + { + if(!entry.isObject()) + { + continue; + } + + QJsonObject videoObject = entry.toObject(); + + videos.append + ( + { + videoObject.value(QString::fromUtf8("file_type")).toString(), + videoObject.value(QString::fromUtf8("fps")).toInteger(), + videoObject.value(QString::fromUtf8("height")).toInteger(), + videoObject.value(QString::fromUtf8("width")).toInteger(), + videoObject.value(QString::fromUtf8("size")).toInteger(), + videoObject.value(QString::fromUtf8("id")).toInteger(), + videoObject.value(QString::fromUtf8("link")).toString(), + videoObject.value(QString::fromUtf8("quality")).toString() + } + ); + } + + fetchedResults.append + ( + { + resultObject.value(QString::fromUtf8("avg_color")).toString(), + resultObject.value(QString::fromUtf8("duration")).toInteger(), + resultObject.value(QString::fromUtf8("height")).toInteger(), + resultObject.value(QString::fromUtf8("width")).toInteger(), + resultObject.value(QString::fromUtf8("id")).toInteger(), + resultObject.value(QString::fromUtf8("image")).toString(), + resultObject.value(QString::fromUtf8("url")).toString(), + userObject.value(QString::fromUtf8("name")).toString(), + userObject.value(QString::fromUtf8("url")).toString(), + userObject.value(QString::fromUtf8("id")).toInteger(), + std::move(videos) + } + ); + } + + FetchResult result + { + static_cast(rootObject.value(QString::fromUtf8("total_results")).toInteger()), + fetchedResults.count(), + std::move(fetchedResults) + }; + + return std::move(result); + } + + /** + * @brief getNetworkReply + * Processes the request and blocks until completion. + * @param request + * @return + */ + [[nodiscard]] + auto getNetworkReply(const QNetworkRequest &request) const -> QNetworkReply* + { + QEventLoop loop; + QWeakPointer managerReference = CoreServices::networkAccessManager(); + + QSharedPointer manager = managerReference.toStrongRef(); + + LOG_ERROR_X(!manager, + "NewestPacksPaginator::getNetworkReply", + "Network manager reference has already been deleted", + nullptr + ); + + QNetworkReply *reply = manager->post(request, nullptr); + QObject::connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit); + QObject::connect(reply, &QNetworkReply::errorOccurred, &loop, + [&loop](QNetworkReply::NetworkError error) -> void + { + loop.quit(); + } + ); + + if(!reply->isFinished()) + { + loop.exec(); + } + + LOG_ERROR_X(reply->error() != QNetworkReply::NoError, + "NewestPacksPaginator::getNetworkReply", + reply->errorString().toStdString().c_str(), + nullptr + ); + + return reply; + } + + /** + * @brief getDocument + * Extracts the JSON document from the server reply + * @param reply + * @return + */ + [[nodiscard]] + auto getDocument(QNetworkReply *reply) const -> QJsonDocument + { + QByteArray data = reply->readAll(); + QJsonParseError documentError; + QJsonDocument document = QJsonDocument::fromJson(data, &documentError); + + LOG_ERROR_X(documentError.error != QJsonParseError::NoError, + "NewestPacksPaginator::getDocument", + documentError.errorString().toStdString().c_str(), + {} + ); + + return document; + } + + /** + * @brief setUri + * Sets the API Endpoint URI to fetch from + * @param uri + */ + auto setUri(const QString &uri) -> void + { + if(uri == m_uri) + { + return; + } + + m_uri = uri; + + Q_EMIT uriChanged(); + } + +private: + /** + * @brief m_uri + * API Endpoint URI + */ + QString m_uri; + + /** + * @brief m_query + * The query string used in fetch operations + */ + QString m_query; +}; + +#endif // VIDEOPAGINATOR_H