Merge pull request #2245 from GenericMale/fix-tvprofil.com

Fix tvprofil.com
This commit is contained in:
Aleksandr Statciuk 2023-11-22 10:33:34 +03:00 committed by GitHub
commit 868c2b9309
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -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

View file

@ -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'
)
})