Skip to content

Commit c9dadae

Browse files
committed
Final tidyups
1 parent b2d1171 commit c9dadae

File tree

6 files changed

+27
-32
lines changed

6 files changed

+27
-32
lines changed

Docs/Proxys.txt

+15-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,21 @@ If no authentication is needed to use the proxy then the '<username>:<password>@
88

99
'type' can be:
1010
http A standard http proxy
11-
https An http proxy that uses encrypted connections
12-
ssltunnel An ssh server that supports connection forwarding
11+
https An http proxy that uses encrypted connections (so is running on port 443 with native ssl)
12+
httpc An http proxy that the HTTP/1.1 'CONNECT' method
1313
socks4 A socks4 proxy (openssh or tor using proxy)
1414
socks5 A socks5 proxy
1515

16-
All connections will then be forwarded through the proxy.
16+
All connections will then be forwarded through the proxy.
17+
18+
This is particularly useful in combination with ssh. The ssh command:
19+
20+
ssh -D *:5050 user@myhost
21+
22+
will connect to 'myhost' and open a socks4/socks5 proxy service locally on port 5050. Movgrab can then be told:
23+
24+
movgrab -p 127.0.0.1:5050 http://www.youtube.com/?watch=ejfelefffDD
25+
26+
and all it's communications will be routed through ssh and appear to come from 'myhost'.
27+
28+

Docs/Usage.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ This command works the same as the -s streaming command, except that the file wi
3636

3737
-v increases the debugging level. Two -v will cause every webpage visited to be printed out for inspection. Three -v will cause some extra information about headers etc to be printed out.
3838

39-
-p allows you to specify a proxy server in http://username:password@url:port format. So, something like 'movgrab -p http://guest:password@myproxy.com:8080 . 'Username', 'password' and 'port' are optional if there is no user logon and the port is 80.
39+
-p allows you to specify a proxy server in http://username:password@url:port format. So, something like 'movgrab -p http://guest:password@myproxy.com:8080 . 'Username', 'password' and 'port' are optional if there is no user logon and the port is 80. Other proxy protocols are supported by replacing 'http:' with 'https', 'httpc', 'socks4' and 'socks5'. 'https' is the same as 'http' but expects the server to communicate using SSL/TLS from the get-go (port 443 style). 'httpc' uses the HTTP/1.1 'CONNECT' method.
40+
4041

4142
-x attempts to get around 'family filter' on some websites
4243

4344
-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.
4445

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

48+
-np <path> Will write a 'now playing' file for ICY web-radio services that announce the current artist/track.
4749

4850
In some cases websites have more than one format of a video on offer. In general movgrab tries to extract Flash video (flv) first. If you want a different format, you can first see what the website offers by doing this:
4951

libUseful-2.6/ConnectionChain.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "SpawnPrograms.h"
44
#include "expect.h"
55

6-
const char *HopTypes[]={"none","direct","httptunnel","ssh","sshtunnel","socks4","socks5","shell","telnet",NULL};
6+
const char *HopTypes[]={"none","direct","httpc","ssh","sshtunnel","socks4","socks5","shell","telnet",NULL};
77
typedef enum {CONNECT_HOP_NONE, CONNECT_HOP_TCP, CONNECT_HOP_HTTPTUNNEL, CONNECT_HOP_SSH, CONNECT_HOP_SSHTUNNEL, CONNECT_HOP_SOCKS4, CONNECT_HOP_SOCKS5, CONNECT_HOP_SHELL_CMD, CONNECT_HOP_TELNET} THopTypes;
88

99
char *GlobalConnectionChain=NULL;

