aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-22 16:07:20 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-22 16:07:20 +0200
commite4792f46d545263d16db21bd0caf71345a69b63f (patch)
treee12c1d01060e6559b17c0928363446b4e49b3232 /include
parente5518e0d876287d047312a59263d35bd567b2c0c (diff)
Only do youtube redirect on failure to load video
Diffstat (limited to 'include')
-rw-r--r--include/DownloadUtils.hpp2
-rw-r--r--include/VideoPlayer.hpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/include/DownloadUtils.hpp b/include/DownloadUtils.hpp
index 28684ef..498b976 100644
--- a/include/DownloadUtils.hpp
+++ b/include/DownloadUtils.hpp
@@ -24,7 +24,7 @@ namespace QuickMedia {
DownloadResult download_head_to_string(const std::string &url, std::string &result, bool use_browser_useragent = false, bool fail_on_error = true);
// Returns the remote name from the content-disposition header or tries to extract the file name from url. Can return empty name
DownloadResult url_get_remote_name(const std::string &url, std::string &result, bool use_browser_useragent);
- DownloadResult download_to_string(const std::string &url, std::string &result, const std::vector<CommandArg> &additional_args, bool use_browser_useragent = false, bool fail_on_error = true);
+ DownloadResult download_to_string(const std::string &url, std::string &result, const std::vector<CommandArg> &additional_args, bool use_browser_useragent = false, bool fail_on_error = true, std::string *header = nullptr, int download_limit = 1024 * 1024 * 100); // 100mb download limit
// Note: This function saves the content to the file atomically
DownloadResult download_to_string_cache(const std::string &url, std::string &result, const std::vector<CommandArg> &additional_args, bool use_browser_useragent = false, DownloadErrorHandler error_handler = nullptr, Path cache_path = "");
// Note: This function saves the content to the file atomically
diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp
index 1a1e418..97e4b61 100644
--- a/include/VideoPlayer.hpp
+++ b/include/VideoPlayer.hpp
@@ -33,7 +33,7 @@ namespace QuickMedia {
};
// @event_callback is called from another thread
- VideoPlayer(bool no_video, bool use_system_mpv_config, bool keep_open, EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback, const std::string &resource_root, int monitor_height);
+ VideoPlayer(bool no_video, bool use_system_mpv_config, bool keep_open, EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback, const std::string &resource_root, int monitor_height, std::string plugin_name);
~VideoPlayer();
VideoPlayer(const VideoPlayer&) = delete;
VideoPlayer& operator=(const VideoPlayer&) = delete;
@@ -55,6 +55,7 @@ namespace QuickMedia {
Error launch_video_process(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool is_youtube, const std::string &title, const std::string &start_time);
VideoPlayer::Error read_ipc_func();
private:
+ std::string plugin_name;
bool no_video;
bool use_system_mpv_config;
bool keep_open;