File daap-get-library
Download: http://nmap.org/svn/scripts/daap-get-library.nse
User Summary
Retrieves a list of music from a DAAP server including the name of the artist, album and songs
Script Arguments
daap_item_limit
Changes the output limit from 100 songs. If set to a negative value, no limit is enforced.
http-max-cache-size, http.useragent, pipeline
See the documentation for the http library.Script Output
| daap-get-library: | BUBBA|TWO | Fever Ray | Fever Ray (Deluxe Edition) | Concrete Walls | I'm Not Done | Here Before | Now's The Only Time I Know | Stranger Than Kindness | Dry And Dusty | Keep The Streets Empty For Me | Triangle Walks | If I Had A Heart | Seven | When I Grow Up |_ Coconut Output will be capped to 100 items if not otherwise specified in the daap_item_limit script argument A daap_item_limit below zero outputs the complete contents of the DAAP library Based on documentation found here: http://www.tapjam.net/daap/
Requires
id .. sessionid ..
author Patrik Karlsson
copyright © Same as Nmap--See http://nmap.org/book/man-legal.html
Functions
| getAttributeAsInt (data, name) | Reads the first item value specified by name |
| getDatabaseId (host, port, sessionid, revid) | Gets the database identitity for the library |
| getItems (host, port, sessionid, revid, dbid, limit) | Request and process all music items |
| getLibraryName (host, port) | Gets the name of the library from the server |
| getRevisionNumber (host, port, sessionid) | Gets the revision number for the library |
| getSessionId (host, port) | Gets the revision number for the library |
| getStringItem (data, pos) | Gets a string item type from data |
| parseItem (data, len) | Parses a single item (mlit) |
Functions
- getAttributeAsInt (data, name)
-
Reads the first item value specified by name
Parameters
- data: string containing the unparsed item
- name: string containing the name of the value to read
Return value:
number - getDatabaseId (host, port, sessionid, revid)
-
Gets the database identitity for the library
Parameters
- host: table containing an ip field.
- port: table containing number and protocol fields.
-
sessionid:
number containing session identifier from
getSessionId -
revid:
number containing the revision id as retrieved from
getRevisionNumber
- getItems (host, port, sessionid, revid, dbid, limit)
-
Request and process all music items
Parameters
- host: table containing an ip field.
- port: table containing number and protocol fields.
-
sessionid:
number containing session identifier from
getSessionId - revid:
-
dbid:
number containing database id from
getDatabaseId - limit: number containing the maximum amount of songs to return
Return value:
table containing the following structure [artist][album][songs] - getLibraryName (host, port)
-
Gets the name of the library from the server
Parameters
- host: table containing an ip field.
- port: table containing number and protocol fields.
Return value:
string containing the name of the library - getRevisionNumber (host, port, sessionid)
-
Gets the revision number for the library
Parameters
- host: table containing an ip field.
- port: table containing number and protocol fields.
-
sessionid:
number containing session identifier from
getSessionId
Return value:
number containing the revision number for the library - getSessionId (host, port)
-
Gets the revision number for the library
Parameters
- host: table containing an ip field.
- port: table containing number and protocol fields.
Return value:
number containing the session identity received from the server - getStringItem (data, pos)
-
Gets a string item type from data
Parameters
- data: string starting with the 4-bytes of length
- pos: number containing offset into data
Return values:
- pos number containing new position after reading string
- value string containing the string item that was read
- parseItem (data, len)
-
Parses a single item (mlit)
Parameters
- data: string containing the unparsed item starting at the first available tag
- len: number containing the length of the item
Return value:
item table containingmikd,miid,minm,asalandasarwhen available