main.c

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ CheckSettings();
135135
if (StrValid(Proxy))
136136
{
137137
if (strncmp(Proxy,"http:",5)==0) HTTPSetProxy(Proxy);
138+
else if (strncmp(Proxy,"https:",6)==0) HTTPSetProxy(Proxy);
138139
else if (! SetGlobalConnectionChain(Proxy))
139140
{
140141
printf("ERROR: Failed to set proxy settings to '%s'\n",Proxy);

servicetypes.c

+3-25
Original file line numberDiff line numberDiff line change
@@ -1007,16 +1007,8 @@ break;
10071007
case TYPE_DAILYMOTION:
10081008
#define DAILYMOTION_ITEM "/mp4\",\"url\":\""
10091009
#define DAILYMOTION_ITEM_END "\"}"
1010-
#define DAILYMOTION_TITLE_START "<meta property=\"og:title\" content=\""
1011-
#define DAILYMOTION_TITLE_END "\""
1012-
1013-
1014-
if (strstr(Tempstr,DAILYMOTION_TITLE_START))
1015-
{
1016-
GenericExtractFromLine(Tempstr, "Title",DAILYMOTION_TITLE_START,DAILYMOTION_TITLE_END,Vars, EXTRACT_DEQUOTE | EXTRACT_DEHTMLQUOTE);
1017-
}
1018-
10191010

1011+
GenericTitleExtract(Tempstr, Vars);
10201012
if (strstr(Tempstr,DAILYMOTION_ITEM))
10211013
{
10221014
Token=UnQuoteStr(Token,Tempstr);
@@ -1279,9 +1271,8 @@ case TYPE_NATGEO:
12791271
#define NATGEO_ITEM_END "\'"
12801272
#define NATGEO_FLV_START "class=\"ngs_video\" data-require=\"ngsPlayer\" data-options='{ \"slug\": \""
12811273
#define NATGEO_FLV_END "\""
1282-
#define NATGEO_TITLE_START "<meta property=\"og:title\" content=\""
1283-
#define NATGEO_TITLE_END "\""
12841274

1275+
GenericTitleExtract(Tempstr, Vars);
12851276
if (strstr(Tempstr,NATGEO_ITEM_START))
12861277
{
12871278
GenericExtractFromLine(Tempstr, "tmp",NATGEO_ITEM_START,NATGEO_ITEM_END,Vars,EXTRACT_DESLASHQUOTE | EXTRACT_NOSPACES);
@@ -1294,30 +1285,17 @@ case TYPE_NATGEO:
12941285
{
12951286
GenericExtractFromLine(Tempstr, "item:flv",NATGEO_FLV_START,NATGEO_FLV_END,Vars,EXTRACT_NOSPACES);
12961287
}
1297-
1298-
if (strstr(Tempstr,NATGEO_TITLE_START))
1299-
{
1300-
GenericExtractFromLine(Tempstr, "Title",NATGEO_TITLE_START,NATGEO_TITLE_END,Vars,0);
1301-
}
1302-
13031288
break;
13041289

13051290
case TYPE_VIDEOBASH:
13061291
#define VIDEOBASH_ITEMSTART "&amp;file=\" + 'http://' + '"
13071292
#define VIDEOBASH_ITEMEND "\'"
1308-
#define VIDEOBASH_TITLE_START "<meta property=\"og:title\" content=\""
1309-
#define VIDEOBASH_TITLE_END "\""
13101293

1294+
GenericTitleExtract(Tempstr, Vars);
13111295
if (strstr(Tempstr,VIDEOBASH_ITEMSTART))
13121296
{
13131297
GenericExtractFromLine(Tempstr, "item:mp4",VIDEOBASH_ITEMSTART,VIDEOBASH_ITEMEND,Vars,EXTRACT_DEQUOTE | EXTRACT_NOSPACES);
13141298
}
1315-
1316-
if (strstr(Tempstr,VIDEOBASH_TITLE_START))
1317-
{
1318-
GenericExtractFromLine(Tempstr, "Title",VIDEOBASH_TITLE_START,VIDEOBASH_TITLE_END,Vars,0);
1319-
}
1320-
13211299
break;
13221300

13231301

settings.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ fprintf(stdout,"'-U' User-agent string\n");
3131
fprintf(stdout,"'-a' Authentication info in Username:Password format.\n");
3232
fprintf(stdout,"'-q' QUIET. No progress/informative output.\n");
3333
fprintf(stdout,"'-b' Background. Fork into background and nohup\n");
34-
fprintf(stdout,"'-p' address of http/https/socks4/socks5/sshtunnel proxy server in URL format.\n");
35-
fprintf(stdout,"'-proxy' address of http/https/socks4/socks5/sstunnel proxy server in URL format.\n");
34+
fprintf(stdout,"'-p' address of http/https/httpc/socks4/socks5 proxy server in URL format.\n");
35+
fprintf(stdout,"'-proxy' address of http/https/httpc/socks4/socks5 proxy server in URL format.\n");
3636
fprintf(stdout,"'-w' Wait for addresses to be entered on stdin.\n");
3737
fprintf(stdout,"'-st' Connection inactivity timeout in seconds. Set high for sites that 'throttle'\n");
3838
fprintf(stdout,"'-tw <int>' Set max width of item title in progress display (Default 50 chars)\n");
@@ -63,6 +63,8 @@ for (i=1; DownloadTypes[i] !=NULL; i++) fprintf(stdout,"%-20s %s\n",DownloadType
6363

6464
fprintf(stdout,"\nThe -proxy argument has the form <protocol>:<username>:<password>@<host>:<port>. So, for example socks4:192.168.1.1:8080 or socks5:user1:secret@192.168.1.1:5050\n");
6565

66+
fprintf(stdout,"\nAvailable proxy types are: 'http', 'https' (which is 'http' style proxy with port-443 style ssl), 'httpc' (which uses the http 1.1 'CONNECT' method), 'socks4' and 'socks5'. 'socks4' and 'socks5' can be used with the 'ssh -D' command to pipe all communications through an ssh tunnel.\n");
67+
6668
fprintf(stdout,"\nIf a website is not in the list, try 'movgrab -t generic <url>'\n");
6769
fprintf(stdout,"\nMovgrab can also be used to stream from internet radio and pipe it into a player. E.g.'\n movgrab -o - -q -proxy ssltunnel://guest:s3cr3t@sshserver:1022 http://schizoid.in/schizoid-psy.pls | mpg123 -\n");
6870
fprintf(stdout,"\nFeel free to email me and tell me if you've used this software!\n");

0 commit comments

Comments
 (0)