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

id_transforms #83

Closed
MagicOneFr opened this issue Aug 25, 2024 · 10 comments
Closed

id_transforms #83

MagicOneFr opened this issue Aug 25, 2024 · 10 comments
Assignees
Labels
question A functionality question wontfix This will not be worked on

Comments

@MagicOneFr
Copy link

Hello.
In my json config file I have this :
"id_transforms": [
{ "|FR| CANAL+ 4K HDR UHD (Résolution Exclusive)" : "CanalPlusUhd.fr" },
{ "|FR| DREAMWORKS FHD" : "Dreamworks.fr" },
{ "|FR| L'EQUIPE LIVE 1 FHD" : "LequipeLive1.fr" },
{ "|FR| L'EQUIPE LIVE 2 FHD" : "LequipeLive2.fr" },
{ "|FR| RMC SPORT LIVE 3 FHD" : "rmcsport3.fr" }
],
but in the resulting m3u, the tvg-id remains unchanged. For example :
#EXTINF:-1 tvg-id="" tvg-name="|FR| RMC SPORT LIVE 3 FHD" tvg-logo="https://i.imgur.com/gtuTff6.png" group-title="FR SPORTS (France)",|FR| RMC SPORT LIVE 3 FHD

What's wrong in my config?
Thank you.

@bebo-dot-dev
Copy link
Owner

That tiny snippet of config looks ok as far as I can see. It not working as expected might be due to other config not shown or input data not supplied. Not much to go on here.

@MagicOneFr
Copy link
Author

The full one:
{
"m3uurl": "http://r365mail.contact:2103/get.php?username=XXX&password=YYY&type=m3u_plus&output=ts",
"epgurl": "http://r365mail.contact:2103/xmltv.php?username=XXX&password=YYY",
"groups": [
"FR TV FULL HD|4K (France)",
"FR TV HEVC (France)",
"FR TV HD (France)",
"FR TV BACK UP (SECOURS)",
"FR TV CINEMA FHD ( DOLBY DIGITAL)",
"FR SPORTS (France)",
"FR SPORTS (F1 TV | EUROLEAGUE | LNB)",
"RAKUTEN TV (FRANCE)",
"BELGES (FR-SPORTS-FLAMAND)",
"SUISSES (SWITZERLAND)",
"CANADA ( CA )",
"CANALSAT AF HD (AFRIQUE)"
],
"id_transforms": [
{ "|FR| CANAL+ 4K HDR UHD (Résolution Exclusive)" : "CanalPlusUhd.fr" },
{ "|FR| DREAMWORKS FHD" : "Dreamworks.fr" },
{ "|FR| L'EQUIPE LIVE 1 FHD" : "LequipeLive1.fr" },
{ "|FR| L'EQUIPE LIVE 2 FHD" : "LequipeLive2.fr" },
{ "|FR| RMC SPORT LIVE 3 FHD" : "rmcsport3.fr" }
],
"discard_channels": [" SD" , "▀▄ "],
"no_tvg_id": true,
"no_epg": false,
"force_epg": false,
"no_sort": true,
"outdirectory": "E:\m3u-epg-editor-master",
"outfilename": "azerty365",
"log_enabled": true
}

@bebo-dot-dev
Copy link
Owner

What's going on with the strange characters? Maybe attach a file rather than pasting it or worst case paste it as code so it's at least known to be intentional. Also still no input data so still not much to go on.

@MagicOneFr
Copy link
Author

I have channels with non ascii characters, i guess. But it doesn't seem to be an issue.
input_args2_copy.json

@bebo-dot-dev
Copy link
Owner

@bebo-dot-dev bebo-dot-dev added the pending feedback Pending feedback from the person who created an issue label Aug 26, 2024
@bebo-dot-dev bebo-dot-dev self-assigned this Aug 26, 2024
@MagicOneFr
Copy link
Author

original.zip
here they are

@bebo-dot-dev bebo-dot-dev added question A functionality question investigation Something is being analysed / tested and removed pending feedback Pending feedback from the person who created an issue labels Aug 26, 2024
@bebo-dot-dev
Copy link
Owner

I ran a test with your source data and your json config and it looks to me like your configured transforms are working and are incomplete.

i.e. I see this line ends up in the newly created m3u file with no rewritten tvg-id value because there's no matching |FR| RMC SPORT LIVE 3 HD id transform in the config for the tvg-name.

#EXTINF:-1 tvg-id="" tvg-name="|FR| RMC SPORT LIVE 3 HD" tvg-logo="https://i.imgur.com/gtuTff6.png" group-title="FR SPORTS (France)",|FR| RMC SPORT LIVE 3 HD
http://r365mail.contact:2103/xxx/yyy/45738

For tvg-id transforms to be complete and tvg-id values to be populated where they were originally empty a matching transform rule needs to exist for every tvg-name value where the tvg-id is empty in the source m3u.

There's no bug here as far as I can see, just mismatched config against the source data as mentioned

Script input arguments can become misaligned to input data and changing input data and/or input data quality can be the cause of issues that arise.

@bebo-dot-dev bebo-dot-dev added wontfix This will not be worked on question A functionality question and removed question A functionality question investigation Something is being analysed / tested labels Aug 27, 2024
@MagicOneFr
Copy link
Author

I think I have found why it doesn't work for some channel names. You have to open the json file in utf8 mode like this:
def hydrate_args_from_json(args, json_cfg_file_path): global log_enabled with open(json_cfg_file_path, encoding='utf-8') as json_cfg_file:

This way the accentued characters in channel names are correctly handled.

@bebo-dot-dev
Copy link
Owner

I don't think that's the full story to be honest. The config that you supplied above contains a unicode character and it processes against your supplied m3u/epg data without error on Linux without any code change.

I see however from that config that you appear to be running on a Windows OS and I suspect some of what's going on is related to OS, the environment you're running Python in and possibly also related to what was previously said in here which was another unicode discussion around your Windows OS and terminal/CLI environment.

@MagicOneFr
Copy link
Author

Now I'm using powershell to launch the script. All I can say is that, for me, without the "encoding='utf-8'" parameter it doesn't work for channel names with a "é" and with the parameter, the bug is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A functionality question wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants