forked from jnafolayan/o2tv-dl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurlTransforms.js
51 lines (37 loc) · 1.44 KB
/
urlTransforms.js
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
const fileCases = require('./fileCases');
const generateServerId = () => 2 + Math.floor(Math.random() * 6)
module.exports = [
({ id, repo, series, season, episode, seasonNum, episodeNum, format }) => {
// const serverId = generateServerId()
let filename;
if (format == 'hd')
filename = `${series} - S${seasonNum}E${episodeNum} HD (${repo})`;
else
filename = `${series} - S${seasonNum}E${episodeNum} (${repo})`;
if (fileCases[series.toLowerCase()])
filename = fileCases[series.toLowerCase()](filename, { seasonNum, episodeNum });
filename += ' qvlma';
if (format == 'hd')
filename += '.mp4';
else
filename += `.${format}`;
const url = `http://d${id}.o2tvseries.club/${series}/${season}/${filename}`;
return { url, filename }
},
({ id, repo, series, season, episode, seasonNum, episodeNum, format }) => {
// const id = generateServerId()
let filename;
if (format == 'hd')
filename = `${series} - S${seasonNum}E${episodeNum} HD (${repo})`;
else
filename = `${series} - S${seasonNum}E${episodeNum} (${repo})`;
if (fileCases[series.toLowerCase()])
filename = fileCases[series.toLowerCase()](filename, { seasonNum, episodeNum });
if (format == 'hd')
filename += '.mp4';
else
filename += `.${format}`;
const url = `http://d${id}.o2tvseries.com/${series}/${season}/${filename}`;
return { url, filename }
},
]