Belfagor2005 / oZeta_skin

Skin by MMark (OpenAtv - OpenPLi - OpenSPA
Creative Commons Zero v1.0 Universal
6 stars 1 forks source link

Event view not working & zposterx needs some improvements #2

Open Insprion80 opened 11 months ago

Insprion80 commented 11 months ago

Actually, it work in amazing way especially on level of speed, poster accuracy and integrity.

However, there are some notices I would like to share it with you. I attached the posterx version to check if it the most updated one or not.

In the image above, you can see the first two posters from the left side, represent same event but different seasons, adding season no. In that way cause problem in poster download process. Moreover ; presence of ( ) beside the event name cause failure in poster download, another example below

Also in the above example, change letters case (upper or lower) make incorrect poster selection,

I am not sure, which criteria used to pickup a spacific poster for a specific event, but I think you can tune it to eliminate such conflicts.

Finally again even view screen not showing when you call it by info button, I am not sure if this a problem in my side or you already plan to fix it.

Thanks a lot for your efforts. screenshot_yes-Movies-Comedy-HD_20231102_095058 screenshot_yes-Movies-Comedy-HD_20231102_094349 ![Uploading screenshot_AMC_20231102_094023.jpg…]()

Regards

Belfagor2005 commented 11 months ago

I was unable to remove the seasons.

Even the help of my friend KiddaC didn't give me a chance

from code @KiddaC

searchtitle = title.lower()
# if title ends in "the", move "the" to the beginning
if searchtitle.endswith("the"):
    searchtitle.rsplit(" ", 1)[0]
    searchtitle = searchtitle.rsplit(" ", 1)[0]
    searchtitle = "the " + str(searchtitle)
# remove xx: at start
searchtitle = re.sub(r'^\w{2}:', '', searchtitle)
# remove xx|xx at start
searchtitle = re.sub(r'^\w{2}\|\w{2}\s', '', searchtitle)
# remove || content at start
searchtitle = re.sub(r'^\|[\w\-\|]*\|', '', searchtitle)
# remove () content
n = 1  # run at least once
while n:
    searchtitle, n = re.subn(r'\([^\(\)]*\)', '', searchtitle)
# remove [] content
n = 1  # run at least once
while n:
    searchtitle, n = re.subn(r'\[[^\[\]]*\]', '', searchtitle)
bad_chars = ["1080p-dual-lat-cinecalidad.mx", "1080p-lat-cinecalidad.mx", "1080p-dual-lat-cine-calidad.com-1", "1080p-dual-lat-cine-calidad.com", "1080p-lat-cine-calidad.com-1", "1080p-lat-cine-calidad.com",
             "1080p.dual.lat.cine-calidad.com",

             "sd", "hd", "fhd", "uhd", "4k", "vod", "1080p", "720p", "blueray", "x264", "aac", "ozlem", "hindi", "hdrip", "imdb", "top250", "multi-audio",
             "multi-subs", "multi-sub", "multisub",

             "ex-yu:",

             "-ae-", "-al-", "-ar-", "-at-", "-ba-", "-be-", "-bg-", "-br-", "-cg-", "-ch-", "-cz-", "-da-", "-de-", "-dk-", "-ee-", "-en-", "-es-", "-ex-yu-", "-fi-", "-fr-", "-gr-", "-hr-", "-hu-", "-in-", "-ir-", "-it-", "-lt-", "-mk-",
             "-mx-", "-nl-", "-no-", "-pl-", "-pt-", "-ro-", "-rs-", "-ru-", "-se-", "-si-", "-sk-", "-tr-", "-uk-", "-us-", "-yu-",
             "|ae|", "|al|", "|ar|", "|at|", "|ba|", "|be|", "|bg|", "|br|", "|cg|", "|ch|", "|cz|", "|da|", "|de|", "|dk|", "|ee|", "|en|", "|es|", "|eu|", "|ex-yu|", "|fi|", "|fr|", "|gr|", "|hr|", "|hu|", "|in|", "|ir|", "|it|", "|lt|", "|mk|",
             "|mx|", "|nl|", "|no|", "|pl|", "|pt|", "|ro|", "|rs|", "|ru|", "|se|", "|si|", "|sk|", "|tr|", "|uk|", "|us|", "|yu|",

             "(", ")", "[", "]", "u-", "3d", "'", "#", "/"]

for j in range(1900, 2025):
    bad_chars.append(str(j))

for i in bad_chars:
    searchtitle = searchtitle.replace(i, "")

bad_suffix = [" de", " al", " nl", " pt", " pl", " ru", " ar", " ro", " gr", " fi", " no", " rs", " ba", " si", " mk", " ex-yu", " hr", " yu", " fr", " da", " es", " sw", " swe", " tr", " en", " uk", "eu"]

for i in bad_suffix:
    if searchtitle.endswith(i):
        suffixlength = len(i)
        searchtitle = searchtitle[:-suffixlength]
searchtitle = searchtitle.replace("multi:", "").replace(".", " ").replace("_", " ").replace("  ", " ").replace("'", "")
searchtitle = searchtitle.strip("-")
searchtitle = searchtitle.strip()
searchtitle = quote(searchtitle, safe="")

This system is leaner, the xtravent plugins system is better, aims to download everything in the background, maybe a little heavy on memory. Unfortunately, you can't have everything. Maybe if you have ideas you can share them with me and treasure them. Thank you

Insprion80 commented 10 months ago

I think the root cause of the problem is Regex design itself, it is not cover all non standard character comes with epg data, such as (), -,!,? as well as strange order of EPG data.

Below is the last working regex I had tested and working good so far

REGEX = re.compile( r'([([]).?([)]])|' # Match text within brackets or parentheses r'(: odc.\d+)|' # Match ": odc." r'(\d+: odc.\d+)|' # Match ": odc." r'(\d+ odc.\d+)|' # Match " odc." r'(:)|' # Match colons r'( -(.?).)|(,)|' # Match dashes and commas r'!|' # Match exclamation marks r'/.|' # Match forward slashes and everything after r'|\s[0-9]++|' # Match "| +" r'[0-9]++|' # Match "+" r'\s*\d{4}\Z|' # Match space followed by asterisk and 4 digits at the end r'([([|].*?[)]|])|' # Match text within extended brackets or parentheses r'(\"|\".|\"\,|.)\s.+|' # Match quotes followed by space and any text r'\"|:|' # Match quotes and colons r'Премьера.\s|' # Match "Премьера. " r'(х|Х|м|М|т|Т|д|Д)/ф\s|' # Match "х/ф ", "Х/ф ", etc. r'(х|Х|м|М|т|Т|д|Д)/с\s|' # Match "х/с ", "Х/с ", etc. r'\s(с|С)(езон|ерия|-н|-я)\s.+|' # Match space followed by "сезон", "ерия", "-н", "-я" and any text r'\s\d{1,3}\s(ч|ч.|с.|с)\s.+|' # Match space, digits, space, "ч", "ч.", "с.", "с" and any text r'.\s\d{1,3}\s(ч|ч.|с.|с)\s.+|' # Match dot, space, digits, space, "ч", "ч.", "с.", "с" and any text r'\s(ч|ч.|с.|с)\s\d{1,3}.+|' # Match space, "ч", "ч.", "с.", "с", space, digits, and any text r'\d{1,3}(-я|-й|\sс-н).+|', # Match digits followed by "-я", "-й", or "с-н" and any text re.DOTALL)

I was trying to add some additions to cover the rest but unfortunately something wrong continue to happen. May be you have better chance than me, I am not a programmer, I am just trying to tune it by trials

I think we should add option like this to the current regex but may be it is not match with enigma2

r'[a-zA-Z0-9\s()[].,:!"*+-]+|([a-zA-Z0-9]+\s:\s[a-zA-Z]+)',

This is example but not working

REGEX = re.compile( r'[([][^)]][)]]|: odc.\d+|\d+: odc.\d+|\d+ odc.\d+|:| -(.?)\w|,|!|/.||\s\d++|\d++|\s*\d{4}\Z|[([][^)]][)]]|\"|:|Премьера.\s|(х|Х|м|М|т|Т|д|Д)/[фс]\s|\s(с|С)(езон|ерия|-н|-я)\s.+\d{1,3}(-я|-й|\sс-н).|\d+: odc.\s?\d+|\d+\s(odc.\s?\d+)|\d+\s-\s\d+|[A-Za-z]+: Episode \d+|[A-Za-z]+\s[A-Z][a-z]\s(\w+.\s\d+)|[A-Z][a-z]\s[A-Z][a-z]\s[1-9]\s(odc.\s\d+)|[A-Z][a-z]\s[A-Z][a-z]:\s[A-Z][a-z]*\s\d+\s-\s\d+|[A-Z]+\s[A-Z]+|[A-Z][a-z]+' re.DOTALL)

Please give it a look and may be you can tune it better than me.

Regards

Belfagor2005 commented 9 months ago

hello try if work now

https://github.com/Belfagor2005/oZeta_skin/commit/f936eece3a0d934cff847a248755382da2453fdd

Insprion80 commented 9 months ago

hello try if work now

f936eec

Merry Christmas to you and your family with my best wishes for happy holidays,

I tried the updated version of ozeta skin which work perfect from skin side but for zposterx still the problem persist, I used two images openatv 7.4 Devel and egami 10.4 r15 for test.

Events name with (), -, : facing same issue no posters found. As per images below,

However, this version of zposterx is very fast in search and posters downland, for the first time I have the following it downloading posters in background without the needs to zap to each service. screenshot_yes-Movies-Kids-HD_20231226_074607 screenshot_yes-Movies-Kids-HD_20231226_074533 screenshot_Rai-4-HD_20231226_074354 screenshot_CANAL--FAMILY-HD_20231226_074121 screenshot_CANAL--FAMILY-HD_20231226_074048 screenshot_CANAL--FAMILY-HD_20231226_073943 screenshot_CANAL--FAMILY-HD_20231226_073827 screenshot_CANAL--FAMILY-HD_20231226_072209 screenshot_CANAL--FAMILY-HD_20231226_072150

​​​​