diff options
-rw-r--r-- | src/QuickMedia.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 3867237..7c9b348 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -1607,6 +1607,15 @@ namespace QuickMedia { return TaskResult::TRUE; } + static bool video_url_supports_timestamp(const std::string &url) { + std::string dummy_id; + if(youtube_url_extract_id(url, dummy_id)) + return true; + if(url.find("pornhub.com/view_video.php") != std::string::npos) + return true; + return false; + } + #define CLEANMASK(mask) ((mask) & (ShiftMask|ControlMask|Mod1Mask|Mod4Mask|Mod5Mask)) void Program::video_content_page(VideoPage *video_page, std::string video_url, std::string video_title, bool download_if_streaming_fails) { @@ -1787,14 +1796,12 @@ namespace QuickMedia { sf::Clock cursor_hide_timer; bool is_youtube = strcmp(plugin_name, "youtube") == 0; - bool is_pornhub = strcmp(plugin_name, "pornhub") == 0; - bool supports_url_timestamp = is_youtube || is_pornhub; - auto save_video_url_to_clipboard = [&video_url_is_local, &video_url, &video_player_window, &video_player, &supports_url_timestamp]() { + auto save_video_url_to_clipboard = [&video_url_is_local, &video_url, &video_player_window, &video_player]() { if(!video_player_window || video_url_is_local) return; - if(supports_url_timestamp) { + if(video_url_supports_timestamp(video_url)) { // TODO: Remove timestamp (&t= or ?t=) from video_url double time_in_file; if(video_player->get_time_in_file(&time_in_file) != VideoPlayer::Error::OK) |