feat: resolve HTTP video URLs with bundled yt-dlp
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user