Skip to content

Commit

Permalink
Version and documentation update. Changes to compile on systems with …
Browse files Browse the repository at this point in the history
…MNT_DETACH flag
  • Loading branch information
ColumPaget committed Jun 23, 2017
1 parent e223557 commit efbed11
Show file tree
Hide file tree
Showing 125 changed files with 453 additions and 2,247 deletions.
6 changes: 6 additions & 0 deletions Docs/Radio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ movgrab 'http://www.triplag.com/webradio/darkpsy/triplag-darkpsy-playlist.asx' -

This both pipes it into 'mpg123' and writes it to 'darktrance.mp3'

A similar operation can be achived using the 'player' command-line switch (-P) rather than the 'output ' (-o) switch. e.g.

movgrab 'http://www.triplag.com/webradio/darkpsy/triplag-darkpsy-playlist.asx' -P '/usr/bin/mpg123 -'

In this case it may be desired to use the option '-o none' which suppresses file output, so that output is just pumped to the player app.

Since movgrab 3.1.0 there's been an option to have movgrab choose the player according to the content type of the data. This requires settings in a config file (see ConfigFile.txt). In this case use the switch '-P auto' and movgrab will select the appropriate player for the media type, provided that player has been set up in the config file.



Expand Down
6 changes: 6 additions & 0 deletions Docs/Usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Using '-o -' will pump the movie data out of stdout, so you can feed it to anoth

movgrab -o - http://www.youtube.com/watch?v=oP59tQf_njc | mplayer -

Useing '-o none' will suppress writing data to a file (used with the -P switch when movgrab is writing to a specified player program)


But an even better solution is

movgrab -s http://www.youtube.com/watch?v=oP59tQf_njc | mplayer -
Expand All @@ -43,6 +46,9 @@ This command works the same as the -s streaming command, except that the file wi

-P allows you to specify a 'Player program' (e.g. 'mplayer') to run when a certain percentage (default, 25%) of the file has been downloaded.

'-P auto' allows movgrab to select a player program matching a media type from entries in a config file (see 'ConfigFile.txt')


-Pp allow you to set what percent of download to launch the 'Player program' at.

-np <path> Will write a 'now playing' file for ICY web-radio services that announce the current artist/track.
Expand Down
2 changes: 1 addition & 1 deletion common.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define MOVGRAB_COMMON

//This is doable through autoconf, but I'm sick of fighting with it
#define Version "3.1.0"
#define Version "3.1.1"

