$ git clone http://tcclient.ion.nu/tc_client.git
commit 81308b5b8dab720a76b8b08e4022a66981eda5cf
Author: Alicia <...>
Date: Wed Feb 24 17:35:06 2016 +0100
modbot: use youtube-dl's 'ytsearch:' instead of '--default-search auto', fixes issues with search terms that include slashes.
diff --git a/ChangeLog b/ChangeLog
index 17357c8..865524b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@ tc_client-gtk: windows compat: don't try to run empty commands.
tc_client-gtk: make timestamps gray and nicknames bold.
tc_client-gtk: added option to change font size in the chat.
tc_client-gtk: initialize audio samples of new cams to 0 (experimental audio support)
+modbot: use youtube-dl's 'ytsearch:' instead of '--default-search auto', fixes issues with search terms that include slashes.
0.37:
Reimplemented announcement of moderators.
Reimplemented announcement of people cammed up when joining.
diff --git a/utilities/modbot/modbot.c b/utilities/modbot/modbot.c
index fe3ee3e..4c0fa80 100644
--- a/utilities/modbot/modbot.c
+++ b/utilities/modbot/modbot.c
@@ -119,7 +119,9 @@ void getvidinfo(const char* vid, const char* type, char* buf, char* errbuf, unsi
close(err[0]);
dup2(out[1], 1);
dup2(err[1], 2);
- execlp("youtube-dl", "youtube-dl", "--default-search", "auto", type, "--", vid, (char*)0);
+ char search[strlen("ytsearch:0")+strlen(vid)];
+ sprintf(search, "ytsearch:%s", vid);
+ execlp("youtube-dl", "youtube-dl", type, "--", search, (char*)0);
perror("execlp(youtube-dl)");
_exit(1);
}