aboutsummaryrefslogtreecommitdiff
path: root/src/VideoPlayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VideoPlayer.cpp')
-rw-r--r--src/VideoPlayer.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 8614e94..32eda39 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -169,8 +169,9 @@ namespace QuickMedia {
if(get_file_type(video_player_filepath.c_str()) != FileType::REGULAR)
video_player_filepath = "/usr/bin/quickmedia-video-player";
- std::string config_dir = "--config-dir=" + startup_args.resource_root + "mpv";
- std::string input_conf_file = "--input-conf=" + startup_args.resource_root + "mpv/input.conf";
+ const std::string config_dir = "--config-dir=" + startup_args.resource_root + "mpv";
+ const std::string input_conf_file = "--input-conf=" + startup_args.resource_root + "mpv/input.conf";
+ const std::string ytdl_hook_file = "--scripts=" + startup_args.resource_root + "mpv/scripts/ytdl_hook.lua";
std::vector<const char*> args;
// TODO: Resume playback if the last video played matches the first video played next time QuickMedia is launched
@@ -228,10 +229,7 @@ namespace QuickMedia {
else
ytdl_format = "--ytdl-format=bestvideo[height<=?" + std::to_string(startup_args.monitor_height) + "]+bestaudio/best";
- if(!startup_args.use_youtube_dl)
- args.push_back("--ytdl=no");
- else
- args.push_back(ytdl_format.c_str());
+ args.push_back("--ytdl=no");
// TODO: Properly escape referer quotes
std::string referer_arg = "--http-header-fields=Referer: " + startup_args.referer;
@@ -248,6 +246,9 @@ namespace QuickMedia {
args.push_back("--load-scripts=yes");
args.push_back("--osc=yes");
args.push_back(input_conf_file.c_str());
+
+ if(startup_args.use_youtube_dl)
+ args.push_back(ytdl_hook_file.c_str());
} else {
args.insert(args.end(), {
config_dir.c_str(),