forked from streamripper/streamripper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
streamripper.1
562 lines (557 loc) · 20.3 KB
/
streamripper.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
.\" Title: streamripper
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\" Date: 03/08/2009
.\" Manual:
.\" Source:
.\"
.TH "STREAMRIPPER" "1" "03/08/2009" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
streamripper \- rip shoutcast radio streams to mp3 files
.SH "SYNOPSIS"
\fIstreamripper\fR URL [options]
.sp
.SH "DESCRIPTION"
Streamripper records shoutcast and icecast compatible streams, in their native format\&. The following formats are supported: mp3, nsv, aac, and ogg\&. The meta data within the stream are interpreted to determine the beginning and end of each song, and stores the songs on your hard disk as individual files\&. In addition, streamripper includes a relay server for listening to the station while you are recording\&.
.sp
.SH "OPTIONS"
.PP
\-h
.RS 4
Print help and exit
.RE
.PP
\-v
.RS 4
Print version info and quit
.RE
.PP
\-d dir
.RS 4
The destination directory
.RE
Select a different base directory for ripping, just in case you don\'t want to dump tons of mp3\'s into whatever directory your at\&.
.PP
\-s
.RS 4
Don\'t create a directory for each stream
.RE
Normally streamripper will make a directory with the same name as the stream to place the tracks into, this disables that\&.
.PP
\-D pattern
.RS 4
Use a pattern to format the output file names
.RE
This option tells streamripper how to form the filenames\&. If \-D is used, the options \-s and \-P will be ignored\&. If the pattern represents an absolute path, the \-d option will also be ignored\&. If both \-D and \-q are specified, \-q will only be used to set the start count if a %q token is included\&.
.sp
By default the output files are put in a directory that has the same name as the stream, and files are formed from the artist and title\&. But you can override this behavior and create the output files as you like\&. The output file names are generated by substituting tokens with values that depend on the stream, track, or environment\&. The following tokens can be used for substitution\&.
.sp
.sp
.RS 4
.nf
%S Stream
%A Artist
%T Title
%a Album
%D Date and time (per song)
%d Date and time (per execution)
%q Sequence number (automatic detection)
%Nq Sequence number (starting from number N)
%% Percent sign
.fi
.RE
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
Note
On windows you may be required to supply an extra \fI%\fR because the symbol is consumed by the shell\&. Therefore, you would put "%%S/%%A/%%T" instead of "%S/%A/%T"\&.
.sp
The extension (such as \&.mp3) is appended automatically\&.
.sp
The tokens %D and %d differ because %D gives a unique timestamp for each song, whereas %d gives a unique timestamp each time streamripper is run\&.
.sp
The tokens %q and %Nq differ because %q tries to figure out the correct sequence number from the existing files, wherease %Nq does not\&. The N is your starting number\&. For example %32q means start numbering at 32\&.
.PP
\-r [base port]
.RS 4
Create a relay server on base port, defaults to port 8000
.RE
Creates a relay server on base port\&. if base port is not specified it defaults to 8000, otherwise whatever you entered for base port\&. Note that if the \-z option is not used, it will keep trying higher ports if the port is unavailable\&.
.PP
\-R num_conn
.RS 4
Maximum connections to relay stream
.RE
In addition to creating a relay server, you can also control how many clients are allowed to simultaneously connect\&. The default is 1 client, but if you specify the \-R option you can increase this number to <num_conn> clients\&. If <num_conn> is set to 0, the number of connections is limited only by your processor and network speed\&. The \-R option has no effect if \-r was not used to create a relay stream\&.
.PP
\-z
.RS 4
Don\'t scan for free ports if base port is not available
.RE
Disables the "scan for free port" feature\&. Use it if your paranoid, or don\'t like ports being open\&.
.PP
\-p url
.RS 4
Use HTTP proxy server at <url>
.RE
If you are behind a proxy server, use the \-p flag to specify its url\&. You can also use the http_proxy environment variable to specify your proxy server\&.
.PP
\-a [pattern]
.RS 4
Rip to single file
.RE
The default mode of operation is to separate the each track into a separate file\&. But sometimes this is not what you want\&. Sometimes you want the stream recorded to a single (big) file without splitting into tracks\&. The \-a option does this\&. If you use \-a without including the [pattern], a timestamped filename will automatically be used\&.
.sp
The pattern can be used in a manner similar to the \-D flag, but generally only %S, %q and %d are useful\&.
.PP
\-A
.RS 4
Don\'t create individual tracks
.RE
The default mode of operation is to create one file for each track\&. But sometimes you don\'t want these files\&. For example, you might prefer a single file (using the \-a option), or you want to use streamripper as a relay (using the \-r option), without creating these files\&. Using the \-A option, the individual files for each track are not created\&.
.PP
\-o (always | never | larger | version)
.RS 4
Overwrite tracks in complete directory
.RE
When streamripper rips tracks they are put into the incomplete directory until they are finished\&. Normally, they are then moved into the complete directory\&. However, when the track is already there, can use this option to tell streamripper what you want to do\&. There are three choices: always, never, and larger\&. If you don\'t include any of the \-o options on the command line, the default is "\-o larger" for version through 1\&.63\&.4, and "\-o version" starting with 1\&.64\&.5\&.
.sp
If you use the "\-o never" option, this tells streamripper to never overwrite any existing file in the complete directory\&.
.sp
If you use the "\-o always" option, this tells streamripper to always overwrite any existing file in the complete directory\&.
.sp
If you use the "\-o larger" option, this tells streamripper to overwrite an existing file in the complete directory if the newer file is larger\&.
.sp
If you use the "\-o version" option, this tells streamripper to keep both versions, renaming the existing file\&.
.PP
\-t
.RS 4
Don\'t overwrite tracks in incomplete directory
.RE
Normally streamripper writes the files in the incomplete directory, and then moves it to the base directory (the complete directory) when it is done\&. If the file with the name of the track already exists in incomplete, it will overwrite the old track\&. When you use the \-t flag, however, this will tell streamripper to backup the existing file in incomplete (appending a version number), and then create the new file\&.
.sp
This is useful for streams that don\'t have meta\-data\&. Because these streams only have a single file, reconnects will cause overwriting the existing file, which is not desired\&.
.PP
\-T
.RS 4
Truncate completed tracks in incomplete directory
.RE
When you are not overwriting files in the complete folder, the duplicate files will normally stay in the incomplete folder\&. This option tells streamripper to truncate the files to zero bytes in the incomplete folder if they are a duplicate\&.
.PP
\-c
.RS 4
Don\'t auto\-reconnect
.RE
Normally streamripper will be very aggressive and try to re\-connect to a dropped stream\&. This option disables this behavior\&.
.PP
\-l seconds
.RS 4
Run for a predetermined length of time, in seconds
.RE
Usually, streamripper runs until it crashes\&. Or rather, I meant to say that it runs until you kill it, yes, I\'m sure that\'s what I meant\&. But you can instead tell streamripper to run for a certain length of time, and then exit using this flag\&.
.PP
\-M megabytes
.RS 4
Stop ripping after this many megabytes
.RE
Use this flag to tell streamripper to rip a certain number of megabytes, then stop\&. As of version 1\&.64\&.5, megabytes are defined as 2^20 bytes\&.
.PP
\-q [start]
.RS 4
Add sequence number to output filenames
.RE
When the files are copied from incomplete to complete, the filename can be prepended with a sequence number (beginning with 0000)\&. This can be used to, for example, show the order that the files were created\&. If desired, a starting count can be used with \-q to begin the sequence at any number you like\&.
.PP
\-i
.RS 4
Don\'t add ID3 tags to output file
.RE
Mp3 files have two different kinds of header information which describe the contents of the file: ID3V1 and ID3V2\&. By default, only ID3V2 is included in the mp3 files generated by streamripper\&. If you use the option, then neither are included\&.
.PP
\-\-with\-id3v1
.RS 4
Add ID3V1 tags to output file
.RE
.PP
\-\-without\-id3v2
.RS 4
Don\'t add ID3V2 tags to output file
.RE
.PP
\-k count
.RS 4
Specify the number of files to leave in the incomplete directory\&.
.RE
Usually you start ripping in the middle of the song, so the default is to leave one file in the incomplete\&. But sometimes you want to discard extra tracks generated by a stream, because they are advertisements, the station intro, broken songs, etc\&. Conversely, some streams always start you at the beginning of a complete song\&. In this case, you could specify "\-k 0" to save the first song\&.
.PP
\-m timeout
.RS 4
Timeout to restart connection
.RE
Some streams will "hang", which means they haven\'t disconnected, but they aren\'t sending any data\&. When this happens, if you used the \-m flag, streamripper will shut down the stream and reconnect after <timeout> seconds of inactivity\&.
.PP
\-u useragent
.RS 4
Use a different UserAgent than "Streamripper"
.RE
In the http request, streamripper includes a string that identifies what kind of program is requesting the connection\&. By default it is the string "Streamripper/1\&.x"\&. Here you can decide to identify yourself as a different agent if you like\&.
.PP
\-w parse_file
.RS 4
Use customized parsing rules
.RE
This tells streamripper to use custom meta\-data parsing rules\&. Without this flag, streamripper will use its built\-in parsing rules\&.
.sp
There are two cases where you want to do this\&. In the first case, you are using a stream that changes the meta data within a song\&. Usually this is a thank\-you notice or possibly an advertisement for an upcoming show\&. When this happens, the current track will become split into fragments\&. To prevent this, you can tell streamripper to ignore meta\-data\&.
.sp
The second case you might want to use this is if the artist and title information is sent in an unusual format\&. For example, they might be separated by a comma instead of a hyphen, or there might be an extra advertisement attached to the end of the meta\-data string\&. In this case, you can tell streamripper how it should identify the title, artist, album and track from the metadata string using regular expressions\&.
.sp
See the file parse_rules\&.txt, which is included in your distribution, for examples of the parse rules\&.
.PP
\-E external_command
.RS 4
Use external command to get track information
.RE
Some streams do not send artist or title information using metadata, but instead send this information using other means\&. For example, some streams update the current artist and title using html or xml\&. Another example is icecast 1\&.x, which sends metadata through a UDP socket\&.
.sp
Streamripper can get artist and title information from these kinds of streams using a helper application, specified using the \-E option\&. The helper application works by finding the title and artist, and writing it to stdout\&. Streamripper reads the output of the helper program, and splits the tracks accordingly\&.
.sp
To help you in creating external commands to use with streamripper, please look at the example file fetch_external_metadata\&.pl, which is included in your distribution\&.
.PP
\-\-http10
.RS 4
Connect using HTTP/1\&.0
.RE
To support streams that are not properly handled using HTTP/1\&.1\&.
.PP
\-\-wav
.RS 4
Save output as WAV format
.RE
.PP
\-\-debug
.RS 4
Save debugging log
.RE
This creates a file called "gcs\&.txt" that contains all sorts of debugging information\&.
.PP
\-\-quiet
.RS 4
Quiet operation
.RE
Don\'t write any text to the console, except error messages
.PP
\-\-stderr
.RS 4
Write output to stderr instead of stdout
.RE
.PP
\-\-xs_silence_length=num
.RS 4
Set silence duration
.RE
The volume must be less than xsd_min_volume for a period of time greater than this\&.
.PP
\-\-xs_search_window=num:num
.RS 4
Set search window duration
.RE
This is how long to search for the silence\&. 1st number is msec before nominal center, 2nd number is msecs after nominal track change position\&.
.PP
\-\-xs_offset=num
.RS 4
Set offset from center of silence window
.RE
.PP
\-\-xs_padding=num:num
.RS 4
Set amount to pad before and after splitpoint\&. The 1st number is the number of msec to add to the end of each song\&. The 2nd number is the number of msec to add to the beginning of each song\&.
.RE
.PP
\-\-xs\-none
.RS 4
Don\'t search for silent spot
.RE
This is a shorthand for the following combination of options: \-\-xs\-search\-window=0:0 \-\-xs\-silence\-lenghth=0 \-\-xs\-offset=0 \-\-xs\-padding=0:0\&. Note, however, that streamripper will still decode the stream in the region near the meta\-data change, in order to split at an exact mp3 frame boundary\&.
.PP
\-\-xs2
.RS 4
Use capisce\'s new algorithm (Apr 2008) for silence detection\&.
.RE
.PP
\-\-codeset\-filesys=codeset
.RS 4
Tells streamripper what codeset to use for the file names when it writes to your hard drive\&.
.RE
.PP
\-\-codeset\-id3=codeset
.RS 4
Tells streamripper what codeset to use for the id3 information\&.
.RE
.PP
\-\-codeset\-metadata=codeset
.RS 4
Tells streamripper what codeset is being used for metadata in the stream coming from the network\&.
.RE
.PP
\-\-codeset\-relay=codeset
.RS 4
Tells streamripper what codeset to use for metadata that it sends to your player on the relay stream\&.
.RE
.SH "GETTING STARTED"
The easiest way to get started is to find the URL of a stream you want to rip, usually I find the URL by loading it up in winamp or xmms and querying for the source URL (right click on the playlist)\&. Once you have the URL you can begin ripping\&. For example:
.sp
.sp
.RS 4
.nf
streamripper http://205\&.188\&.245\&.132:8038
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
This would rip Monkey Radio (as of 1/10/2001), it places the tracks into two directory\'s one called "Monkey Radio" and a sub\-directory "Monkey Radio/incomplete" the incomplete directory is for tracks that streamripper does not know the begging or end of\&. The first and last tracks your rip for instance, would be in incomplete\&.
.sp
.SH "LISTENING TO THE RELAY"
You can listen to the stream while you are ripping by creating a relay server\&. This is done by using the \-r option\&.
.sp
.sp
.RS 4
.nf
streamripper http://205\&.188\&.245\&.132:8038 \-r
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
When streamripper starts it will display what port it\'s relaying the stream on\&. It defaults to 8000 but you can choose another port\&. To listen to your relay server, open up XMMS or Winamp and enter your machine name with the port as you would any other stream\&. For example, if you are using the default relay stream, you would want to open up this URL:
.sp
.sp
.RS 4
.nf
http://localhost:8000
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
However, if you are ripping an ogg stream, you usually need to tell the player that the stream is ogg, which can be done by appending "\&.ogg" to the stream URL\&.
.sp
.sp
.RS 4
.nf
http://localhost:8000/\&.ogg
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
Similarly, if you want to watch an nsv stream while you rip, you need to tell the player that the stream is nsv, which can be done by appending ";stream\&.nsv" to the URL\&.
.sp
.sp
.RS 4
.nf
http://localhost:8000/;stream\&.nsv
.fi
.RE
.SH "SPLITPOINT DETECTION"
Streamripper automatically splits tracks based on detection of a silent near the meta interval where the track changes\&. However, this method is imperfect, and sometimes the track splitting occurs is too early or too late\&. These options will fine tune the track splitting capabilities for streams that use cross\-fading, which causes streamripper\'s automatic silence detection routine to fail\&.
.sp
Various \-\-xs flags can be used to add an offset for streams that have a meta interval that comes too early or too late, to add extra padding to the beginning and end of each song, and to decide where the length of the search window and silence window\&.
.sp
.SS "Default splitting"
The default spitting algorithm is used when no silent point can be found\&. Suppose you have a meta\-int with track change information at the time "mi" (see figure below)\&.
.sp
If the xs_offset is positive, the track separation point "ts" is later the "mi" point\&. If xs_offset is negative, "ts" is earlier than "mi"\&. Once "ts" is determined, a user\-defined "prepad" and "postpad" are used to determine where the next track begins "ntb", and where the previous track ends "pte"\&. The interval between "ntb" and "pte" will be copied to both songs\&.
.sp
.sp
.RS 4
.nf
/mi
|
| /ts
|\-\-\-\-\-\-\-\-\-\-\-|
xs_offset |
|
|
/ntb | /pte
|\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|
prepad postpad
.fi
.RE
.SS "Silence separation"
Splitting based on silence separation is similar to default splitting, only slightly more complex\&. Again, suppose you have a meta\-int with track change information at the time "mi" (see figure below)\&.
.sp
A search window "search_win" is determined by the xs_offset, pre_sw, and post_sw field\&. The beginning of the search window is at: mi xs_offset \- pre_sw and the end of the search window is at: mi xs_offset + post_sw\&.
.sp
If there is a silent interval of length "silence_win" within the "search_win", the center of "silence_win" is selected as the track separation point "ts"\&.
.sp
Once "ts" is determined, a user\-defined "prepad" and "postpad" are used to determine where the next track begins "ntb", and where the previous track ends "pte"\&. The interval between "ntb" and "pte" will be copied to both songs\&.
.sp
.sp
.RS 4
.nf
/mi
|
|\-\-\-\-\-\-\-\-\-\-\-|
xs_offset |
|
ts\e |
|\-\-\-\-\-\-\-+\-|\-\-\-\-\-\-\-\-\-| *search_win
pre_sw | post_sw
|
|\-\-\-+\-\-\-| *silence_win
|
/ntb | /pte
|\-\-\-\-\-\-\-\-\-\-\-\-\-|\-\-\-\-\-\-\-\-\-|
prepad postpad
.fi
.RE
.SH "USAGE EXAMPLES"
Rip from a stream:
.sp
.sp
.RS 4
.nf
streamripper URL
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
Rip from a stream for one hour:
.sp
.sp
.RS 4
.nf
streamripper URL \-l 3600
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
Rip the stream, putting the mp3 files into the directory /my/music/stream1:
.sp
.sp
.RS 4
.nf
streamripper URL \-d /my/music/stream1 \-s
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
Rip the stream, creating a single file and don\'t create individual tracks:
.sp
.sp
.RS 4
.nf
streamripper URL \-a \-A
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
Rip from a stream and create a relay stream at port 9000:
.sp
.sp
.RS 4
.nf
streamripper URL \-r 9000
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
Rip from a stream, creating a relay stream at port 8000, and allowing twenty clients to connect:
.sp
.sp
.RS 4
.nf
streamripper URL \-r \-R 20
.fi
.RE
.SH "SPLITPOINT USAGE EXAMPLES"
Each of my songs contain about 5 seconds of the previous song\&. How can I fix this?
.sp
.sp
.RS 4
.nf
streamripper URL \-\-xs_offset=5000
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
Each of my songs contain about 5 seconds of the next song\&. How can I fix?
.sp
.sp
.RS 4
.nf
streamripper URL \-\-xs_offset=\-5000
.fi
.RE
.sp
.RS 4
.nf
.fi
.RE
Each of my songs contain between 5 and 10 seconds of the previous song, but it depends on the song\&. How can I include all of this zone within both songs, and edit them later?
.sp
.sp
.RS 4
.nf
streamripper URL \-\-xs_offset=7500 \-\-xs_padding=2500:2500
.fi
.RE
.SH "RESOURCES"
Please check out the following web sites\&. Linked to the streamripper home page is a forum that can can be used to chat and ask questions\&.
.PP
Streamripper home page:
.RS 4
http://streamripper\&.sourceforge\&.net/
.RE
.PP
Sourceforge project page
.RS 4
http://sourceforge\&.net/projects/streamripper
.RE
.PP
Shoutcast
.RS 4
http://www\&.shoutcast\&.com
.RE
.PP
Icecast
.RS 4
http://www\&.icecast\&.org
.RE
.SH "COPYING"
Copyright \(co 2000\-2002 Jon Clegg, \(co 2004\-2009 Gregory C\&. Sharp\&. Free use of this software is granted under the terms of the GNU General Public License (GPL)\&.
.sp