mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
adapt tvprofil.com checksum impl
This commit is contained in:
parent
35272ea0a4
commit
7231180cf0
2 changed files with 7 additions and 6 deletions
|
@ -77,19 +77,20 @@ function buildQuery(site_id, date) {
|
|||
callback: 'cb'
|
||||
}
|
||||
|
||||
const a = query.datum + query.kanal
|
||||
let c = 3
|
||||
const a = query.datum + query.kanal + c
|
||||
const ua = query.kanal + query.datum
|
||||
|
||||
let i = a.length,
|
||||
b = 2,
|
||||
c = 2
|
||||
b = 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--) {
|
||||
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
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ const channel = {
|
|||
|
||||
it('can generate valid url', () => {
|
||||
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'
|
||||
)
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue