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
|
// Torrent and content test files. Content is Public Domain or Creative Commons.
var fs = require('fs')
var path = require('path')
var parseTorrent = require('parse-torrent')
module.exports = {
// Leaves of Grass, by Walt Whitman
leaves: {
contentPath: path.join(__dirname, 'fixtures', 'Leaves of Grass by Walt Whitman.epub'),
torrentPath: path.join(__dirname, 'fixtures', 'leaves.torrent'),
content: fs.readFileSync(path.join(__dirname, 'fixtures', 'Leaves of Grass by Walt Whitman.epub')),
torrent: fs.readFileSync(path.join(__dirname, 'fixtures', 'leaves.torrent')),
parsedTorrent: parseTorrent(fs.readFileSync(path.join(__dirname, 'fixtures', 'leaves.torrent'))),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(fs.readFileSync(path.join(__dirname, 'fixtures', 'leaves.torrent'))))
},
// Alice's Adventures in Wonderland, by Lewis Carroll
alice: {
contentPath: path.join(__dirname, 'fixtures', 'alice.txt'),
torrentPath: path.join(__dirname, 'fixtures', 'alice.torrent'),
content: fs.readFileSync(path.join(__dirname, 'fixtures', 'alice.txt')),
torrent: fs.readFileSync(path.join(__dirname, 'fixtures', 'alice.torrent')),
parsedTorrent: parseTorrent(fs.readFileSync(path.join(__dirname, 'fixtures', 'alice.torrent'))),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(fs.readFileSync(path.join(__dirname, 'fixtures', 'alice.torrent'))))
},
// Folder which contains single file
folder: {
contentPath: path.join(__dirname, 'fixtures', 'folder'),
torrentPath: path.join(__dirname, 'fixtures', 'folder.torrent'),
torrent: fs.readFileSync(path.join(__dirname, 'fixtures', 'folder.torrent')),
parsedTorrent: parseTorrent(fs.readFileSync(path.join(__dirname, 'fixtures', 'folder.torrent'))),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(fs.readFileSync(path.join(__dirname, 'fixtures', 'folder.torrent'))))
},
// Folder which contains multiple files
numbers: {
contentPath: path.join(__dirname, 'fixtures', 'numbers'),
torrentPath: path.join(__dirname, 'fixtures', 'numbers.torrent'),
torrent: fs.readFileSync(path.join(__dirname, 'fixtures', 'numbers.torrent')),
parsedTorrent: parseTorrent(fs.readFileSync(path.join(__dirname, 'fixtures', 'numbers.torrent'))),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(fs.readFileSync(path.join(__dirname, 'fixtures', 'numbers.torrent'))))
},
// Torrent file with "private" flag
bunny: {
torrentPath: path.join(__dirname, 'fixtures', 'bunny-private.torrent'),
torrent: fs.readFileSync(path.join(__dirname, 'fixtures', 'bunny-private.torrent')),
parsedTorrent: parseTorrent(fs.readFileSync(path.join(__dirname, 'fixtures', 'bunny-private.torrent')))
}
}
|