Closed arjunior26 closed 4 years ago
Hi there, I think that this is a decent feature request that I would be willing to take on.
A single new argument could work but I think it will be a better logical fit to introduce two new arguments, one that targets group name transformations and the other to target channel names.
I suggest:
group_transforms [GROUP_TRANSFORMS], -gt
- An array of key value pairs representing source group names to target groups names to be applied at processing time.channel_transforms [CHANNEL_TRANSFORMS], -ct
- An array of key value pairs representing source channel names to target channel names to be applied at processing time.If you're ok with this idea I'll have a think about how these arguments will look for both CLI and JSON input.
Hi,
Love your suggestion :) Maybe adding tvg-id transformation argument at processing time will be useful too!
Thank you.
Ok it sounds like a goer, I'll take a look asap.
I have reservations about introducing this same feature for the tvg-id / channel attribute at present due to this being the linking attribute between the m3u data and the epg data. I'm aware that service providers are notoriously bad at maintaining sensible (actually working) linkage data in this area but I feel attempting to fix this is a step too far at the moment.
Let's get the above idea introduced first and then we can review.
Ok, let's go for implementing the two arguments first !
However, I think an option for changing tvd-id value remains legit in case of service providers make typo error like I can find in my current m3u list:
tvg-id="fr.Paramount Channel"
instead of tvg-id="ParamountChannel.fr"
tvg-id="fr.TvBreizh"
instead of tvg-id="TvBreizh.fr"
and others...
Users should probably understand that changing these values can cause problems with their epg ;)
One new commit pushed to the master branch, give that a try.
The -gt / group_transforms
and -ct / channel_transforms
arguments are optional and they can be supplied at the CLI and via JSON config.
They take a small blob of JSON that looks like the following:
{"group_transforms": [
{"UK Entertainment": "UK Entertainment Edited"},
{"UK Movies": "UK Movies Edited"}
]}
and
{"channel_transforms": [
{"BBC 1": "BBC One Edited"},
{"BBC 2": "BBC Two Edited"},
{"More 4": "More 4 Edited"}
]}
String matching is case sensitive and regex pattern matching is not supported in this feature.
Thanks.
Hi,
Hmmm, strange results here but not sure if is related to your modifications.
During creation of xml file,
Will make some investigations here...
EDIT: After verification, filtered m3u file contains all channels
Thanks.
Jolly good, no catastrophic bug found yet by the sound of things. Please give this feature a bit of a test and let me know if it appears to be working as you expect it to. Thanks.
Ok, the problem was due to regex search in is_item_matched() function :( This is probably caused by one more caracter which needs to be escaped in my list... Don't worry about this.
Therefore this new feature works perfectly 👍
Maybe it will be better to change name of channel in addition to tvg-name by replacing
meta += ",%s\n" % entry.name
by meta += ",%s\n" % entry.tvg_name
in save_new_m3u() function.
Thank you.
Thanks for confirming.
I was in two minds about what to do about the .name
property of the m3u entry and ended up leaving it as-is. On reflection I think that you're correct, something needs to be done. Assuming that everyone will always want this value output into the new m3u file as the .tvg_name
value is probably not the right decision though because it is possible (rightly or wrongly) for these props to have different values in the source data. As a compromise I'm going to apply the channel_transforms collection to the .name
value.
Done, the .name
transform change is squashed into the last commit, I'm going to close this now.
If you really do want / need a tvg-id transform feature please open a new issue. Thanks.
Thank you !
Hi,
What do you think about adding one option (argument) to be able to change/correct some values in generated m3u file (incorrect channel names, groups, id, etc..) I add the code below to your python script but it would be nicer if we have a new argument option to use in command line or Json file ;)
Regards.