feat: resolve HTTP video URLs with bundled yt-dlp

This commit is contained in:
2026-10-22 17:05:29 +02:00
parent 6a4afc9f0e
commit b132bab393
14 changed files with 121 additions and 79 deletions
+4 -3
View File
@@ -6,9 +6,7 @@
#include <arpa/inet.h>
namespace playback {
inline bool validNetworkURL(const char *text) {
if (!text) return false;
const std::string_view url(text);
inline bool validNetworkURL(std::string_view url) {
if (url.size() > 65536) return false;
const std::size_t start = url.starts_with("https://") ? 8 : url.starts_with("http://") ? 7 : 0;
if (!start) return false;
@@ -52,6 +50,9 @@ inline bool validNetworkURL(const char *text) {
}
return port.empty() || number > 0;
}
inline bool validNetworkURL(const char *text) {
return text && validNetworkURL(std::string_view(text));
}
inline bool validHeaders(const char *text) {
if (!text) return true;
const std::string_view headers(text);