UNPKG

node-tunein-radio

Version:

NodeJS Module to browse, search and play streams from TuneIn Radio

1,406 lines (1,405 loc) 1.21 MB
{ "type": "File", "start": 0, "end": 8479, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 324, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 8479, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 324, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 15, "end": 41, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 22, "end": 27, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 12 } }, "local": { "type": "Identifier", "start": 22, "end": 27, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 12 }, "identifierName": "axios" }, "name": "axios" } } ], "source": { "type": "StringLiteral", "start": 33, "end": 40, "loc": { "start": { "line": 3, "column": 18 }, "end": { "line": 3, "column": 25 } }, "extra": { "rawValue": "axios", "raw": "'axios'" }, "value": "axios" } }, { "type": "ImportDeclaration", "start": 42, "end": 89, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 47 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 49, "end": 64, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 22 } }, "local": { "type": "Identifier", "start": 49, "end": 64, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 22 }, "identifierName": "axiosExtensions" }, "name": "axiosExtensions" } } ], "source": { "type": "StringLiteral", "start": 70, "end": 88, "loc": { "start": { "line": 4, "column": 28 }, "end": { "line": 4, "column": 46 } }, "extra": { "rawValue": "axios-extensions", "raw": "'axios-extensions'" }, "value": "axios-extensions" } }, { "type": "ImportDeclaration", "start": 90, "end": 112, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 22 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 97, "end": 100, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 10 } }, "local": { "type": "Identifier", "start": 97, "end": 100, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 10 }, "identifierName": "url" }, "name": "url" } } ], "source": { "type": "StringLiteral", "start": 106, "end": 111, "loc": { "start": { "line": 5, "column": 16 }, "end": { "line": 5, "column": 21 } }, "extra": { "rawValue": "url", "raw": "'url'" }, "value": "url" } }, { "type": "ImportDeclaration", "start": 113, "end": 133, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 20 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 120, "end": 122, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 9 } }, "local": { "type": "Identifier", "start": 120, "end": 122, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 9 }, "identifierName": "qs" }, "name": "qs" } } ], "source": { "type": "StringLiteral", "start": 128, "end": 132, "loc": { "start": { "line": 6, "column": 15 }, "end": { "line": 6, "column": 19 } }, "extra": { "rawValue": "qs", "raw": "'qs'" }, "value": "qs" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * TuneIn class, the main class implementing the module\n *\n * @example\n * let tuneinOptions = {\n * protocol: 'https', // Protocol to use, either http or https\n * cacheRequests: true, // Wheter to cache results or not, default false\n * cacheTTL: 1000 * 60 * 60, // Cache TTL, default 5 minutes\n * partnerId: process.env.TUNEIN_PARTNERID, // PartnerID to be used when interacting with the TuneIn API\n * };\n *\n * let tunein = new TuneIn(tuneinOptions);\n ", "start": 135, "end": 658, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 20, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 659, "end": 8478, "loc": { "start": { "line": 21, "column": 0 }, "end": { "line": 323, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 675, "end": 8478, "loc": { "start": { "line": 21, "column": 16 }, "end": { "line": 323, "column": 1 } }, "id": { "type": "Identifier", "start": 681, "end": 687, "loc": { "start": { "line": 21, "column": 22 }, "end": { "line": 21, "column": 28 }, "identifierName": "TuneIn" }, "name": "TuneIn", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 688, "end": 8478, "loc": { "start": { "line": 21, "column": 29 }, "end": { "line": 323, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 1296, "end": 2050, "loc": { "start": { "line": 33, "column": 2 }, "end": { "line": 58, "column": 3 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 1296, "end": 1307, "loc": { "start": { "line": 33, "column": 2 }, "end": { "line": 33, "column": 13 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 1308, "end": 1315, "loc": { "start": { "line": 33, "column": 14 }, "end": { "line": 33, "column": 21 }, "identifierName": "options" }, "name": "options" } ], "body": { "type": "BlockStatement", "start": 1317, "end": 2050, "loc": { "start": { "line": 33, "column": 23 }, "end": { "line": 58, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 1323, "end": 1347, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 28 } }, "expression": { "type": "AssignmentExpression", "start": 1323, "end": 1346, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 27 } }, "operator": "=", "left": { "type": "Identifier", "start": 1323, "end": 1330, "loc": { "start": { "line": 34, "column": 4 }, "end": { "line": 34, "column": 11 }, "identifierName": "options" }, "name": "options" }, "right": { "type": "LogicalExpression", "start": 1333, "end": 1346, "loc": { "start": { "line": 34, "column": 14 }, "end": { "line": 34, "column": 27 } }, "left": { "type": "Identifier", "start": 1333, "end": 1340, "loc": { "start": { "line": 34, "column": 14 }, "end": { "line": 34, "column": 21 }, "identifierName": "options" }, "name": "options" }, "operator": "||", "right": { "type": "ObjectExpression", "start": 1344, "end": 1346, "loc": { "start": { "line": 34, "column": 25 }, "end": { "line": 34, "column": 27 } }, "properties": [] } } } }, { "type": "VariableDeclaration", "start": 1352, "end": 1395, "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 35, "column": 47 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1356, "end": 1394, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 46 } }, "id": { "type": "Identifier", "start": 1356, "end": 1364, "loc": { "start": { "line": 35, "column": 8 }, "end": { "line": 35, "column": 16 }, "identifierName": "protocol" }, "name": "protocol" }, "init": { "type": "LogicalExpression", "start": 1367, "end": 1394, "loc": { "start": { "line": 35, "column": 19 }, "end": { "line": 35, "column": 46 } }, "left": { "type": "MemberExpression", "start": 1367, "end": 1383, "loc": { "start": { "line": 35, "column": 19 }, "end": { "line": 35, "column": 35 } }, "object": { "type": "Identifier", "start": 1367, "end": 1374, "loc": { "start": { "line": 35, "column": 19 }, "end": { "line": 35, "column": 26 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 1375, "end": 1383, "loc": { "start": { "line": 35, "column": 27 }, "end": { "line": 35, "column": 35 }, "identifierName": "protocol" }, "name": "protocol" }, "computed": false }, "operator": "||", "right": { "type": "StringLiteral", "start": 1387, "end": 1394, "loc": { "start": { "line": 35, "column": 39 }, "end": { "line": 35, "column": 46 } }, "extra": { "rawValue": "https", "raw": "'https'" }, "value": "https" } } } ], "kind": "let" }, { "type": "VariableDeclaration", "start": 1400, "end": 1451, "loc": { "start": { "line": 36, "column": 4 }, "end": { "line": 36, "column": 55 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1404, "end": 1450, "loc": { "start": { "line": 36, "column": 8 }, "end": { "line": 36, "column": 54 } }, "id": { "type": "Identifier", "start": 1404, "end": 1417, "loc": { "start": { "line": 36, "column": 8 }, "end": { "line": 36, "column": 21 }, "identifierName": "cacheRequests" }, "name": "cacheRequests" }, "init": { "type": "LogicalExpression", "start": 1420, "end": 1450, "loc": { "start": { "line": 36, "column": 24 }, "end": { "line": 36, "column": 54 } }, "left": { "type": "MemberExpression", "start": 1420, "end": 1441, "loc": { "start": { "line": 36, "column": 24 }, "end": { "line": 36, "column": 45 } }, "object": { "type": "Identifier", "start": 1420, "end": 1427, "loc": { "start": { "line": 36, "column": 24 }, "end": { "line": 36, "column": 31 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 1428, "end": 1441, "loc": { "start": { "line": 36, "column": 32 }, "end": { "line": 36, "column": 45 }, "identifierName": "cacheRequests" }, "name": "cacheRequests" }, "computed": false }, "operator": "||", "right": { "type": "BooleanLiteral", "start": 1445, "end": 1450, "loc": { "start": { "line": 36, "column": 49 }, "end": { "line": 36, "column": 54 } }, "value": false } } } ], "kind": "let" }, { "type": "VariableDeclaration", "start": 1456, "end": 1506, "loc": { "start": { "line": 37, "column": 4 }, "end": { "line": 37, "column": 54 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1460, "end": 1505, "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 53 } }, "id": { "type": "Identifier", "start": 1460, "end": 1468, "loc": { "start": { "line": 37, "column": 8 }, "end": { "line": 37, "column": 16 }, "identifierName": "cacheTTL" }, "name": "cacheTTL" }, "init": { "type": "LogicalExpression", "start": 1471, "end": 1505, "loc": { "start": { "line": 37, "column": 19 }, "end": { "line": 37, "column": 53 } }, "left": { "type": "MemberExpression", "start": 1471, "end": 1487, "loc": { "start": { "line": 37, "column": 19 }, "end": { "line": 37, "column": 35 } }, "object": { "type": "Identifier", "start": 1471, "end": 1478, "loc": { "start": { "line": 37, "column": 19 }, "end": { "line": 37, "column": 26 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 1479, "end": 1487, "loc": { "start": { "line": 37, "column": 27 }, "end": { "line": 37, "column": 35 }, "identifierName": "cacheTTL" }, "name": "cacheTTL" }, "computed": false }, "operator": "||", "right": { "type": "BinaryExpression", "start": 1491, "end": 1505, "loc": { "start": { "line": 37, "column": 39 }, "end": { "line": 37, "column": 53 } }, "left": { "type": "BinaryExpression", "start": 1491, "end": 1500, "loc": { "start": { "line": 37, "column": 39 }, "end": { "line": 37, "column": 48 } }, "left": { "type": "NumericLiteral", "start": 1491, "end": 1495, "loc": { "start": { "line": 37, "column": 39 }, "end": { "line": 37, "column": 43 } }, "extra": { "rawValue": 1000, "raw": "1000" }, "value": 1000 }, "operator": "*", "right": { "type": "NumericLiteral", "start": 1498, "end": 1500, "loc": { "start": { "line": 37, "column": 46 }, "end": { "line": 37, "column": 48 } }, "extra": { "rawValue": 60, "raw": "60" }, "value": 60 } }, "operator": "*", "right": { "type": "NumericLiteral", "start": 1503, "end": 1505, "loc": { "start": { "line": 37, "column": 51 }, "end": { "line": 37, "column": 53 } }, "extra": { "rawValue": 10, "raw": "10" }, "value": 10 } } } } ], "kind": "let" }, { "type": "VariableDeclaration", "start": 1511, "end": 1551, "loc": { "start": { "line": 38, "column": 4 }, "end": { "line": 38, "column": 44 } }, "declarations": [ { "type": "VariableDeclarator", "start": 1515, "end": 1550, "loc": { "start": { "line": 38, "column": 8 }, "end": { "line": 38, "column": 43 } }, "id": { "type": "Identifier", "start": 1515, "end": 1524, "loc": { "start": { "line": 38, "column": 8 }, "end": { "line": 38, "column": 17 }, "identifierName": "partnerId" }, "name": "partnerId" }, "init": { "type": "LogicalExpression", "start": 1527, "end": 1550, "loc": { "start": { "line": 38, "column": 20 }, "end": { "line": 38, "column": 43 } }, "left": { "type": "MemberExpression", "start": 1527, "end": 1544, "loc": { "start": { "line": 38, "column": 20 }, "end": { "line": 38, "column": 37 } }, "object": { "type": "Identifier", "start": 1527, "end": 1534, "loc": { "start": { "line": 38, "column": 20 }, "end": { "line": 38, "column": 27 }, "identifierName": "options" }, "name": "options" }, "property": { "type": "Identifier", "start": 1535, "end": 1544, "loc": { "start": { "line": 38, "column": 28 }, "end": { "line": 38, "column": 37 }, "identifierName": "partnerId" }, "name": "partnerId" }, "computed": false }, "operator": "||", "right": { "type": "StringLiteral", "start": 1548, "end": 1550, "loc": { "start": { "line": 38, "column": 41 }, "end": { "line": 38, "column": 43 } }, "extra": { "rawValue": "", "raw": "''" }, "value": "" } } } ], "kind": "let" }, { "type": "ExpressionStatement", "start": 1557, "end": 1639, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 40, "column": 86 } }, "expression": { "type": "AssignmentExpression", "start": 1557, "end": 1638, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 40, "column": 85 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1557, "end": 1600, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 40, "column": 47 } }, "object": { "type": "MemberExpression", "start": 1557, "end": 1584, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 40, "column": 31 } }, "object": { "type": "MemberExpression", "start": 1557, "end": 1579, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 40, "column": 26 } }, "object": { "type": "MemberExpression", "start": 1557, "end": 1571, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 40, "column": 18 } }, "object": { "type": "Identifier", "start": 1557, "end": 1562, "loc": { "start": { "line": 40, "column": 4 }, "end": { "line": 40, "column": 9 }, "identifierName": "axios" }, "name": "axios" }, "property": { "type": "Identifier", "start": 1563, "end": 1571, "loc": { "start": { "line": 40, "column": 10 }, "end": { "line": 40, "column": 18 }, "identifierName": "defaults" }, "name": "defaults" }, "computed": false }, "property": { "type": "Identifier", "start": 1572, "end": 1579, "loc": { "start": { "line": 40, "column": 19 }, "end": { "line": 40, "column": 26 }, "identifierName": "headers" }, "name": "headers" }, "computed": false }, "property": { "type": "Identifier", "start": 1580, "end": 1584, "loc": { "start": { "line": 40, "column": 27 }, "end": { "line": 40, "column": 31 }, "identifierName": "post" }, "name": "post" }, "computed": false }, "property": { "type": "StringLiteral", "start": 1585, "end": 1599, "loc": { "start": { "line": 40, "column": 32 }, "end": { "line": 40, "column": 46 } }, "extra": { "rawValue": "Content-Type", "raw": "'Content-Type'" }, "value": "Content-Type" }, "computed": true }, "right": { "type": "StringLiteral", "start": 1603, "end": 1638, "loc": { "start": { "line": 40, "column": 50 }, "end": { "line": 40, "column": 85 } }, "extra": { "rawValue": "application/x-www-form-urlencoded", "raw": "'application/x-www-form-urlencoded'" }, "value": "application/x-www-form-urlencoded" } } }, { "type": "ExpressionStatement", "start": 1644, "end": 1704, "loc": { "start": { "line": 41, "column": 4 }, "end": { "line": 41, "column": 64 } }, "expression": { "type": "AssignmentExpression", "start": 1644, "end": 1703, "loc": { "start": { "line": 41, "column": 4 }, "end": { "line": 41, "column": 63 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1644, "end": 1666, "loc": {