Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: tvg-country, tvg-language, tvg-logo are missing since #6488 #6516

Closed
cy8018 opened this issue Feb 24, 2022 · 9 comments
Closed

Fix: tvg-country, tvg-language, tvg-logo are missing since #6488 #6516

cy8018 opened this issue Feb 24, 2022 · 9 comments
Assignees
Labels
bug Something is not working right

Comments

@cy8018
Copy link

cy8018 commented Feb 24, 2022

Describe your issue

tvg-country, tvg-language, tvg-logo are missing since #6488.
And a lot of tvg-id are emptied since this update, for example in cn.m3u:

image

Is this by design or a bug?

Thank you.

@cy8018 cy8018 added the bug Something is not working right label Feb 24, 2022
@freearhey
Copy link
Collaborator

This is not a bug. Details: https:/iptv-org/iptv/discussions/6340

@cy8018
Copy link
Author

cy8018 commented Feb 25, 2022

This is not a bug. Details: #6340

@freearhey Thank you for the explanations. That is a good idea have the new API.
But there's another issue: this commit 7c524a0 not only removed the tvg-country, tvg-language, tvg-logo tags, but also have other impact:
Most (1252 out of 1471) of the tvg-id are emptied in cn.m3u. Which makes it impossible for me to link the channels to the database. I didn't check for all the files, but at least this has happened to cn.m3u

image

Would you please fix this? Thanks a lot.

@freearhey
Copy link
Collaborator

The repository now only uses ids from iptv-org/database. Most tvg-id remained the same, but unfortunately in the case of Chinese channels it is not possible to automatically pick up the correct ID. So the remaining tvg-id will have to be filled in manually, which will take some time.

Meanwhile, you can generate tvg-ids based on the channel name yourself as it was done before like so:

generate('东至影视', 'cn') => 'DongZhiYingShi.cn'

iptv/scripts/core/id.js

Lines 1 to 19 in 78190ea

const { transliterate } = require('transliteration')
const id = {}
id.generate = function (name, code) {
if (!name || !code) return null
name = name.replace(/ *\([^)]*\) */g, '')
name = name.replace(/ *\[[^)]*\] */g, '')
name = name.replace(/\+/gi, 'Plus')
name = name.replace(/[^a-z\d]+/gi, '')
name = name.trim()
name = transliterate(name)
code = code.toLowerCase()
return `${name}.${code}`
}
module.exports = id

or use the names themselves as an id.

@cy8018
Copy link
Author

cy8018 commented Feb 26, 2022

The repository now only uses ids from iptv-org/database. Most tvg-id remained the same, but unfortunately in the case of Chinese channels it is not possible to automatically pick up the correct ID. So the remaining tvg-id will have to be filled in manually, which will take some time.

Meanwhile, you can generate tvg-ids based on the channel name yourself as it was done before like so:

generate('东至影视', 'cn') => 'DongZhiYingShi.cn'

iptv/scripts/core/id.js

Lines 1 to 19 in 78190ea

const { transliterate } = require('transliteration')
const id = {}
id.generate = function (name, code) {
if (!name || !code) return null
name = name.replace(/ *\([^)]*\) */g, '')
name = name.replace(/ *\[[^)]*\] */g, '')
name = name.replace(/\+/gi, 'Plus')
name = name.replace(/[^a-z\d]+/gi, '')
name = name.trim()
name = transliterate(name)
code = code.toLowerCase()
return `${name}.${code}`
}
module.exports = id

or use the names themselves as an id.

I'd like to help on fill in the Chinese ids, can you please let me know where should I make the changes?
Is it directly in the https:/iptv-org/database/blob/master/data/channels.csv or in any other scripts?

Thanks.

@freearhey
Copy link
Collaborator

If you just want to specify the correct id for the Chinese channels, it's enough to edit streams/cn.m3u file itself, like so:

#EXTINF:-1 tvg-id="CCTV3.cn" status="online",CCTV-3综艺 (1080p)

To search for the correct ids, you can use https://iptv-org.github.io/

Most of the Chinese channels are already in the database, they just have an English name. For example, 影视频道 is saved as Anhui Film and Video Channel and has the id AnhuiFilmandVideoChannel.cn.

If some channel is not in the database or you find an error in its description, then yes, you can fix it directly in the channels.csv file.

@cy8018
Copy link
Author

cy8018 commented Feb 26, 2022

One question here, should the column "Name" attribute in the channels.csv be in English or in their native languages?
If it is necessary to keep a English name here, then I would suggest to add another column "native_name" in the file, which would be very useful for developers to create user friendly apps.

@freearhey
Copy link
Collaborator

That's a great idea! I will try to add this field to the file in the next couple of days.

@freearhey
Copy link
Collaborator

Field native_name added to the table: https:/iptv-org/database#channels

@cy8018
Copy link
Author

cy8018 commented Mar 1, 2022

Thank you for the notice, I will try to add/update the Chinese channels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working right
Development

No branches or pull requests

2 participants