@@ -9,10 +9,10 @@ dayjs.extend(utc)
9
9
dayjs . extend ( timezone )
10
10
dayjs . extend ( customParseFormat )
11
11
12
- const tz = 'Europe/Belgrade'
13
-
14
12
module . exports = {
15
13
site : 'tvarenasport.com' ,
14
+ tz : 'Europe/Belgrade' ,
15
+ lang : 'sr' ,
16
16
days : 2 ,
17
17
request : {
18
18
cache : {
@@ -40,7 +40,7 @@ module.exports = {
40
40
. siblings ( '.tv-scheme-new-slider-wrapper' )
41
41
. find ( '.tv-scheme-new-slider-item' ) . toArray ( )
42
42
. forEach ( ( el , i ) => {
43
- programs . push ( ...parseSchedules ( $ ( el ) , dates [ i ] ) )
43
+ programs . push ( ...parseSchedules ( $ ( el ) , dates [ i ] , module . exports . tz ) )
44
44
} )
45
45
programs . forEach ( ( s , i ) => {
46
46
if ( i < programs . length - 2 ) {
@@ -57,7 +57,7 @@ module.exports = {
57
57
async channels ( ) {
58
58
const channels = [ ]
59
59
const data = await axios
60
- . get ( 'https://www.tvarenasport.com/tv-scheme' )
60
+ . get ( this . url )
61
61
. then ( r => r . data )
62
62
. catch ( console . error )
63
63
@@ -84,7 +84,7 @@ module.exports = {
84
84
const [ , id ] = $ ( item ) . attr ( 'src' ) . match ( / c h a n e l - ( [ a - z 0 - 9 ] + ) \. p n g / ) || [ null , null ]
85
85
if ( id ) {
86
86
channels . push ( {
87
- lang : 'sr' ,
87
+ lang : this . lang ,
88
88
site_id : id ,
89
89
name : names ( id )
90
90
} )
@@ -96,18 +96,18 @@ module.exports = {
96
96
}
97
97
}
98
98
99
- function parseSchedules ( $s , date ) {
99
+ function parseSchedules ( $s , date , tz ) {
100
100
const schedules = [ ]
101
101
const $ = $s . _make
102
102
$s . find ( '.slider-content' ) . toArray ( )
103
103
. forEach ( el => {
104
- schedules . push ( parseSchedule ( $ ( el ) , date ) )
104
+ schedules . push ( parseSchedule ( $ ( el ) , date , tz ) )
105
105
} )
106
106
107
107
return schedules
108
108
}
109
109
110
- function parseSchedule ( $s , date ) {
110
+ function parseSchedule ( $s , date , tz ) {
111
111
const time = $s . find ( '.slider-content-top span' ) . text ( )
112
112
const start = dayjs . tz ( `${ date . format ( 'YYYY-MM-DD' ) } ${ time } ` , 'YYYY-MM-DD HH:mm' , tz )
113
113
const category = $s . find ( '.slider-content-middle span' ) . text ( )
0 commit comments