$ git clone http://tcclient.ion.nu/tc_client.git
commit d4135c41f933e974d4314e57fc0e79e559712fd8
Author: Alicia <...>
Date: Wed Jun 24 14:58:11 2015 +0200
modbot: added an option (--disable-lists) to disable playlist requests, instead only the first video linked to will be added to the queue.
diff --git a/ChangeLog b/ChangeLog
index 60a8bc5..64c473a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ Print version info when called with -v/--version (contributed by Jade)
Flush stdout after printing unknown RTMP types, and return upon <1 reads in b_read.
tc_client-gtk: fixed windows compatibility (w32_runcmd and strndup)
tc_client-gtk and camviewer: added some compatibility macros for older libav versions.
+modbot: added an option (--disable-lists) to disable playlist requests, instead only the first video linked to will be added to the queue.
0.33:
Fixed the /forgive command (by name) which would previously fail unless the target was found in the first 'banlist' AMF0 packet.
Added a /version remote command to give the client name and version number, making /userinfo conform to the flash client's behaviour instead, and send the response with the two separate privacy field options 'n' and 'b'.
diff --git a/utilities/modbot/modbot.c b/utilities/modbot/modbot.c
index 940af29..d5f307e 100644
--- a/utilities/modbot/modbot.c
+++ b/utilities/modbot/modbot.c
@@ -193,6 +193,7 @@ int main(int argc, char** argv)
char daemon=0;
char* logfile=0;
char verbose=0;
+ char disablelists=0;
unsigned int i;
for(i=1; i<argc; ++i)
{
@@ -223,12 +224,22 @@ int main(int argc, char** argv)
argv[argc]=0;
--i;
}
+ else if(!strcmp(argv[i], "--disable-lists"))
+ {
+ disablelists=1;
+ // Remove non-tc_client argument
+ --argc;
+ memmove(&argv[i], &argv[i+1], sizeof(char*)*(argc-i));
+ argv[argc]=0;
+ --i;
+ }
else if(!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help"))
{
printf("Additional options for modbot:\n"
"-d/--daemon = daemonize after startup\n"
"-l/--log <file> = log output into <file>\n"
"-v/--verbose = print/log all incoming messages\n"
+ "--disable-lists = disable playlists\n"
"\n");
execvp(strncmp(argv[0], "./", 2)?"tc_client":"./tc_client", argv);
return 1;
@@ -343,6 +354,12 @@ int main(int argc, char** argv)
}
if(!strncmp(msg, "!request ", 9))
{
+ if(disablelists)
+ {
+ char* x;
+ if((x=strstr(&msg[9], "&list="))){x[0]=0;}
+ if((x=strstr(&msg[9], "?list="))){x[1]='_';}
+ }
char title[256];
char vid[1024];
char viderr[1024];