#include "libUseful-2.8/libUseful.h"
#include <string.h>
Expand Down
Empty file modified libUseful-2.8/Compression.c
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Compression.h
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/ConnectionChain.c
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/ConnectionChain.h
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/DataParser.c
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/DataParser.h
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/DataProcessing.c
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/DataProcessing.h
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/ConnectManager.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/DataProcessing.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/EncryptedFiles.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/GeneralFunctions.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/Hash.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/Log.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/directory
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/expect.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/file.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/http.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/includes.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/inet.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/list.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/pty.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/socket.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/sound.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/string.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Docs/unix_socket.txt
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Encodings.c
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Encodings.h
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/EncryptedFiles.c
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/EncryptedFiles.h
100644 → 100755
Empty file.
37 changes: 21 additions & 16 deletions libUseful-2.8/FileSystem.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ char *SlashTerminateDirectoryPath(char *DirPath)
{
char *ptr, *RetStr=NULL;

if (! DirPath) return(CopyStr(DirPath,"/"));
if (! StrValid(DirPath)) return(CopyStr(DirPath,"/"));
RetStr=DirPath;
ptr=RetStr+StrLen(RetStr)-1;
if (*ptr != '/') RetStr=AddCharToStr(RetStr,'/');
Expand All @@ -45,7 +45,8 @@ char *StripDirectorySlash(char *DirPath)
char *ptr;

//don't strip '/' (root dir)
if (StrLen(DirPath)==1) return(DirPath);
if (! StrValid(DirPath)) return(DirPath);
if (strcmp(DirPath,"/")==0) return(DirPath);
ptr=DirPath+StrLen(DirPath)-1;

if (*ptr == '/') *ptr='\0';
Expand Down Expand Up @@ -207,23 +208,15 @@ return(FALSE);

int FileCopyWithProgress(const char *SrcPath, const char *DestPath, DATA_PROGRESS_CALLBACK Callback)
{
STREAM *Src, *Dest;
STREAM *Src;
int result;

Src=STREAMOpen(SrcPath,"r");
if (! Src) return(FALSE);
if (Callback) STREAMAddProgressCallback(Src,Callback);
Dest=STREAMOpen(DestPath,"wc");
if (! Dest)
{
result=STREAMCopy(Src, DestPath);
STREAMClose(Src);
return(FALSE);
}

STREAMSendFile(Src, Dest, 0, SENDFILE_LOOP);
// | SENDFILE_KERNEL);
STREAMClose(Dest);
STREAMClose(Src);
return(TRUE);
return(result);
}


Expand Down Expand Up @@ -256,7 +249,7 @@ int FileSystemMount(const char *Dev, const char *MountPoint, const char *Type, c
{
const char *ptr, *p_Type, *p_MountPoint;
char *Token=NULL;
int Flags=0, result;
int Flags=0, result, Perms=700;

p_Type=Type;
if (! StrValid(MountPoint))
Expand All @@ -282,11 +275,12 @@ while (ptr)
else if (strcmp(Token,"noexec")==0) Flags |= MS_NOEXEC;
else if (strcmp(Token,"nosuid")==0) Flags |= MS_NOSUID;
else if (strcmp(Token,"nodev")==0) Flags |= MS_NODEV;
else if (strncmp(Token,"perms=",6)==0) Perms=strtol(Token+6,NULL,8);
ptr=GetToken(ptr, " |,", &Token, GETTOKEN_MULTI_SEP);
}

Token=MCopyStr(Token,p_MountPoint,"/",NULL);
MakeDirPath(Token,0700);
MakeDirPath(Token,Perms);

//must do a little dance for readonly bind mounts. We must first mount, then remount readonly
if ((Flags & MS_BIND) && (Flags & MS_RDONLY))
Expand All @@ -302,6 +296,17 @@ return(result);
}



//if the system doesn't have these flags then define empty values for them
#ifndef UMOUNT_NOFOLLOW
#define UMOUNT_NOFOLLOW 0
#endif

#ifndef UMOUNT_DETACH
#define UMOUNT_DETACH 0
#endif


#define UMOUNT_RECURSE 1
#define UMOUNT_RMDIR 2

Expand Down
Empty file modified libUseful-2.8/FileSystem.h
100644 → 100755
Empty file.
31 changes: 16 additions & 15 deletions libUseful-2.8/GeneralFunctions.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,17 @@ return(GetRandomData(RetBuff,len,ALPHA_CHARS));
}


//It's not worth the extra dependancy on libm just to have power
double topower(double value, double power)
double ToPower(double val, double power)
{
double i, result;
double result=0;
int i;

result=value;
result=val;
for (i=1; i < power; i++)
{
result *= value;
result=result * val;
}

return(result);
}

Expand All @@ -189,14 +190,14 @@ val=strtod(Data,&ptr);
while (isspace(*ptr)) ptr++;
switch (*ptr)
{
case 'k': val=val*1000; break;
case 'M': val=val*topower(1000,2); break;
case 'G': val=val*topower(1000,3); break;
case 'T': val=val*topower(1000,4); break;
case 'P': val=val*topower(1000,5); break;
case 'E': val=val*topower(1000,6); break;
case 'Z': val=val*topower(1000,7); break;
case 'Y': val=val*topower(1000,8); break;
case 'k': val=val * 1000; break;
case 'M': val=val * ToPower(1000,2); break;
case 'G': val=val * ToPower(1000,3); break;
case 'T': val=val * ToPower(1000,4); break;
case 'P': val=val * ToPower(1000,5); break;
case 'E': val=val * ToPower(1000,6); break;
case 'Z': val=val * ToPower(1000,7); break;
case 'Y': val=val * ToPower(1000,8); break;
}

