📄 userguide.html
字号:
quit.<h4><a name=4.8.></a>4.8. Napster vs. OpenNap</h4>Since June 2001, Napster Inc. has modified their servers to use a newclient authentification scheme, and nap users can no longer connect toNapster Inc.'s servers. Thus, nap is configured to connect to theOpenNap servers by default. The OpenNap system is a network of napsterservers that are independently owned (not run by Napster, thecompany). When starting up, nap will automatically download a list ofservers from www.napigator.com, and it will connect to the firstavailable one. You can change this behavior if you want; see <ahref=#7.3.>7.3. Meta-servers</a>.<h4><a name=4.9.></a>4.9. News about new releases</h4>At startup, nap will check online whether a newer release isavailable. If this is the case, it will inform you of the new releasewhile starting up, as a gentle reminder to upgrade. If you never wantto be informed of new releases in this way, put <code>nonews=1</code>in your config file or start nap with the option<code>-ononews</code>. You can also check for news from the mainscreen by typing <code>/news</code>.<h4><a name=4.10.></a>4.10. If you are behind a firewall</h4>Most firewalls allow only outgoing connections, not incoming ones. Thenapster protocol can compensate for this to a certain extent, byarranging things so that firewalled clients initiate connections tonon-firewalled clients, and not the other way around. In this way,both uploads and downloads are possible between a firewalled and anon-firewalled client. However, between two clients that are bothfirewalled, neither uploads nor downloads are possible.<p>If you are behind a firewall, then nap needs to know about it, inorder to be able to compensate for it. However, nap can't find thisout on its own. The way to tell nap that you are behind a firewall isto set <code>dataport = 0</code> in your configuration file (see <ahref=#7.>7. Configuration and user variables</a>).<p>If you are behind a firewall, you may also need to set up an httpproxy so that nap can read its server list; see <ahref=#7.4.>7.4. Http proxies</a>.<!----------------------------------------------------------------------><h2><a name=5.></a>5. More on searching and downloading</h2><h4><a name=5.1.></a>5.1. Advanced searches <font size=3 color=#00ff00><b>[updated 1.5.1]</b></font></h4>The <code>/search</code> command has several options. They are:<p><pre> -m <i>n</i> return at most <i>n</i> search results -l local search: do not search on linked servers -p toggle sending ping requests -f list full filenames (only if noresultscreen=1) -b=<i>rate</i>, -b<<i>rate</i>, -b><i>rate</i> bitrate equal to, at most, or at least <i>rate</i>. -c=<i>speed</i>, -c<<i>speed</i>, -c><i>speed</i> link speed equal to, at most, or at least <i>speed</i>. -r=<i>freq</i>, -r<<i>freq</i>, -r><i>freq</i> sample rate equal to, at most, or at least <i>freq</i>. -s=<i>size</i>, -s<<i>size</i>, -s><i>size</i> file size equal to, at most, or at least <i>size</i>, in bytes (opennap and slavanap only). -d=<i>duration</i>, -s<<i>duration</i>, -s><i>duration</i> duration equal to, at most, or at least <i>duration</i>, in seconds (opennap and slavanap only). <font size=3 color=#00ff00><b>[new 1.5.1]</b></font> -x <i>keyword</i> exclude results that match keyword (opennap and slavanap only). Multiple -x options are possible. <font size=3 color=#00ff00><b>[new 1.5.1]</b></font> -t <i>filetype</i> search for the specified filetype, which must be one of: audio, video, text, image, application, mp3, any. <font size=3 color=#00ff00><b>[new 1.5.1]</b></font></pre>The "-s" option only works on OpenNap servers; it has no effect on Napster.<p>The "-l" option will cause the search to only be performed on theserver you're connected to, and not on any other servers that might belinked to it in a network. <p>The "-m" option limits the number of results returned. However, evenif <i>n</i> is greater than 100, most servers will only return 100results.<h4><a name=5.2.></a>5.2. Pings</h4>Pings are test packages that are sent to other clients to see how "faraway" they are in the internet. A ping result is the time, inmilliseconds, that it took the package to travel to the other clientand back. Normally, nap will try to collect ping results with eachsearch request. You can switch off pinging by giving the "-p" optionto the <code>/search</code> command, or by setting the user variable<code>noping</code> to 1. <p>Nap implements pings via a separate helper application called"napping". The reason is that sending and receiving pingpackets requires raw network protocol access, which usually requiresroot privileges on Linux. However, it would be dangerous to run napwith root privileges. The program "napping", written bySebastian Zagrodzki, solves this problem. Napping is a very smallprogram which is called by nap to handle pings. Napping, unlike nap,can be run "suid", i.e., with root privileges. This is safe becausenapping drops root privileges immediately after opening the networksocket, which is in fact the first thing it does.<p>For napping to work, it must be installed somewhere in your $PATH, itmust be owned by root, and it must have "suid" permissions. Thus, thepermissions of napping should look like this:<pre> -rwsr-xr-x 1 root root 48417 Aug 29 17:54 napping*</pre>The "s" in the permissions is called the "suid" bit, and it means thatnapping will be run with the effective user id of root, rather thanthat of the user who actually runs it. You can set the right ownershipand permissions with the following commands (assuming that napping isinstalled in /usr/local/bin):<pre> chown root:root /usr/local/bin/napping chmod 4755 /usr/local/bin/napping</pre>You can specify an alternative name for the napping program by settingthe <code>napping</code> user variable. You can also use this tospecify an absolute filename, which is useful in case napping isinstalled outside your $PATH (see <a href=#7.2.>7.2. Uservariables</a>).<h4><a name=5.3.></a>5.3. Advanced navigation of the search result screen</h4>By default, the result screen displays the bitrate and length of eachsong, as well as the connection speed and/or ping results. However,you have full control over what information is displayed: Thefollowing keys toggle each category of information on and off:<pre> b - bitrate l - length m - megabytes f - frequency u - user name s - speed p - ping</pre>The "m" key also toggles between displaying the file size in megabytesand in bytes. Moreover, if you press "a", all categories ofinformation will be turned on, and if you press "n", they will all beturned off (i.e., you will only see the filenames).<p>The search results can also be sorted by various differentcriteria. Pressing the uppercase equivalents of the above keys ("B","L", etc) will sort the search results by that particular category(bitrate, length...). You can also press "N" (uppercase) to sort byfilename, and "D" to sort by directory name. Sorting by directory nameis useful if there are many files whose names start with "01", "02",and so on. If you press a sort key more than once, the items willalternately be sorted in ascending and descending order.<p>When you sort, the cursor will remain on the same item that it wason. Thus, if your cursor is on an item shared by a particular user,and you press "U", you will see other items of the same usernearby. Notice that after sorting, the search results are re-numberedstarting from 1. Any subsequent <code>/get</code> commands must usethe new numbering. <p>If you prefer an appearance of the search result screen different fromthe default appearance, you can set the <code>sdefaults</code> uservariable to a string of key strokes executed when that screen isinitialized. The default is "blsp". You can set it, for instance, to"lspmm" if you don't want to see the bitrate, but instead the filesize in bytes. You can also set it to something like "blspN" if youlike your results sorted by name, rather than by connectionspeed. Note that ping results will only be displayed if they areactually available, and connection speeds will not be displayed forbrowse results.<h4><a name=5.4.></a>5.4. Shortcut searches</h4>A convenience features allows you to enter a new search directly fromthe search result screen or download/upload screen. Just type "space",and an input window will open in the status line with the prefix"/search " entered for you. You can also type '/' to take you back tothe main screen and start a new command (a shortcut for 'q', '/').<h4><a name=5.5.></a>5.5. Incomplete downloads and turds</h4>Files that are currently downloading are kept in your "incomplete"directory. They also have the suffix ".incomplete" added to theirfilename (or alternatively the suffix defined by the user variable"incompletesuffix", if any). When a download has been successfullycompleted, the suffix is removed and the file is moved to your"download" directory.<p>Nap will, by default, delete any incomplete files whose size is 100000bytes or smaller. Nap considers such files "turds": they are too smallto be of any value, and just tend to clutter up your hard drive. Youcan override the default cutoff of 100000 bytes by setting the uservariable "turdsize" (see <a href=#7.2.>7.2. User variables</a>). Inparticular, if you set turdsize to 0, only empty files will bedeleted, and if you set it to -1, no files will be deleted at all.<p>Note that the turdsize only applies to <i>incomplete</i> files. Napwill never delete a completed file, even if the file size is verysmall.<p>Note that the convention on incomplete files makes it possible tochoose the same directory as your download directory and yourincomplete directory (incomplete files will still be recognizablebecause they have the suffix ".incomplete"). On the other hand, youmay choose to include your download directory in your upload path.However, you should never include your incomplete directory in yourupload path, as people will probably not be too happy aboutdownloading your incomplete files.<p>If you try to download two files with identical names, nap willautomatically rename one of the files before saving them.<h4><a name=5.6.></a>5.6. Upload and download limits and queueing</h4>If <code>maxuploads</code> is set, it defined a limit on the totalnumber of simultaneous uploads. A per-user limit can be set in thevariable <code>maxupuser</code>. You can limit the maximal number of simultaneous uploads anddownloads, both globally and for each remote user. To limit thenumber of simultaneous uploads or downloads, set the user variables<code>maxuploads</code> and <code>maxdownloads</code> to the desirednumber. To limit the number of simultaneous uploads or downloads fromeach user, use the user variables <code>maxupuser</code> and<code>maxdownuser</code>. By default, there are no limits.<p>When the download limit is reached, nap will queue any additionaldownloads, and it will start them as soon as space is available.Queued downloads will be listed along with all other downloads on thedownload/upload screen. If you want to force a queued download to bestarted immediately, you can do so by pressing 'f' on thedownload/upload screen.<h4><a name=5.7.></a>5.7. Purging and retrying failed items</h4>By default, items which are stopped (finished, interrupted, timed out,or failed) are not automatically removed from the download list. Theyremain on the list until you remove them explicitly. Individual itemscan be removed from the download screen by pressing 'd'. You can alsopress 'P' to purge all stopped items in the current section (i.e., alluploads or all downloads). <p>If you prefer stopped items to be automatically purged, you can setthe user variable <code>autopurge</code> to 0. You can also set<code>autopurge</code> to a positive number, if you want items to bepurged after this many seconds. The variables <code>autopurgeup</code>and <code>autopurgedown</code> allow you to set these parameters foruploads and downloads separately.<p>A download which has been interruped, or which has timed out orfailed, can be retried by pressing 'r' on the item on the downloadscreen. You can also retry all such items with a single keystroke bypressing 'R'.<h4><a name=5.8.></a>5.8. Limiting bandwidth</h4>It is possible to limit the bandwidth of up- and downloads. It ispossible to set a limit on the bandwidth per connection, and to set anoverall limit on the total bandwidth taken by all connections. This isdone separately for uploads and downloads. Up- and download bandwidthlimits are given in kilobytes per second, and they are set via theuser variables <code>bandwidthup</code>, <code>bandwidthup1</code>,<code>bandwidthdown</code>, <code>bandwidthdown1</code>. See <ahref=#7.2.>7.2. User variables</a>.<p>It is possible to change the bandwidth limits at any time. Suchchanges will immediately take effect, even for transfers that arealready in progress. Note that bandwidth limits for downloads onlyaffect the rate at which nap reads data, not the rate at which dataarrives from the network. If data arrives on the network at a higherrate than nap reads it, then the operating system will usually buffersuch data. Thus, the actual network bandwidth may not go down untilthe buffer is full.<p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -