mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 02:47:02 -05:00
adapt tvprofil.com checksum impl
This commit is contained in:
@@ -77,19 +77,20 @@ function buildQuery(site_id, date) {
|
|||||||
callback: 'cb'
|
callback: 'cb'
|
||||||
}
|
}
|
||||||
|
|
||||||
const a = query.datum + query.kanal
|
let c = 3
|
||||||
|
const a = query.datum + query.kanal + c
|
||||||
const ua = query.kanal + query.datum
|
const ua = query.kanal + query.datum
|
||||||
|
|
||||||
let i = a.length,
|
let i = a.length,
|
||||||
b = 2,
|
b = 2
|
||||||
c = 2
|
|
||||||
|
|
||||||
for (var j = 0; j < ua.length; j++) c += ua.charCodeAt(j)
|
for (let j = 0; j < ua.length; j++) c += ua.charCodeAt(j)
|
||||||
while (i--) {
|
while (i--) {
|
||||||
b += (a.charCodeAt(i) + c * 2) * i
|
b += (a.charCodeAt(i) + c * 2) * i
|
||||||
}
|
}
|
||||||
|
|
||||||
const key = 'b' + b.toString().charCodeAt(2)
|
b = b.toString()
|
||||||
|
const key = 'b' + b.charCodeAt(b.length-1)
|
||||||
|
|
||||||
query[key] = b
|
query[key] = b
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const channel = {
|
|||||||
|
|
||||||
it('can generate valid url', () => {
|
it('can generate valid url', () => {
|
||||||
expect(url({ channel, date })).toBe(
|
expect(url({ channel, date })).toBe(
|
||||||
'https://tvprofil.com/bg/tv-programa/program/?datum=2023-01-12&kanal=24kitchen-bg&callback=cb&b55=747917'
|
'https://tvprofil.com/bg/tv-programa/program/?datum=2023-01-12&kanal=24kitchen-bg&callback=cb&b51=818933'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user