return(val);
Expand All @@ -216,13 +217,13 @@ val=Size;

for (i=0; sufflist[i] !='\0'; i++)
{
next=topower(1000,i+1);
next=ToPower(1000,i+1);
if (next > val) break;
}

if ((sufflist[i] > 0) && (sufflist[i] !='\0'))
{
val=val / topower(1000,i);
val=val / ToPower(1000,i);
suffix=sufflist[i];
}

Expand Down
1 change: 0 additions & 1 deletion libUseful-2.8/GeneralFunctions.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ char *GetRandomData(char *RetBuff, int len, char *AllowedChars);
char *GetRandomHexStr(char *RetBuff, int len);
char *GetRandomAlphabetStr(char *RetBuff, int len);

int BASIC_FUNC_EXEC_COMMAND(void *Data);

double FromMetric(const char *Data, int Type);
const char *ToMetric(double Size, int Type);
Expand Down
Empty file modified libUseful-2.8/Hash.c
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Hash.h
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/LICENCE
100644 → 100755
Empty file.
154 changes: 0 additions & 154 deletions libUseful-2.8/LinuxNamespaces.c

This file was deleted.

Empty file modified libUseful-2.8/Log.c
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Log.h
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions libUseful-2.8/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CC = gcc
VERSION = 0.0.1
CFLAGS = -g -O2
LIBS = -lz -lcrypto -lssl -lc
FLAGS=$(LDFLAGS) $(CPPFLAGS) $(CFLAGS) -fPIC -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -D_FILE_OFFSET_BITS=64 -DHAVE_LIBC=1 -DHAVE_PTSNAME_R=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DUSE_SENDFILE=1 -DHAVE_LIBSSL=1 -DHAVE_LIBCRYPTO=1 -DHAVE_EVP_BF_CBC=1 -DHAVE_EVP_RC2_CBC=1 -DHAVE_EVP_RC4=1 -DHAVE_EVP_DES_CBC=1 -DHAVE_EVP_DESX_CBC=1 -DHAVE_EVP_CAST5_CBC=1 -DHAVE_EVP_IDEA_CBC=1 -DHAVE_EVP_AES_128_CBC=1 -DHAVE_EVP_AES_256_CBC=1 -DUSE_OPENSSL_ADD_ALL_ALGORITHMS=1 -DHAVE_LIBZ=1 -DHAVE_OSS=1 -DHAVE_MADVISE -DHAVE_MADVISE_NOFORK -DHAVE_MADVISE_DONTDUMP -DHAVE_MLOCK
LIBS = -lc
FLAGS=$(LDFLAGS) $(CPPFLAGS) $(CFLAGS) -fPIC -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -D_FILE_OFFSET_BITS=64 -DHAVE_LIBC=1 -DHAVE_PTSNAME_R=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DUSE_SENDFILE=1 -DHAVE_OSS=1 -DHAVE_MADVISE -DHAVE_MADVISE_NOFORK -DHAVE_MADVISE_DONTDUMP -DHAVE_MLOCK
prefix=/usr/local
OBJ=string.o list.o socket.o unix_socket.o file.o tar.o Terminal.o FileSystem.o GeneralFunctions.o DataProcessing.o EncryptedFiles.o g711.o sound.o pty.o Log.o http.o inet.o expect.o base64.o crc32.o md5c.o sha1.o sha2.o whirlpool.o jh_ref.o Hash.o ssh.o Compression.o oauth.o libsettings.o Vars.o Time.o Markup.o SpawnPrograms.o Tokenizer.o PatternMatch.o URL.o DataParser.o ConnectionChain.o openssl.o Process.o Encodings.o RawData.o securemem.o

Expand Down
Empty file modified libUseful-2.8/Makefile.in
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Markup.c
100644 → 100755
Empty file.
Empty file modified libUseful-2.8/Markup.h
100644 → 100755
Empty file.
Loading

0 comments on commit efbed11

Please sign in to comment.