From 539d9b457c4f30ef0731a479772212e7ce8bfd7c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 30 Mar 2021 00:45:51 +0200 Subject: Remove tor option. Use torsocks instead (which is what quickmedia did anyways) --- include/AsyncImageLoader.hpp | 2 +- include/DownloadUtils.hpp | 8 ++++---- include/GoogleCaptcha.hpp | 4 ++-- include/Json.hpp | 2 +- include/QuickMedia.hpp | 2 -- include/VideoPlayer.hpp | 3 +-- 6 files changed, 9 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/AsyncImageLoader.hpp b/include/AsyncImageLoader.hpp index d485e3a..0366415 100644 --- a/include/AsyncImageLoader.hpp +++ b/include/AsyncImageLoader.hpp @@ -36,7 +36,7 @@ namespace QuickMedia { // set |resize_target_size| to {0, 0} to disable resizing. // |thumbnail_data.loading_state| has to be LoadingState::NOT_LOADED when calling this! // Note: this method is not thread-safe - void load_thumbnail(const std::string &url, bool local, sf::Vector2i resize_target_size, bool use_tor, std::shared_ptr thumbnail_data); + void load_thumbnail(const std::string &url, bool local, sf::Vector2i resize_target_size, std::shared_ptr thumbnail_data); private: AsyncImageLoader(); ~AsyncImageLoader(); diff --git a/include/DownloadUtils.hpp b/include/DownloadUtils.hpp index 6d96cd6..40ec12a 100644 --- a/include/DownloadUtils.hpp +++ b/include/DownloadUtils.hpp @@ -21,8 +21,8 @@ namespace QuickMedia { // Return true the return DownloadResult::OK for the download, which also saves the result in cache if |download_to_string_cache| is used using DownloadErrorHandler = std::function; - DownloadResult download_to_string(const std::string &url, std::string &result, const std::vector &additional_args, bool use_tor, bool use_browser_useragent = false, bool fail_on_error = true); - DownloadResult download_to_string_cache(const std::string &url, std::string &result, const std::vector &additional_args, bool use_tor, bool use_browser_useragent = false, DownloadErrorHandler error_handler = nullptr, Path cache_path = ""); - DownloadResult download_to_file(const std::string &url, const std::string &destination_filepath, const std::vector &additional_args, bool use_tor, bool use_browser_useragent = false); - DownloadResult download_to_json(const std::string &url, rapidjson::Document &result, const std::vector &additional_args, bool use_tor, bool use_browser_useragent = false, bool fail_on_error = true); + DownloadResult download_to_string(const std::string &url, std::string &result, const std::vector &additional_args, bool use_browser_useragent = false, bool fail_on_error = true); + DownloadResult download_to_string_cache(const std::string &url, std::string &result, const std::vector &additional_args, bool use_browser_useragent = false, DownloadErrorHandler error_handler = nullptr, Path cache_path = ""); + DownloadResult download_to_file(const std::string &url, const std::string &destination_filepath, const std::vector &additional_args, bool use_browser_useragent = false); + DownloadResult download_to_json(const std::string &url, rapidjson::Document &result, const std::vector &additional_args, bool use_browser_useragent = false, bool fail_on_error = true); } \ No newline at end of file diff --git a/include/GoogleCaptcha.hpp b/include/GoogleCaptcha.hpp index 9c998da..62e47fa 100644 --- a/include/GoogleCaptcha.hpp +++ b/include/GoogleCaptcha.hpp @@ -15,7 +15,7 @@ namespace QuickMedia { }; using RequestChallengeResponse = std::function)>; - std::future google_captcha_request_challenge(const std::string &api_key, const std::string &referer, RequestChallengeResponse challenge_response_callback, bool use_tor = false); + std::future google_captcha_request_challenge(const std::string &api_key, const std::string &referer, RequestChallengeResponse challenge_response_callback); using PostSolutionResponse = std::function, std::optional)>; - std::future google_captcha_post_solution(const std::string &api_key, const std::string &captcha_id, std::array selected_images, PostSolutionResponse solution_response_callback, bool use_tor); + std::future google_captcha_post_solution(const std::string &api_key, const std::string &captcha_id, std::array selected_images, PostSolutionResponse solution_response_callback); } \ No newline at end of file diff --git a/include/Json.hpp b/include/Json.hpp index ae84141..9e1e706 100644 --- a/include/Json.hpp +++ b/include/Json.hpp @@ -5,5 +5,5 @@ namespace QuickMedia { const rapidjson::Value& GetMember(const rapidjson::Value &obj, const char *key); - DownloadResult download_json(rapidjson::Document &result, const std::string &url, std::vector additional_args, bool use_tor, bool use_browser_useragent = true, std::string *err_msg = nullptr); + DownloadResult download_json(rapidjson::Document &result, const std::string &url, std::vector additional_args, bool use_browser_useragent = true, std::string *err_msg = nullptr); } \ No newline at end of file diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 8c6b02e..ec16feb 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -75,7 +75,6 @@ namespace QuickMedia { ~Program(); int run(int argc, char **argv); - bool is_tor_enabled(); std::unique_ptr create_body(); std::unique_ptr create_search_bar(const std::string &placeholder, int search_delay); @@ -164,7 +163,6 @@ namespace QuickMedia { int exit_code = 0; std::string resources_root; sf::Shader circle_mask_shader; - bool use_tor = false; bool no_video = false; bool use_system_mpv_config = false; UpscaleImageAction upscale_image_action = UpscaleImageAction::NO; diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index adb19c8..ea99ea1 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -36,7 +36,7 @@ namespace QuickMedia { }; // @event_callback is called from another thread - VideoPlayer(bool use_tor, bool no_video, bool use_system_mpv_config, bool resume_playback, 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 resume_playback, bool keep_open, EventCallbackFunc event_callback, VideoPlayerWindowCreateCallback window_create_callback, const std::string &resource_root, int monitor_height); ~VideoPlayer(); VideoPlayer(const VideoPlayer&) = delete; VideoPlayer& operator=(const VideoPlayer&) = delete; @@ -72,7 +72,6 @@ namespace QuickMedia { Error launch_video_process(const char *path, sf::WindowHandle parent_window, const std::string &plugin_name, const std::string &title); VideoPlayer::Error read_ipc_func(); private: - bool use_tor; bool no_video; bool use_system_mpv_config; bool resume_playback; -- cgit v1.2.3