SYNOPSIS
streamripper URL [options]
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.
OPTIONS
-h
- Print help and exit
-v
- Print version info and quit
-d dir
- The destination directory
-s
- Don't create a directory for each stream
-D pattern
- Use a pattern to format the output file names
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.
-
%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
Note
On windows you may be required to supply an extra % because the symbol is consumed by the shell. Therefore, you would put "%%S/%%A/%%T" instead of "%S/%A/%T".
The extension (such as .mp3) is appended automatically.
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.
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.
-r [base port]
- Create a relay server on base port, defaults to port 8000
-R num_conn
- Maximum connections to relay stream
-z
- Don't scan for free ports if base port is not available
-p url
- Use HTTP proxy server at <url>
-a [pattern]
- Rip to single file
The pattern can be used in a manner similar to the -D flag, but generally only %S, %q and %d are useful.
-A
- Don't create individual tracks
-o (always | never | larger | version)
- Overwrite tracks in complete directory
If you use the "-o never" option, this tells streamripper to never overwrite any existing file in the complete directory.
If you use the "-o always" option, this tells streamripper to always overwrite any existing file in the complete directory.
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.
If you use the "-o version" option, this tells streamripper to keep both versions, renaming the existing file.
-t
- Don't overwrite tracks in incomplete directory
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.
-T
- Truncate completed tracks in incomplete directory
-c
- Don't auto-reconnect
-l seconds
- Run for a predetermined length of time, in seconds
-M megabytes
- Stop ripping after this many megabytes
-q [start]
- Add sequence number to output filenames
-i
- Don't add ID3 tags to output file
--with-id3v1
- Add ID3V1 tags to output file
--without-id3v2
- Don't add ID3V2 tags to output file
-k count
- Specify the number of files to leave in the incomplete directory.
-m timeout
- Timeout to restart connection
-u useragent
- Use a different UserAgent than "Streamripper"
-w parse_file
- Use customized parsing rules
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.
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.
See the file parse_rules.txt, which is included in your distribution, for examples of the parse rules.
-E external_command
- Use external command to get track information
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.
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.
--debug
- Save debugging log
--quiet
- Quiet operation
--stderr
- Write output to stderr instead of stdout
--xs_silence_length=num
- Set silence duration
--xs_search_window=num:num
- Set search window duration
--xs_offset=num
- Set offset from center of silence window
--xs_padding=num:num
- 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.
--xs-none
- Don't search for silent spot
--xs2
- Use capisce's new algorithm (Apr 2008) for silence detection.
--codeset-filesys=codeset
- Tells streamripper what codeset to use for the file names when it writes to your hard drive.
--codeset-id3=codeset
- Tells streamripper what codeset to use for the id3 information.
--codeset-metadata=codeset
- Tells streamripper what codeset is being used for metadata in the stream coming from the network.
--codeset-relay=codeset
- Tells streamripper what codeset to use for metadata that it sends to your player on the relay stream.
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:
-
streamripper http://205.188.245.132:8038
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.
-
streamripper http://205.188.245.132:8038 -r
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.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.
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).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.
-
/mi | | /ts |-----------| xs_offset | | | /ntb | /pte |---------|---------| prepad postpad
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).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.
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".
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.
-
/mi | |-----------| xs_offset | | ts\ | |-------+-|---------| *search_win pre_sw | post_sw | |---+---| *silence_win | /ntb | /pte |-------------|---------| prepad postpad
USAGE EXAMPLES
Rip from a stream:
-
streamripper URL
-
streamripper URL -l 3600
-
streamripper URL -d /my/music/stream1 -s
-
streamripper URL -a -A
-
streamripper URL -r 9000
-
streamripper URL -r -R 20
SPLITPOINT USAGE EXAMPLES
Each of my songs contain about 5 seconds of the previous song. How can I fix this?
-
streamripper URL --xs_offset=5000
-
streamripper URL --xs_offset=-5000
-
streamripper URL --xs_offset=7500 --xs_padding=2500:2500
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.Streamripper home page:
Sourceforge project page
Shoutcast
Icecast
COPYING
Copyright © 2000-2002 Jon Clegg, © 2004-2009 Gregory C. Sharp. Free use of this software is granted under the terms of the GNU General Public License (GPL).